expxagents 0.23.4 → 0.23.6

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeBackground-8UywK1HF.js","assets/three-BZk_I9Ly.js","assets/browserAll-BIYvjpLn.js","assets/webworkerAll-BVyCZ61t.js","assets/WebGPURenderer-CagvVx3-.js","assets/BufferResource-B3NvaiJg.js","assets/RenderTargetSystem-DBfDI5Sl.js","assets/WebGLRenderer-DOwJATTm.js","assets/CanvasRenderer-CQD8OFie.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreeBackground-BJYqxm3t.js","assets/three-BZk_I9Ly.js","assets/browserAll-B0GfJV5B.js","assets/webworkerAll-efCwQfSA.js","assets/WebGPURenderer-Chgxd6GA.js","assets/BufferResource-DHIH4vRM.js","assets/RenderTargetSystem-CdD9VM4E.js","assets/WebGLRenderer-DAij1hcL.js","assets/CanvasRenderer-DTA7H2ex.js"])))=>i.map(i=>d[i]);
2
2
  var q8=Object.defineProperty;var F8=(t,e,n)=>e in t?q8(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var QA=(t,e,n)=>F8(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();const G8="modulepreload",Y8=function(t){return"/"+t},FM={},$f=function(e,n,s){let o=Promise.resolve();if(n&&n.length>0){let u=function(p){return Promise.all(p.map(g=>Promise.resolve(g).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=u(n.map(p=>{if(p=Y8(p),p in FM)return;FM[p]=!0;const g=p.endsWith(".css"),x=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":G8,g||(v.as="script"),v.crossOrigin="",v.href=p,h&&v.setAttribute("nonce",h),document.head.appendChild(v),g)return new Promise((E,S)=>{v.addEventListener("load",E),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return e().catch(l)})};function Jf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ZA={exports:{}},CN={},JA={exports:{}},g1={exports:{}};g1.exports;var GM;function $8(){return GM||(GM=1,(function(t,e){/**
3
3
  * @license React
4
4
  * react.development.js
@@ -286,7 +286,7 @@ You might need to use a local HTTP server (instead of file://): https://react.de
286
286
 
287
287
  Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let g=wc(),x;if(e){let A=typeof e=="string"?mv(e):e;zr(h==="/"||((D=A.pathname)==null?void 0:D.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${A.pathname}" was given in the \`location\` prop.`),x=A}else x=g;let v=x.pathname||"/",E=v;if(h!=="/"){let A=h.replace(/^\//,"").split("/");E="/"+v.replace(/^\//,"").split("/").slice(A.length).join("/")}let S=kO(t,{pathname:E});vc(p||S!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),vc(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=GL(S&&S.map(A=>Object.assign({},A,{params:Object.assign({},u,A.params),pathname:pd([h,s.encodeLocation?s.encodeLocation(A.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?h:pd([h,s.encodeLocation?s.encodeLocation(A.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),o,n);return e&&T?O.createElement(e_.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...x},navigationType:"POP"}},T):T}function IL(){let t=WL(),e=DL(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:l},"ErrorBoundary")," or"," ",O.createElement("code",{style:l},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},e),n?O.createElement("pre",{style:o},n):null,u)}var HL=O.createElement(IL,null),qO=class extends O.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=UL(t.digest);n&&(t=n)}let e=t!==void 0?O.createElement(_c.Provider,{value:this.props.routeContext},O.createElement(YR.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?O.createElement(qL,{error:t},e):e}};qO.contextType=TL;var iC=new WeakMap;function qL({children:t,error:e}){let{basename:n}=O.useContext(hl);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=VL(e.digest);if(s){let o=iC.get(e);if(o)throw o;let l=PO(s.location,n);if(UO&&!iC.get(e))if(l.isExternal||s.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:s.replace}));throw iC.set(e,u),u}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return t}function FL({routeContext:t,match:e,children:n}){let s=O.useContext(pv);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),O.createElement(_c.Provider,{value:t},n)}function GL(t,e=[],n){let s=n==null?void 0:n.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(e.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let o=t,l=s==null?void 0:s.errors;if(l!=null){let g=o.findIndex(x=>x.route.id&&(l==null?void 0:l[x.route.id])!==void 0);zr(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let u=!1,f=-1;if(n&&s){u=s.renderFallback;for(let g=0;g<o.length;g++){let x=o[g];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(f=g),x.route.id){let{loaderData:v,errors:E}=s,S=x.route.loader&&!v.hasOwnProperty(x.route.id)&&(!E||E[x.route.id]===void 0);if(x.route.lazy||S){n.isStatic&&(u=!0),f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}}let h=n==null?void 0:n.onError,p=s&&h?(g,x)=>{var v,E;h(g,{location:s.location,params:((E=(v=s.matches)==null?void 0:v[0])==null?void 0:E.params)??{},unstable_pattern:AL(s.matches),errorInfo:x})}:void 0;return o.reduceRight((g,x,v)=>{let E,S=!1,T=null,D=null;s&&(E=l&&x.route.id?l[x.route.id]:void 0,T=x.route.errorElement||HL,u&&(f<0&&v===0?(FO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,D=null):f===v&&(S=!0,D=x.route.hydrateFallbackElement||null)));let A=e.concat(o.slice(0,v+1)),M=()=>{let j;return E?j=T:S?j=D:x.route.Component?j=O.createElement(x.route.Component,null):x.route.element?j=x.route.element:j=g,O.createElement(FL,{match:x,routeContext:{outlet:g,matches:A,isDataRoute:s!=null},children:j})};return s&&(x.route.ErrorBoundary||x.route.errorElement||v===0)?O.createElement(qO,{location:s.location,revalidation:s.revalidation,component:T,error:E,children:M(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:p}):M()},null)}function $R(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YL(t){let e=O.useContext(pv);return zr(e,$R(t)),e}function $L(t){let e=O.useContext(nD);return zr(e,$R(t)),e}function XL(t){let e=O.useContext(_c);return zr(e,$R(t)),e}function XR(t){let e=XL(t),n=e.matches[e.matches.length-1];return zr(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function KL(){return XR("useRouteId")}function WL(){var s;let t=O.useContext(YR),e=$L("useRouteError"),n=XR("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function QL(){let{router:t}=YL("useNavigate"),e=XR("useNavigate"),n=O.useRef(!1);return IO(()=>{n.current=!0}),O.useCallback(async(o,l={})=>{vc(n.current,BO),n.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:e,...l}))},[t,e])}var oV={};function FO(t,e,n){!e&&!oV[t]&&(oV[t]=!0,vc(!1,n))}O.memo(ZL);function ZL({routes:t,future:e,state:n,isStatic:s,onError:o}){return HO(t,void 0,{state:n,isStatic:s,onError:o})}function JL({to:t,replace:e,state:n,relative:s}){zr(gv(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=O.useContext(hl);vc(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=O.useContext(_c),{pathname:u}=wc(),f=rD(),h=tD(t,GR(l),u,s==="path"),p=JSON.stringify(h);return O.useEffect(()=>{f(JSON.parse(p),{replace:e,state:n,relative:s})},[f,p,s,e,n]),null}function aV(t){return LL(t.context)}function ri(t){zr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function eB({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:o,static:l=!1,unstable_useTransitions:u}){zr(!gv(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),h=O.useMemo(()=>({basename:f,navigator:o,static:l,unstable_useTransitions:u,future:{}}),[f,o,l,u]);typeof n=="string"&&(n=mv(n));let{pathname:p="/",search:g="",hash:x="",state:v=null,key:E="default",unstable_mask:S}=n,T=O.useMemo(()=>{let D=Wf(p,f);return D==null?null:{location:{pathname:D,search:g,hash:x,state:v,key:E,unstable_mask:S},navigationType:s}},[f,p,g,x,v,E,s,S]);return vc(T!=null,`<Router basename="${f}"> is not able to match the URL "${p}${g}${x}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:O.createElement(hl.Provider,{value:h},O.createElement(e_.Provider,{children:e,value:T}))}function tB({children:t,location:e}){return BL(zT(t),e)}function zT(t,e=[]){let n=[];return O.Children.forEach(t,(s,o)=>{if(!O.isValidElement(s))return;let l=[...e,o];if(s.type===O.Fragment){n.push.apply(n,zT(s.props.children,l));return}zr(s.type===ri,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),zr(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=zT(s.props.children,l)),n.push(u)}),n}var xS="get",yS="application/x-www-form-urlencoded";function sD(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function nB(t){return sD(t)&&t.tagName.toLowerCase()==="button"}function rB(t){return sD(t)&&t.tagName.toLowerCase()==="form"}function sB(t){return sD(t)&&t.tagName.toLowerCase()==="input"}function iB(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function oB(t,e){return t.button===0&&(!e||e==="_self")&&!iB(t)}var TN=null;function aB(){if(TN===null)try{new FormData(document.createElement("form"),0),TN=!1}catch{TN=!0}return TN}var lB=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function oC(t){return t!=null&&!lB.has(t)?(vc(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yS}"`),null):t}function uB(t,e){let n,s,o,l,u;if(rB(t)){let f=t.getAttribute("action");s=f?Wf(f,e):null,n=t.getAttribute("method")||xS,o=oC(t.getAttribute("enctype"))||yS,l=new FormData(t)}else if(nB(t)||sB(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=t.getAttribute("formaction")||f.getAttribute("action");if(s=h?Wf(h,e):null,n=t.getAttribute("formmethod")||f.getAttribute("method")||xS,o=oC(t.getAttribute("formenctype"))||oC(f.getAttribute("enctype"))||yS,l=new FormData(f,t),!aB()){let{name:p,type:g,value:x}=t;if(g==="image"){let v=p?`${p}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else p&&l.append(p,x)}}else{if(sD(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=xS,s=null,o=yS,u=t}return l&&o==="text/plain"&&(u=l,l=void 0),{action:s,method:n.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function KR(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function cB(t,e,n,s){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:e&&Wf(o.pathname,e)==="/"?o.pathname=`${e.replace(/\/$/,"")}/_root.${s}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${s}`,o}async function dB(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fB(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function hB(t,e,n){let s=await Promise.all(t.map(async o=>{let l=e.routes[o.route.id];if(l){let u=await dB(l,n);return u.links?u.links():[]}return[]}));return bB(s.flat(1).filter(fB).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function lV(t,e,n,s,o,l){let u=(h,p)=>n[p]?h.route.id!==n[p].route.id:!0,f=(h,p)=>{var g;return n[p].pathname!==h.pathname||((g=n[p].route.path)==null?void 0:g.endsWith("*"))&&n[p].params["*"]!==h.params["*"]};return l==="assets"?e.filter((h,p)=>u(h,p)||f(h,p)):l==="data"?e.filter((h,p)=>{var x;let g=s.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(u(h,p)||f(h,p))return!0;if(h.route.shouldRevalidate){let v=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((x=n[0])==null?void 0:x.params)||{},nextUrl:new URL(t,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function mB(t,e,{includeHydrateFallback:n}={}){return pB(t.map(s=>{let o=e.routes[s.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function pB(t){return[...new Set(t)]}function gB(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function bB(t,e){let n=new Set;return new Set(e),t.reduce((s,o)=>{let l=JSON.stringify(gB(o));return n.has(l)||(n.add(l),s.push({key:l,link:o})),s},[])}function GO(){let t=O.useContext(pv);return KR(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function xB(){let t=O.useContext(nD);return KR(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var WR=O.createContext(void 0);WR.displayName="FrameworkContext";function YO(){let t=O.useContext(WR);return KR(t,"You must render this element inside a <HydratedRouter> element"),t}function yB(t,e){let n=O.useContext(WR),[s,o]=O.useState(!1),[l,u]=O.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:p,onMouseLeave:g,onTouchStart:x}=e,v=O.useRef(null);O.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let T=A=>{A.forEach(M=>{u(M.isIntersecting)})},D=new IntersectionObserver(T,{threshold:.5});return v.current&&D.observe(v.current),()=>{D.disconnect()}}},[t]),O.useEffect(()=>{if(s){let T=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(T)}}},[s]);let E=()=>{o(!0)},S=()=>{o(!1),u(!1)};return n?t!=="intent"?[l,v,{}]:[l,v,{onFocus:ZE(f,E),onBlur:ZE(h,S),onMouseEnter:ZE(p,E),onMouseLeave:ZE(g,S),onTouchStart:ZE(x,E)}]:[!1,v,{}]}function ZE(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function vB({page:t,...e}){let{router:n}=GO(),s=O.useMemo(()=>kO(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?O.createElement(_B,{page:t,matches:s,...e}):null}function EB(t){let{manifest:e,routeModules:n}=YO(),[s,o]=O.useState([]);return O.useEffect(()=>{let l=!1;return hB(t,e,n).then(u=>{l||o(u)}),()=>{l=!0}},[t,e,n]),s}function _B({page:t,matches:e,...n}){let s=wc(),{future:o,manifest:l,routeModules:u}=YO(),{basename:f}=GO(),{loaderData:h,matches:p}=xB(),g=O.useMemo(()=>lV(t,e,p,l,s,"data"),[t,e,p,l,s]),x=O.useMemo(()=>lV(t,e,p,l,s,"assets"),[t,e,p,l,s]),v=O.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let T=new Set,D=!1;if(e.forEach(M=>{var U;let j=l.routes[M.route.id];!j||!j.hasLoader||(!g.some(P=>P.route.id===M.route.id)&&M.route.id in h&&((U=u[M.route.id])!=null&&U.shouldRevalidate)||j.hasClientLoader?D=!0:T.add(M.route.id))}),T.size===0)return[];let A=cB(t,f,o.unstable_trailingSlashAwareDataRequests,"data");return D&&T.size>0&&A.searchParams.set("_routes",e.filter(M=>T.has(M.route.id)).map(M=>M.route.id).join(",")),[A.pathname+A.search]},[f,o.unstable_trailingSlashAwareDataRequests,h,s,l,g,e,t,u]),E=O.useMemo(()=>mB(x,l),[x,l]),S=EB(x);return O.createElement(O.Fragment,null,v.map(T=>O.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),E.map(T=>O.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),S.map(({key:T,link:D})=>O.createElement("link",{key:T,nonce:n.nonce,...D,crossOrigin:D.crossOrigin??n.crossOrigin})))}function wB(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var NB=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{NB&&(window.__reactRouterVersion="7.13.1")}catch{}function SB({basename:t,children:e,unstable_useTransitions:n,window:s}){let o=O.useRef();o.current==null&&(o.current=nL({window:s,v5Compat:!0}));let l=o.current,[u,f]=O.useState({action:l.action,location:l.location}),h=O.useCallback(p=>{n===!1?f(p):O.startTransition(()=>f(p))},[n]);return O.useLayoutEffect(()=>l.listen(h),[l,h]),O.createElement(eB,{basename:t,children:e,location:u.location,navigationType:u.action,navigator:l,unstable_useTransitions:n})}var $O=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XO=O.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:o,reloadDocument:l,replace:u,unstable_mask:f,state:h,target:p,to:g,preventScrollReset:x,viewTransition:v,unstable_defaultShouldRevalidate:E,...S},T){let{basename:D,navigator:A,unstable_useTransitions:M}=O.useContext(hl),j=typeof g=="string"&&$O.test(g),U=PO(g,D);g=U.to;let P=PL(g,{relative:o}),z=wc(),K=null;if(f){let Q=tD(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);D!=="/"&&(Q.pathname=Q.pathname==="/"?D:pd([D,Q.pathname])),K=A.createHref(Q)}let[te,H,I]=yB(s,S),F=CB(g,{replace:u,unstable_mask:f,state:h,target:p,preventScrollReset:x,relative:o,viewTransition:v,unstable_defaultShouldRevalidate:E,unstable_useTransitions:M});function $(Q){e&&e(Q),Q.defaultPrevented||F(Q)}let J=!(U.isExternal||l),X=O.createElement("a",{...S,...I,href:(J?K:void 0)||U.absoluteURL||P,onClick:J?$:e,ref:wB(T,H),target:p,"data-discover":!j&&n==="render"?"true":void 0});return te&&!j?O.createElement(O.Fragment,null,X,O.createElement(vB,{page:P})):X});XO.displayName="Link";var KO=O.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:o=!1,style:l,to:u,viewTransition:f,children:h,...p},g){let x=t_(u,{relative:p.relative}),v=wc(),E=O.useContext(nD),{navigator:S,basename:T}=O.useContext(hl),D=E!=null&&MB(x)&&f===!0,A=S.encodeLocation?S.encodeLocation(x).pathname:x.pathname,M=v.pathname,j=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(M=M.toLowerCase(),j=j?j.toLowerCase():null,A=A.toLowerCase()),j&&T&&(j=Wf(j,T)||j);const U=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let P=M===A||!o&&M.startsWith(A)&&M.charAt(U)==="/",z=j!=null&&(j===A||!o&&j.startsWith(A)&&j.charAt(A.length)==="/"),K={isActive:P,isPending:z,isTransitioning:D},te=P?e:void 0,H;typeof s=="function"?H=s(K):H=[s,P?"active":null,z?"pending":null,D?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(K):l;return O.createElement(XO,{...p,"aria-current":te,className:H,ref:g,style:I,to:u,viewTransition:f},typeof h=="function"?h(K):h)});KO.displayName="NavLink";var DB=O.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:o,state:l,method:u=xS,action:f,onSubmit:h,relative:p,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v,...E},S)=>{let{unstable_useTransitions:T}=O.useContext(hl),D=jB(),A=kB(f,{relative:p}),M=u.toLowerCase()==="get"?"get":"post",j=typeof f=="string"&&$O.test(f),U=P=>{if(h&&h(P),P.defaultPrevented)return;P.preventDefault();let z=P.nativeEvent.submitter,K=(z==null?void 0:z.getAttribute("formmethod"))||u,te=()=>D(z||P.currentTarget,{fetcherKey:e,method:K,navigate:n,replace:o,state:l,relative:p,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v});T&&n!==!1?O.startTransition(()=>te()):te()};return O.createElement("form",{ref:S,method:M,action:A,onSubmit:s?h:U,...E,"data-discover":!j&&t==="render"?"true":void 0})});DB.displayName="Form";function AB(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WO(t){let e=O.useContext(pv);return zr(e,AB(t)),e}function CB(t,{target:e,replace:n,unstable_mask:s,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:p}={}){let g=rD(),x=wc(),v=t_(t,{relative:u});return O.useCallback(E=>{if(oB(E,e)){E.preventDefault();let S=n!==void 0?n:U1(x)===U1(v),T=()=>g(t,{replace:S,unstable_mask:s,state:o,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});p?O.startTransition(()=>T()):T()}},[x,g,v,n,s,o,e,t,l,u,f,h,p])}var TB=0,RB=()=>`__${String(++TB)}__`;function jB(){let{router:t}=WO("useSubmit"),{basename:e}=O.useContext(hl),n=KL(),s=t.fetch,o=t.navigate;return O.useCallback(async(l,u={})=>{let{action:f,method:h,encType:p,formData:g,body:x}=uB(l,e);if(u.navigate===!1){let v=u.fetcherKey||RB();await s(v,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:x,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await o(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:g,body:x,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,e,n])}function kB(t,{relative:e}={}){let{basename:n}=O.useContext(hl),s=O.useContext(_c);zr(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),l={...t_(t||".",{relative:e})},u=wc();if(t==null){l.search=u.search;let f=new URLSearchParams(l.search),h=f.getAll("index");if(h.some(g=>g==="")){f.delete("index"),h.filter(x=>x).forEach(x=>f.append("index",x));let g=f.toString();l.search=g?`?${g}`:""}}return(!t||t===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:pd([n,l.pathname])),U1(l)}function MB(t,{relative:e}={}){let n=O.useContext(zO);zr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=WO("useViewTransitionState"),o=t_(t,{relative:e});if(!n.isTransitioning)return!1;let l=Wf(n.currentLocation.pathname,s)||n.currentLocation.pathname,u=Wf(n.nextLocation.pathname,s)||n.nextLocation.pathname;return TS(o.pathname,u)!=null||TS(o.pathname,l)!=null}jO();const uV=t=>{let e;const n=new Set,s=(p,g)=>{const x=typeof p=="function"?p(e):p;if(!Object.is(x,e)){const v=e;e=g??(typeof x!="object"||x===null)?x:Object.assign({},e,x),n.forEach(E=>E(e,v))}},o=()=>e,f={setState:s,getState:o,getInitialState:()=>h,subscribe:p=>(n.add(p),()=>n.delete(p))},h=e=t(s,o,f);return f},VB=(t=>t?uV(t):uV),UB=t=>t;function PB(t,e=UB){const n=b1.useSyncExternalStore(t.subscribe,b1.useCallback(()=>e(t.getState()),[t,e]),b1.useCallback(()=>e(t.getInitialState()),[t,e]));return b1.useDebugValue(n),n}const cV=t=>{const e=VB(t),n=s=>PB(e,s);return Object.assign(n,e),n},Nc=(t=>t?cV(t):cV),au=Nc(t=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(e,n)=>{t({loading:!0,error:null});try{const s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n}),credentials:"include"}),o=await s.json();if(!s.ok){t({loading:!1,error:o.error||"Login failed"});return}t({user:o.user,isAuthenticated:!0,loading:!1,error:null})}catch{t({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}t({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{t({loading:!0});try{const e=await fetch("/api/auth/me",{credentials:"include"});if(e.ok){const n=await e.json();t({user:n.user,isAuthenticated:!0,loading:!1})}else t({user:null,isAuthenticated:!1,loading:!1})}catch{t({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>t({user:null,isAuthenticated:!1,loading:!1,error:null})})),Ps=Nc((t,e)=>({squads:[],selectedSquad:null,activeStates:{},uiComponents:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const s=await n.json();t({squads:s.squads})}}catch{}},selectSquad:n=>t({selectedSquad:n}),setSquadState:(n,s)=>t(o=>({activeStates:{...o.activeStates,[n]:s}})),clearSquadState:n=>t(s=>{const{[n]:o,...l}=s.activeStates;return{activeStates:l}}),setUiComponents:(n,s)=>t(o=>({uiComponents:{...o.uiComponents,[n]:s}})),reset:()=>t({squads:[],selectedSquad:null,activeStates:{},uiComponents:{}})}));let OB=0;function dV(){return`local-${Date.now()}-${++OB}`}const Ei=Nc((t,e)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const s={id:dV(),role:"user",content:n,createdAt:new Date().toISOString()};t(o=>{const l=o.conversationId,u=l&&!o.messages.some(f=>f.role==="user")?o.conversations.map(f=>f.id===l?{...f,preview:n.slice(0,80)}:f):o.conversations;return{messages:[...o.messages,s],error:null,conversations:u}})},setConversationId:n=>{t({conversationId:n})},startStreaming:()=>{t({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{t(s=>({streamingText:s.streamingText+n,activity:null}))},setActivity:n=>{t({activity:n})},finishStreaming:n=>{const{streamingText:s}=e(),o={id:n,role:"assistant",content:s,createdAt:new Date().toISOString()};t(l=>({messages:[...l.messages,o],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const s={id:dV(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};t(o=>({messages:[...o.messages,s]}))},setError:n=>{t({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const s=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!s.ok)return;const l=((await s.json()).data||[]).map(u=>({id:u.id,createdAt:u.created_at,preview:""}));for(const u of l)try{const f=await fetch(`/api/conversations/${u.id}/messages?limit=1`,{credentials:"include"});if(f.ok){const p=((await f.json()).data||[])[0];p&&(u.preview=p.content.slice(0,80))}}catch{}t({conversations:l})}catch{}},selectConversation:async n=>{t({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const s=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!s.ok)return;const l=((await s.json()).data||[]).map(u=>({id:u.id,role:u.role,content:u.content,agentId:u.agent_id??void 0,agentName:u.agent_name??void 0,createdAt:u.created_at}));t({messages:l})}catch{}},deleteConversation:async(n,s)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:l}=e();t(u=>({conversations:u.conversations.filter(f=>f.id!==n)})),l===n&&t({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const s=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!s.ok)return;const o=await s.json();if(!o.data||o.data.length===0){t({conversationId:null,messages:[],conversations:[]});return}const l=(o.data||[]).map(x=>({id:x.id,createdAt:x.created_at,preview:""})),u=o.data[0];t({conversationId:u.id,conversations:l});const f=await fetch(`/api/conversations/${u.id}/messages`,{credentials:"include"});if(!f.ok)return;const p=((await f.json()).data||[]).map(x=>({id:x.id,role:x.role,content:x.content,agentId:x.agent_id??void 0,agentName:x.agent_name??void 0,createdAt:x.created_at})),g=p.find(x=>x.role==="user");if(g){const x=l.findIndex(v=>v.id===u.id);x>=0&&(l[x].preview=g.content.slice(0,80))}t({messages:p,conversations:l});for(const x of l)if(x.id!==u.id)try{const v=await fetch(`/api/conversations/${x.id}/messages?limit=1`,{credentials:"include"});if(v.ok){const S=((await v.json()).data||[])[0];S&&(x.preview=S.content.slice(0,80))}}catch{}t({conversations:[...l]})}catch{}},reset:()=>t({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function zB(t){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,s=new WebSocket(n),o=[];let l=!0;function u(f){s.readyState===WebSocket.OPEN?s.send(JSON.stringify(f)):s.readyState===WebSocket.CONNECTING&&o.push(f)}return s.onopen=()=>{var f,h;l||(h=(f=t.current).onReconnect)==null||h.call(f),l=!1;for(const p of o)s.send(JSON.stringify(p));o.length=0},s.onmessage=f=>{var h,p,g,x,v,E,S,T,D,A,M,j,U,P,z,K,te,H,I;try{const F=JSON.parse(f.data),$=t.current;switch(F.type){case"squad:state":(h=$.onSquadState)==null||h.call($,F.squadName,F.state);break;case"squad:inactive":(p=$.onSquadInactive)==null||p.call($,F.squadName,F.reason);break;case"chat:chunk":(g=$.onChatChunk)==null||g.call($,F.squadName,F.conversationId,F.delta);break;case"chat:activity":(x=$.onChatActivity)==null||x.call($,F.squadName,F.tool,F.summary);break;case"chat:done":(v=$.onChatDone)==null||v.call($,F.squadName,F.conversationId,F.messageId);break;case"chat:error":(E=$.onChatError)==null||E.call($,F.squadName,F.error);break;case"chat:agent_dm":(S=$.onChatAgentDm)==null||S.call($,F.squadName,F.conversationId,F.agentId,F.agentName,F.message);break;case"chat:conversation_created":(T=$.onChatConversationCreated)==null||T.call($,F.squadName,F.conversationId);break;case"agent:output_chunk":(D=$.onAgentOutputChunk)==null||D.call($,F.squadName,F.agentId,F.agentName,F.delta);break;case"agent:step_start":(A=$.onAgentStepStart)==null||A.call($,F.squadName,F.agentId,F.agentName,F.stepIndex,F.stepLabel);break;case"agent:step_complete":(M=$.onAgentStepComplete)==null||M.call($,F.squadName,F.agentId,F.agentName,F.stepIndex,F.stepLabel);break;case"squad:checkpoint":(j=$.onSquadCheckpoint)==null||j.call($,F.squadName,F.agentId,F.agentName,F.question);break;case"schedule:started":(U=$.onScheduleStarted)==null||U.call($,F.squadName,F.jobId,F.attempt);break;case"schedule:chunk":(P=$.onScheduleChunk)==null||P.call($,F.squadName,F.jobId,F.delta);break;case"schedule:done":(z=$.onScheduleDone)==null||z.call($,F.squadName,F.jobId,F.summary,F.attempt);break;case"schedule:error":(K=$.onScheduleError)==null||K.call($,F.squadName,F.jobId,F.error,F.attempt,F.willRetry);break;case"schedule:status_changed":(te=$.onScheduleStatusChanged)==null||te.call($,F.squadName,F.status);break;case"kanban:task_updated":(H=$.onKanbanTaskUpdated)==null||H.call($,F);break;case"a2ui:update":(I=$.onA2uiUpdate)==null||I.call($,F.squadName,F.components);break}}catch{}},{subscribe:f=>{u({type:"squad:subscribe",squadName:f})},unsubscribe:f=>{u({type:"squad:unsubscribe",squadName:f})},sendChat:(f,h,p)=>{const g={type:"chat:send",squadName:f,message:h};p&&p.length>0&&(g.files=p),u(g)},newConversation:f=>{u({type:"chat:new_conversation",squadName:f})},sendCheckpointResponse:(f,h)=>{u({type:"squad:checkpoint_response",squadName:f,answer:h})},disconnect:()=>{s.close()}}}function LB(t={}){const e=O.useRef(null),n=O.useRef(t),s=O.useRef(new Set);n.current=t,O.useEffect(()=>{const p=zB(n);e.current=p;for(const g of s.current)p.subscribe(g);return()=>{p.disconnect()}},[]);const o=O.useCallback(p=>{var g;s.current.add(p),(g=e.current)==null||g.subscribe(p)},[]),l=O.useCallback(p=>{var g;s.current.delete(p),(g=e.current)==null||g.unsubscribe(p)},[]),u=O.useCallback((p,g,x)=>{var v;(v=e.current)==null||v.sendChat(p,g,x)},[]),f=O.useCallback(p=>{var g;(g=e.current)==null||g.newConversation(p)},[]),h=O.useCallback((p,g)=>{var x;(x=e.current)==null||x.sendCheckpointResponse(p,g)},[]);return{subscribe:o,unsubscribe:l,sendChat:u,newConversation:f,sendCheckpointResponse:h}}function BB(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60,o=l=>l.toString().padStart(2,"0");return e>0?`${e}h ${o(n)}m ${o(s)}s`:`${n}m ${o(s)}s`}function IB(t){if(!t)return"—";const e=Math.floor((Date.now()-new Date(t).getTime())/1e3),n=Math.floor(e/60),s=e%60;return n>0?`${n}m ${s}s`:`${s}s`}const fV={idle:{icon:"○",color:"var(--text-muted)"},working:{icon:"◉",color:"#f59e0b"},delivering:{icon:"◈",color:"#3b82f6"},done:{icon:"✓",color:"#4ade80"},checkpoint:{icon:"?",color:"#a855f7"},running:{icon:"◉",color:"#f59e0b"},completed:{icon:"✓",color:"#4ade80"},failed:{icon:"✕",color:"#ef4444"}};function HB({squadCode:t}){var h;const e=Ps(p=>p.activeStates[t]),[n,s]=O.useState("—");if(O.useEffect(()=>{if(!(e!=null&&e.startedAt)||e.status==="idle"||e.status==="completed")return;const p=()=>s(IB(e.startedAt));p();const g=setInterval(p,1e3);return()=>clearInterval(g)},[e==null?void 0:e.startedAt,e==null?void 0:e.status]),!e||e.status==="idle")return null;const o=(h=e.agents)==null?void 0:h.find(p=>p.status==="working"||p.status==="delivering"||p.status==="checkpoint"),l=fV[e.status]??fV.idle,u=e.step??{current:0,total:0,label:""},f=u.total>0?Math.round(u.current/u.total*100):0;return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"6px 14px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:6,fontFamily:"var(--font-mono)",fontSize:"0.72rem"},children:[y.jsxDEV("span",{style:{color:l.color,fontSize:"0.9rem",animation:e.status==="running"||o?"pulse 1.5s infinite":"none"},children:l.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:56,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("span",{style:{color:"var(--text-primary)",fontWeight:600},children:["Step ",u.current,"/",u.total]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:64,columnNumber:11},this),u.label&&y.jsxDEV("span",{style:{color:"var(--text-muted)",maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:68,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:63,columnNumber:9},this),y.jsxDEV("div",{style:{width:120,height:3,background:"var(--surface-3)",borderRadius:2},children:y.jsxDEV("div",{style:{width:`${f}%`,height:"100%",borderRadius:2,background:l.color,transition:"width 0.3s ease"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:78,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:75,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:62,columnNumber:7},this),o&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:89,columnNumber:11},this),y.jsxDEV("span",{style:{color:"var(--accent)"},children:o.name??o.id},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:90,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:88,columnNumber:9},this),y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:95,columnNumber:7},this),y.jsxDEV("span",{style:{color:"var(--text-muted)"},children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:96,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/PipelineTracker.tsx",lineNumber:50,columnNumber:5},this)}function qB({state:t}){const e=Ps(o=>o.selectedSquad),[n,s]=O.useState(0);return O.useEffect(()=>{if(!(t!=null&&t.startedAt)||t.status!=="running"){s(0);return}const o=new Date(t.startedAt).getTime(),l=()=>s(Math.floor((Date.now()-o)/1e3));l();const u=setInterval(l,1e3);return()=>clearInterval(u)},[t==null?void 0:t.startedAt,t==null?void 0:t.status]),y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:[e&&y.jsxDEV(HB,{squadCode:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:36,columnNumber:25},this),t?y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.status==="running"?"var(--status-active)":t.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:t.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:t.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:42,columnNumber:13},this),y.jsxDEV("span",{style:{color:"var(--text-secondary)"},children:["Step ",t.step.current,"/",t.step.total]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:57,columnNumber:13},this),y.jsxDEV("span",{style:{color:"var(--border-strong)"},children:"│"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:60,columnNumber:13},this),y.jsxDEV("span",{children:t.step.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:61,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:41,columnNumber:11},this),y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[t.handoff&&y.jsxDEV("span",{style:{color:"var(--accent)"},children:[t.handoff.from," → ",t.handoff.to]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:67,columnNumber:15},this),t.status==="running"&&y.jsxDEV("span",{style:{color:"var(--text-secondary)"},children:BB(n)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:72,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:65,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:39,columnNumber:9},this):y.jsxDEV(y.Fragment,{children:[y.jsxDEV("span",{children:"Ready"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:80,columnNumber:11},this),y.jsxDEV("span",{children:"ExpxAgents Mission Control"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:81,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:79,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/StatusBar.tsx",lineNumber:24,columnNumber:5},this)}let LT=null;function FB(t){LT=t}function QO(t,e,n){LT&&LT(t,e,n)}let BT=null;function GB(t){BT=t}function YB(t){BT&&BT(t)}let IT=null;function $B(t){IT=t}function XB(t,e){IT&&IT(t,e)}const vS=32,dc=96,Cm=64,qt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},HT=[5227511,5025616,16750592,15022389,9315498,16771899],KB={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},oo={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},tl={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},$g={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},Rm={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},Uo={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},ua={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},Jy={wall:7901340,wallHighlight:10795204,doorFrame:6111287},vi={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},ca={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},qf=480,rl=360,Vg=400,ti=60,nl=120,aC=120,hV=160,mV=120,pV=160,WB=64,QB=80,ZB=dc+32,JB=Cm+48,gV=2,ZO=10,Lf=80;function RN(t,e,n){const s=Math.max(0,Math.min(1,n));return t+(e-t)*s}function e7(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}const t7=["nw","ne","sw","se"],n7={nw:"right",ne:"left",sw:"top",se:"top"};function RS(t){const e=ZO,n=Math.max(1,t),s={nw:0,ne:0,sw:0,se:0},o=[];for(let oe=0;oe<n;oe++){const G=t7[oe%4];o.push({quadrant:G,slot:s[G]}),s[G]++}const l=Math.max(1,s.nw),u=Math.max(1,s.ne),f=Math.max(1,s.sw),h=Math.max(1,s.se),p=Math.max(Vg,nl),g=l*(rl+e),x=u*(rl+e),v=Math.max(g+p,x+nl),E=f*(rl+e),S=h*(rl+e),T=Math.max(hV,pV),D=Math.max(E+T+e,S+T+e),A=Math.max(qf,nl+e+Vg),M=Math.max(qf,nl),j=Math.max(qf,aC),U=Math.max(qf,mV),P=Math.max(A,j),z=Math.max(M,U),K=e+P+e+ti+e+z+e,te=e+v+e+ti+e+D+e,H={x:e+P+e,y:e,width:ti,height:te-2*e},I={x:e,y:e+v+e,width:K-2*e,height:ti},F={x:H.x+H.width/2,y:I.y+I.height/2},$={x:H.x-e-Vg,y:I.y-e-Vg,width:Vg,height:Vg},J={x:$.x-e-nl,y:I.y-e-nl,width:nl,height:nl},X={x:H.x+ti+e,y:I.y-e-nl,width:nl,height:nl},Q={x:H.x-e-aC,y:I.y+ti+e+f*(rl+e),width:aC,height:hV},L={x:H.x+ti+e,y:I.y+ti+e+h*(rl+e),width:mV,height:pV},ee=[],ne={};for(let oe=0;oe<n;oe++){const{quadrant:G,slot:B}=o[oe],ae=n7[G];let Z;G==="nw"?Z={x:H.x-e-qf,y:$.y-e-(B+1)*rl-B*e}:G==="ne"?Z={x:H.x+ti+e,y:X.y-e-(B+1)*rl-B*e}:G==="sw"?Z={x:H.x-e-qf,y:I.y+ti+e+B*(rl+e)}:Z={x:H.x+ti+e,y:I.y+ti+e+B*(rl+e)},ee.push({origin:Z,width:qf,height:rl,quadrant:G,doorSide:ae}),ae==="right"||ae==="left"?ne[`squad-${oe}`]={x:H.x+ti/2,y:Z.y+rl/2}:ne[`squad-${oe}`]={x:Z.x+qf/2,y:I.y+ti/2}}return ne.ceo={x:H.x+ti/2,y:$.y+Vg/2},ne["bathroom-male"]={x:J.x+nl/2,y:I.y+ti/2},ne["bathroom-female"]={x:X.x+nl/2,y:I.y+ti/2},ne.kitchen={x:H.x+ti/2,y:Q.y+Q.height/2},ne["rest-area"]={x:H.x+ti/2,y:L.y+L.height/2},{totalWidth:K,totalHeight:te,squadOrigins:ee,ceoOffice:$,corridorH:I,corridorV:H,bathroomMale:J,bathroomFemale:X,kitchen:Q,restArea:L,doorPoints:ne,corridorHub:F}}function Ky(t,e,n,s){const o=t%gV,l=Math.floor(t/gV);return{x:e.x+WB+o*ZB,y:e.y+QB+l*JB}}function N1(t,e,n){return{x:t.x+e-80,y:t.y+n-80}}function JO(t,e,n){return{x:t.x+e-160,y:t.y+Math.floor(n/2)}}function r7(t,e){const n=e==="male"?t.bathroomMale:t.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function s7(t){return{x:t.kitchen.x+t.kitchen.width/2,y:t.kitchen.y+t.kitchen.height/2}}function i7(t){return{x:t.restArea.x+t.restArea.width/2,y:t.restArea.y+t.restArea.height/2}}function o7(t){const e=t.corridorV;if(e.height>0&&Math.random()<.5)return{x:e.x+10+Math.random()*Math.max(0,e.width-20),y:e.y+10+Math.random()*Math.max(0,e.height-20)};const n=t.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function bV(t,e){const n=e.corridorH;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function xV(t,e){const n=e.corridorV;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function a7(t,e){if(t==="ceo"){const s=e.ceoOffice;return{x:s.x+s.width/2,y:s.y+s.height/2}}if(t==="bathroom-male"){const s=e.bathroomMale;return{x:s.x+s.width/2,y:s.y+s.height/2}}if(t==="bathroom-female"){const s=e.bathroomFemale;return{x:s.x+s.width/2,y:s.y+s.height/2}}if(t==="kitchen"){const s=e.kitchen;return{x:s.x+s.width/2,y:s.y+s.height/2}}if(t==="rest-area"){const s=e.restArea;return{x:s.x+s.width/2,y:s.y+s.height/2}}const n=t.match(/^squad-(\d+)$/);if(n){const s=parseInt(n[1],10),o=e.squadOrigins[s];if(o)return{x:o.origin.x+o.width/2,y:o.origin.y+o.height/2}}return e.corridorHub}function S1(t,e,n,s){const o=s.doorPoints[e],l=s.doorPoints[n];if(!o||!l)return[t];const u=s.corridorHub,f=a7(n,s),h=bV(o,s)&&bV(l,s),p=xV(o,s)&&xV(l,s);return h||p?[t,o,l,f]:[t,o,u,l,f]}function jN(t,e){const n=t.x-e.x,s=t.y-e.y;return Math.sqrt(n*n+s*s)}const yV=500,vV=50;let EV=0;function _V(t){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[t]??"idle"}const Wr=Nc(t=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(e,n,s)=>{const o=`${e}:${n}`;t(l=>{var h;let f=(((h=l.bubbles[o])==null?void 0:h.text)??"")+s;return f.length>yV&&(f=f.slice(f.length-yV)),{bubbles:{...l.bubbles,[o]:{text:f,updatedAt:Date.now()}}}})},clearBubble:(e,n)=>{const s=`${e}:${n}`;t(o=>{const{[s]:l,...u}=o.bubbles;return{bubbles:u}})},clearAllBubbles:()=>t({bubbles:{}}),addActivity:(e,n,s)=>{const l={id:++EV,agentName:n,action:s,timestamp:Date.now()};t(u=>{var g;const h=[...((g=u.activityLog[e])==null?void 0:g.entries)??[],l],p=h.length>vV?h.slice(h.length-vV):h;return{activityLog:{...u.activityLog,[e]:{entries:p}}}})},setCheckpoint:(e,n,s,o)=>t(l=>({checkpoints:{...l.checkpoints,[e]:{agentId:n,agentName:s,question:o}}})),clearCheckpoint:e=>t(n=>{const{[e]:s,...o}=n.checkpoints;return{checkpoints:o}}),setActiveRoom:e=>t({activeRoom:e}),syncRooms:e=>t(n=>{const s=e;let o;return s.length===0?o=null:n.activeRoom===null||!s.includes(n.activeRoom)?o=s[0]:o=n.activeRoom,{rooms:s,activeRoom:o}}),setAgents:(e,n)=>t(s=>{const o=s.agentVisuals[e]??[],l=new Map(o.map(E=>[E.id,E])),u={x:0,y:0},f=RS(s.rooms.length),h=s.rooms.indexOf(e),p=f.squadOrigins[h],g=(p==null?void 0:p.width)??480,x=(p==null?void 0:p.height)??360,v=n.map((E,S)=>{const T=l.get(E.id);if(T){const M=E.status?_V(E.status):T.status,j=M!==T.status;let U=T.targetPosition;return j&&(M==="working"||M==="checkpoint"?U=Ky(S,u):U=N1(u,g,x)),{...T,name:E.name,avatar:E.avatar,deskIndex:S,status:M,targetPosition:U}}const D=E.status?_V(E.status):"idle",A=D==="working"||D==="checkpoint"?Ky(S,u):N1(u,g,x);return{id:E.id,name:E.name,avatar:E.avatar,colorIndex:S%6,status:D,deskIndex:S,position:A,targetPosition:null}});return{agentVisuals:{...s.agentVisuals,[e]:v}}}),setAgentStatus:(e,n,s)=>t(o=>{const l=o.agentVisuals[e];if(!l)return o;const u={x:0,y:0},f=RS(o.rooms.length),h=o.rooms.indexOf(e),p=f.squadOrigins[h],g=(p==null?void 0:p.width)??480,x=(p==null?void 0:p.height)??360,v=l.map(E=>{if(E.id!==n)return E;let S;return s==="working"||s==="checkpoint"?S=Ky(E.deskIndex,u):S=N1(u,g,x),{...E,status:s,targetPosition:S}});return{agentVisuals:{...o.agentVisuals,[e]:v}}}),reset:()=>{EV=0,t({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),zle={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textAva:"#c084fc",particleStart:"#00c8ff"},l7={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let e5=0;function u7(){return`jarvis-${Date.now()}-${++e5}`}let ad=null;const lC=Nc((t,e)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>t({mode:n}),addMessage:(n,s)=>{const o={id:u7(),role:n,content:s,createdAt:new Date().toISOString()};t(l=>({messages:[...l.messages,o]}))},appendChunk:n=>{t(s=>({streamingText:s.streamingText+n}))},finalizeMessage:n=>{const{streamingText:s}=e(),o={id:n,role:"assistant",content:s,createdAt:new Date().toISOString()};t(l=>({messages:[...l.messages,o],streamingText:""}))},selectSquad:n=>t({selectedSquad:n}),setUserName:n=>t({userName:n}),startStandbyTimer:()=>{ad&&clearTimeout(ad),ad=setTimeout(()=>{t({mode:"STANDBY"}),ad=null},l7.standbyTimeoutMs)},resetStandbyTimer:()=>{e().startStandbyTimer()},clearStandbyTimer:()=>{ad&&(clearTimeout(ad),ad=null)},reset:()=>{ad&&(clearTimeout(ad),ad=null),e5=0,t({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),zo=Nc((t,e)=>({jobs:[],loading:!1,history:{},historyLoading:{},fetchJobs:async()=>{t({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const s=await n.json();t({jobs:s.data,loading:!1})}else t({loading:!1})}catch{t({loading:!1})}},createJob:async n=>(await fetch("/api/scheduler",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?(e().fetchJobs(),!0):!1,deleteJob:async n=>{await fetch(`/api/scheduler/${n}`,{method:"DELETE",credentials:"include"}),e().fetchJobs()},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),e().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),e().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,s)=>{t(o=>({jobs:o.jobs.map(l=>l.squad_name===n?{...l,status:s}:l)}))},fetchHistory:async n=>{t(s=>({historyLoading:{...s.historyLoading,[n]:!0}}));try{const s=await fetch(`/api/scheduler/${n}/history?limit=50`,{credentials:"include"});if(s.ok){const o=await s.json();t(l=>({history:{...l.history,[n]:o.data},historyLoading:{...l.historyLoading,[n]:!1}}))}else t(o=>({historyLoading:{...o.historyLoading,[n]:!1}}))}catch{t(s=>({historyLoading:{...s.historyLoading,[n]:!1}}))}}})),c7=600*1e3;function d7(){const[t,e]=O.useState(null),[n,s]=O.useState(!1),[o,l]=O.useState(!1),u=O.useCallback(async()=>{try{const h=await fetch("/api/system/version",{credentials:"include"});if(h.ok){const p=await h.json();e(p)}}catch{}},[]);O.useEffect(()=>{u();const h=setInterval(u,c7);return()=>clearInterval(h)},[u]);const f=async()=>{s(!0);try{await fetch("/api/system/update",{method:"POST",credentials:"include"})}catch{s(!1)}};return!(t!=null&&t.updateAvailable)||o?null:y.jsxDEV("div",{"data-testid":"update-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"8px var(--sp-4)",background:"var(--surface-2)",borderBottom:"1px solid var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)",animation:"fadeIn 0.3s var(--ease-out) both"},children:n?y.jsxDEV("span",{style:{color:"var(--accent)"},children:["Updating to v",t.latest,"... Server will restart automatically."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:67,columnNumber:9},this):y.jsxDEV(y.Fragment,{children:[y.jsxDEV("span",{children:["New version available: ",y.jsxDEV("strong",{style:{color:"var(--accent)"},children:["v",t.latest]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:73,columnNumber:36},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",marginLeft:6},children:["(current: v",t.current,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:74,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:72,columnNumber:11},this),y.jsxDEV("button",{"data-testid":"btn-update",onClick:f,style:{padding:"3px 12px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.68rem",fontWeight:600,cursor:"pointer",border:"none",background:"var(--accent)",color:"var(--text-inverse)",transition:"opacity 0.15s ease"},children:"Update"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:76,columnNumber:11},this),y.jsxDEV("button",{"data-testid":"btn-dismiss-update",onClick:()=>l(!0),style:{padding:"2px 6px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:94,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:71,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UpdateBanner.tsx",lineNumber:50,columnNumber:5},this)}function f7(){if(typeof window>"u")return"dark";const t=localStorage.getItem("expx-theme");return t==="light"||t==="dark"?t:"dark"}function wV(t){document.documentElement.setAttribute("data-theme",t),localStorage.setItem("expx-theme",t)}const jS=Nc((t,e)=>({theme:f7(),toggle:()=>{const n=e().theme==="dark"?"light":"dark";wV(n),t({theme:n})},setTheme:n=>{wV(n),t({theme:n})}}));function h7(){const[t,e]=O.useState(null),[n,s]=O.useState(!0),[o,l]=O.useState(null),u=O.useCallback(async()=>{s(!0),l(null);try{const f=await fetch("/api/system/info");if(f.ok){const h=await f.json();e(h)}else l("Server unavailable")}catch{l("Cannot reach server")}finally{s(!1)}},[]);return O.useEffect(()=>{u()},[u]),{info:t,loading:n,error:o,refetch:u}}const kN=Nc((t,e)=>({models:[],selectedModel:"",loading:!1,error:null,engine:"",fetchModels:async()=>{var n;t({loading:!0,error:null});try{const s=await fetch("/api/system/models");if(s.ok){const o=await s.json();t({models:o.models,selectedModel:o.default||((n=o.models[0])==null?void 0:n.id)||"",engine:o.engine,loading:!1})}else t({error:"Failed to fetch models",loading:!1})}catch{t({error:"Cannot reach server",loading:!1})}},setSelectedModel:n=>{t({selectedModel:n})}}));function m7(){const{info:t,refetch:e}=h7(),n=kN(F=>F.models),s=kN(F=>F.selectedModel),o=kN(F=>F.fetchModels),l=kN(F=>F.setSelectedModel),[u,f]=O.useState(!1),[h,p]=O.useState(!1),[g,x]=O.useState(""),[v,E]=O.useState(0),[S,T]=O.useState(!1),D=O.useRef(null),A=O.useRef(null),M=O.useRef(null);if(O.useEffect(()=>{(t==null?void 0:t.engine)==="opencode"&&n.length===0&&o()},[t==null?void 0:t.engine,n.length,o]),O.useEffect(()=>{function F($){D.current&&!D.current.contains($.target)&&f(!1),A.current&&!A.current.contains($.target)&&(p(!1),x(""))}return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]),O.useEffect(()=>{h&&M.current&&M.current.focus()},[h]),!t)return null;const j=t.engine,U=j==="opencode",P=U?"#f97316":"#4ade80",z=n.find(F=>F.id===s),K=async F=>{if(!(S||!window.confirm(`Switch from ${j==="opencode"?"OpenCode":"Claude Code"} to ${F==="opencode"?"OpenCode":F==="claude-code"?"Claude Code":"Auto"}?
288
288
 
289
- Active sessions will be aborted.`))){T(!0),f(!1);try{const J=await fetch("/api/system/engine",{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({engine:F})});if(J.ok)(await J.json()).ok&&(e(),alert(`Engine switched to ${F==="opencode"?"OpenCode":F==="claude-code"?"Claude Code":"Auto"}!`));else{const X=await J.json();alert(`Failed to switch engine: ${X.error}`)}}catch{alert("Failed to switch engine")}finally{T(!1)}}},te=[{id:"opencode",label:"OpenCode",icon:"⚡",desc:"Use OpenCode as AI backend"},{id:"claude-code",label:"Claude Code",icon:"🤖",desc:"Use Claude Code as AI backend"},{id:"auto",label:"Auto",icon:"🔄",desc:"Auto-detect available engine"}],H=n.filter(F=>{const $=g.toLowerCase();return F.name.toLowerCase().includes($)||F.id.toLowerCase().includes($)||F.provider.toLowerCase().includes($)}),I=F=>{F.key==="ArrowDown"?(F.preventDefault(),E($=>Math.min($+1,H.length-1))):F.key==="ArrowUp"?(F.preventDefault(),E($=>Math.max($-1,0))):F.key==="Enter"&&H[v]?(F.preventDefault(),l(H[v].id),p(!1),x("")):F.key==="Escape"&&(p(!1),x(""))};return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("div",{ref:D,style:{position:"relative"},children:[y.jsxDEV("button",{onClick:()=>{f(!u)},style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:P,background:`${P}18`,border:`1px solid ${P}44`,padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.04em",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[y.jsxDEV("span",{style:{width:5,height:5,borderRadius:"50%",background:P,boxShadow:`0 0 4px ${P}`}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:150,columnNumber:11},this),j==="opencode"?"OpenCode":j==="claude-code"?"Claude Code":"Auto",y.jsxDEV("span",{style:{fontSize:"0.5rem",opacity:.7,marginLeft:2},children:"⚙"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:160,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:130,columnNumber:9},this),u&&y.jsxDEV("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",zIndex:1001,minWidth:220,overflow:"hidden"},children:[y.jsxDEV("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--border-subtle)",fontSize:"0.6rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:"Switch Engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:179,columnNumber:13},this),te.map(F=>y.jsxDEV("button",{onClick:()=>K(F.id),disabled:S,style:{width:"100%",padding:"8px 12px",background:j===F.id?`${P}12`:"transparent",border:"none",textAlign:"left",cursor:S?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:j===F.id?P:"var(--text-secondary)",borderBottom:"1px solid var(--border-subtle)",opacity:S?.5:1},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[y.jsxDEV("span",{children:F.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:212,columnNumber:19},this),y.jsxDEV("span",{style:{fontWeight:600},children:F.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:213,columnNumber:19},this),j===F.id&&y.jsxDEV("span",{style:{fontSize:"0.5rem",background:P,color:"#000",padding:"1px 4px",borderRadius:3},children:"Active"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:215,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:211,columnNumber:17},this),y.jsxDEV("div",{style:{fontSize:"0.55rem",color:"var(--text-muted)",paddingLeft:20},children:F.desc},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:220,columnNumber:17},this)]},F.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:191,columnNumber:15},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:164,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:129,columnNumber:7},this),U&&n.length>0&&y.jsxDEV("div",{ref:A,style:{position:"relative"},children:[y.jsxDEV("button",{onClick:()=>{p(!h),x(""),E(0)},style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:P,background:`${P}18`,border:`1px solid ${P}44`,padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.04em",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[(z==null?void 0:z.name)||s||"Select Model",y.jsxDEV("span",{style:{fontSize:"0.5rem",opacity:.7,marginLeft:2},children:"▼"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:255,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:232,columnNumber:11},this),h&&y.jsxDEV("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",zIndex:1e3,minWidth:280,overflow:"hidden",display:"flex",flexDirection:"column"},children:[y.jsxDEV("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem"},children:"🔍"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:285,columnNumber:17},this),y.jsxDEV("input",{ref:M,type:"text",placeholder:"Search models...",value:g,onChange:F=>{x(F.target.value),E(0)},onKeyDown:I,style:{flex:1,background:"transparent",border:"none",outline:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-primary)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:286,columnNumber:17},this),g&&y.jsxDEV("button",{onClick:()=>x(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:"0.65rem",padding:0},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:307,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:276,columnNumber:15},this),y.jsxDEV("div",{style:{overflowY:"auto",maxHeight:240},children:H.length===0?y.jsxDEV("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)"},children:"No models found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:324,columnNumber:19},this):H.map((F,$)=>y.jsxDEV("button",{onClick:()=>{l(F.id),p(!1),x("")},onMouseEnter:()=>E($),style:{width:"100%",padding:"6px 12px",background:$===v?`${P}20`:s===F.id?`${P}12`:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:$===v||s===F.id?P:"var(--text-secondary)",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("div",{style:{fontWeight:600,marginBottom:2},children:F.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:368,columnNumber:23},this),y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.55rem",color:"var(--text-muted)"},children:[y.jsxDEV("span",{children:F.provider},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:377,columnNumber:25},this),y.jsxDEV("span",{style:{opacity:.6},children:["$",F.cost.input,"/$",F.cost.output]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:378,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:369,columnNumber:23},this)]},F.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:337,columnNumber:21},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:322,columnNumber:15},this),y.jsxDEV("div",{style:{padding:"4px 12px",borderTop:"1px solid var(--border-subtle)",fontSize:"0.55rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",display:"flex",justifyContent:"space-between"},children:[y.jsxDEV("span",{children:"↑↓ Navigate • Enter Select • Esc Close"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:397,columnNumber:17},this),y.jsxDEV("span",{children:[H.length," models"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:398,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:386,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:259,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:231,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:127,columnNumber:5},this)}function NV(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return e>0?`${e}h ${n}m`:`${n}m`}function p7(){const[t,e]=O.useState(null),[n,s]=O.useState(!1);if(O.useEffect(()=>{let u=!0;const f=()=>{fetch("/api/health").then(p=>p.json()).then(p=>{u&&(e(p),s(!1))}).catch(()=>{u&&s(!0)})};f();const h=setInterval(f,3e4);return()=>{u=!1,clearInterval(h)}},[]),n)return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"#ef4444",padding:"4px 10px",background:"#2a0a0a",border:"1px solid #ef444444",borderRadius:20},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"#ef4444"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:45,columnNumber:9},this),"Offline"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:38,columnNumber:7},this);if(!t)return null;const o=t.status==="ok",l=o?"#4ade80":"#f59e0b";return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",padding:"4px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:20,cursor:"default"},title:`DB: ${t.database} | Engine: ${t.engine??"none"} | RAM: ${t.memory.heapUsedMB}/${t.memory.heapTotalMB}MB | Uptime: ${NV(t.uptime)}`,children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:l,boxShadow:o?`0 0 6px ${l}`:"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:64,columnNumber:7},this),y.jsxDEV("span",{children:t.engine??"no engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:68,columnNumber:7},this),y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:69,columnNumber:7},this),y.jsxDEV("span",{children:NV(t.uptime)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:70,columnNumber:7},this),y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:71,columnNumber:7},this),y.jsxDEV("span",{children:[t.memory.heapUsedMB,"MB"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:72,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:57,columnNumber:5},this)}const g7={success:5e3,info:5e3,warning:8e3,error:null},qT=Nc((t,e)=>({notifications:[],notify:(n,s,o)=>{const l=crypto.randomUUID(),u={id:l,type:n,message:s,detail:o,createdAt:Date.now()};t(h=>({notifications:[...h.notifications.slice(-19),u]}));const f=g7[n];f&&setTimeout(()=>e().dismiss(l),f)},dismiss:n=>{t(s=>({notifications:s.notifications.filter(o=>o.id!==n)}))},clearAll:()=>t({notifications:[]})})),MN=(t,e,n)=>qT.getState().notify(t,e,n),b7={success:{bg:"#05230e",border:"#4ade80",icon:"✓"},error:{bg:"#2a0a0a",border:"#ef4444",icon:"✕"},warning:{bg:"#2a1f0a",border:"#f59e0b",icon:"!"},info:{bg:"#0a1a2a",border:"#3b82f6",icon:"i"}};function x7(){const t=qT(n=>n.notifications),e=qT(n=>n.dismiss);return t.length===0?null:y.jsxDEV("div",{style:{position:"fixed",bottom:16,right:16,zIndex:9999,display:"flex",flexDirection:"column-reverse",gap:8,maxHeight:"calc(100vh - 32px)",overflow:"hidden",pointerEvents:"none"},children:t.slice(-5).map(n=>{const s=b7[n.type];return y.jsxDEV("div",{style:{background:s.bg,border:`1px solid ${s.border}44`,borderLeft:`3px solid ${s.border}`,borderRadius:6,padding:"10px 14px",minWidth:280,maxWidth:400,fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-primary)",pointerEvents:"auto",animation:"fadeInUp 0.3s ease-out",display:"flex",gap:10,alignItems:"flex-start"},children:[y.jsxDEV("span",{style:{color:s.border,fontWeight:800,fontSize:"0.85rem",flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:`${s.border}22`,borderRadius:"50%"},children:s.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:35,columnNumber:13},this),y.jsxDEV("div",{style:{flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{fontWeight:600},children:n.message},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:42,columnNumber:15},this),n.detail&&y.jsxDEV("div",{style:{fontSize:"0.7rem",color:"var(--text-muted)",marginTop:4,wordBreak:"break-word"},children:n.detail},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:44,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:41,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>e(n.id),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.9rem",padding:0,flexShrink:0,lineHeight:1},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:49,columnNumber:13},this)]},n.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:26,columnNumber:11},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:17,columnNumber:5},this)}const al=Nc(t=>({entries:[],loading:!1,filter:{level:"all",squad:"",search:""},pinToBottom:!0,addEntry:e=>{const n={...e,id:crypto.randomUUID(),createdAt:new Date().toISOString()};t(s=>({entries:[...s.entries.slice(-499),n]}))},setFilter:e=>t(n=>({filter:{...n.filter,...e}})),setPinToBottom:e=>t({pinToBottom:e}),clear:()=>t({entries:[]}),fetchLogs:async e=>{t({loading:!0});try{const n=new URLSearchParams;e!=null&&e.level&&n.set("level",e.level),e!=null&&e.squad&&n.set("squad",e.squad),e!=null&&e.search&&n.set("search",e.search),n.set("limit","200");const s=await fetch(`/api/logs?${n}`,{credentials:"include"});if(s.ok){const l=(await s.json()).map(u=>({id:String(u.id),level:u.level,squadCode:u.squad_code??void 0,source:u.source,message:u.message,detail:u.detail??void 0,createdAt:u.created_at}));t({entries:l.reverse()})}}catch{}t({loading:!1})}})),y7=O.lazy(()=>$f(()=>import("./ThreeBackground-8UywK1HF.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ThreeBackground})));O.lazy(()=>$f(()=>Promise.resolve().then(()=>Nle),void 0).then(t=>({default:t.MarketplaceView})));const v7=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/marketplace",label:"Marketplace",icon:"🏪"},{to:"/dashboard",label:"Dashboard",icon:"▣"},{to:"/logs",label:"Logs",icon:"▥"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/knowledge",label:"Knowledge",icon:"◆"},{to:"/settings",label:"Settings",icon:"⚙"}];function E7(){const t=au(he=>he.user),e=au(he=>he.isAuthenticated),n=au(he=>he.loading),s=au(he=>he.logout),o=au(he=>he.checkAuth),l=rD(),u=wc();u.pathname==="/office"||u.pathname;const f=u.pathname==="/jarvis",h=jS(he=>he.theme),p=jS(he=>he.toggle),g=Ps(he=>he.squads),x=Ps(he=>he.selectedSquad),v=Ps(he=>x?he.activeStates[x]:null),E=Ps(he=>he.fetchSquads),S=Ps(he=>he.setSquadState),T=Ps(he=>he.clearSquadState),D=O.useCallback((he,Ne)=>{S(he,Ne);const De=Wr.getState();De.rooms.includes(he)||De.syncRooms([...De.rooms,he]),Ne.status!=="checkpoint"&&De.clearCheckpoint(he),Ne.agents&&De.setAgents(he,Ne.agents.map(me=>({id:me.id,name:me.name,status:me.status})))},[S]),A=O.useCallback(he=>{T(he);const Ne=Wr.getState(),De=Ne.agentVisuals[he];if(De)for(const me of De)Ne.setAgentStatus(he,me.id,"idle")},[T]),M=O.useCallback((he,Ne)=>{Ei.setState(De=>({conversationId:Ne,messages:[],conversations:[{id:Ne,createdAt:new Date().toISOString(),preview:""},...De.conversations.filter(me=>me.id!==Ne)]}))},[]),j=O.useCallback((he,Ne,De)=>{if(he==="_jarvis"){lC.getState().appendChunk(De);return}const me=Ei.getState();me.streaming||me.startStreaming(),me.appendChunk(De),window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"chat:chunk",squadName:he,delta:De}}))},[]),U=O.useCallback((he,Ne,De)=>{if(he==="_jarvis"){lC.getState().finalizeMessage(De);return}Ei.getState().finishStreaming(De)},[]),P=O.useCallback((he,Ne)=>{if(he==="_jarvis"){lC.getState().setMode("LISTENING");return}Ei.getState().setError(Ne),MN("error",`Erro em ${he}`,Ne),al.getState().addEntry({level:"error",squadCode:he,source:"chat",message:Ne})},[]),z=O.useCallback((he,Ne,De)=>{he!=="_jarvis"&&(Ei.getState().setActivity(`${Ne}${De?" "+De:""}`),al.getState().addEntry({level:"info",squadCode:he,source:"activity",message:`[${Ne}] ${De}`}),window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"chat:activity",squadName:he,tool:Ne,summary:De}})))},[]),K=O.useCallback((he,Ne,De,me,qe)=>{Ei.getState().addAgentDm({agentId:De,agentName:me,content:qe})},[]),te=O.useCallback((he,Ne,De,me)=>{Wr.getState().appendBubble(he,Ne,me)},[]),H=O.useCallback((he,Ne,De,me,qe)=>{Wr.getState().addActivity(he,De,`started "${qe}"`),Wr.getState().setAgentStatus(he,Ne,"working"),al.getState().addEntry({level:"info",squadCode:he,source:"agent",message:`${De} iniciou step ${me}: ${qe}`})},[]),I=O.useCallback((he,Ne,De,me,qe)=>{Wr.getState().addActivity(he,De,`completed "${qe}"`),Wr.getState().setAgentStatus(he,Ne,"idle")},[]),F=O.useCallback((he,Ne,De,me)=>{Wr.getState().setCheckpoint(he,Ne,De,me),Wr.getState().setAgentStatus(he,Ne,"checkpoint"),MN("warning",`Checkpoint: ${De}`,me.slice(0,120))},[]),$=O.useCallback(()=>{Wr.getState().clearAllBubbles()},[]),J=O.useCallback((he,Ne,De)=>{window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"schedule:chunk",squadName:he,jobId:Ne,delta:De}}))},[]),X=O.useCallback((he,Ne,De)=>{zo.getState().fetchJobs(),al.getState().addEntry({level:"info",squadCode:he,source:"scheduler",message:`Pipeline iniciado (tentativa ${De})`})},[]),Q=O.useCallback((he,Ne,De,me)=>{zo.getState().fetchJobs(),MN("success",`Pipeline concluído: ${he}`,De.slice(0,120)),al.getState().addEntry({level:"info",squadCode:he,source:"scheduler",message:"Pipeline concluído",detail:De.slice(0,200)})},[]),L=O.useCallback((he,Ne,De,me,qe)=>{zo.getState().fetchJobs(),MN("error",`Pipeline falhou: ${he}`,qe?`Tentativa ${me} — retry automático`:De),al.getState().addEntry({level:"error",squadCode:he,source:"scheduler",message:`Pipeline falhou: ${De}`,detail:qe?`Retry automático (tentativa ${me})`:void 0})},[]),ee=O.useCallback((he,Ne)=>{zo.getState().updateJobStatus(he,Ne)},[]),ne=O.useCallback(he=>{window.dispatchEvent(new CustomEvent("kanban:task_updated",{detail:he}))},[]),oe=O.useCallback((he,Ne)=>{Ps.getState().setUiComponents(he,Ne)},[]),{subscribe:G,unsubscribe:B,sendChat:ae,newConversation:Z,sendCheckpointResponse:be}=LB({onSquadState:D,onSquadInactive:A,onChatConversationCreated:M,onChatChunk:j,onChatActivity:z,onChatDone:U,onChatError:P,onChatAgentDm:K,onAgentOutputChunk:te,onAgentStepStart:H,onAgentStepComplete:I,onSquadCheckpoint:F,onReconnect:$,onScheduleChunk:J,onScheduleStarted:X,onScheduleDone:Q,onScheduleError:L,onScheduleStatusChanged:ee,onKanbanTaskUpdated:ne,onA2uiUpdate:oe});O.useEffect(()=>{FB(ae)},[ae]),O.useEffect(()=>{GB(Z)},[Z]),O.useEffect(()=>{$B(be)},[be]),O.useEffect(()=>{E().then(()=>{const{squads:he}=Ps.getState();if(he.length>0){const Ne=Wr.getState(),De=he.map(Te=>Te.code),me=Ne.rooms,qe=[...new Set([...me,...De])];Ne.syncRooms(qe);for(const Te of he)!Ne.agentVisuals[Te.code]&&Te.agents&&Te.agents.length>0&&Ne.setAgents(Te.code,Te.agents.map(Ke=>({id:Ke.id,name:Ke.name,avatar:Ke.avatar,status:"idle"})))}})},[E]);const Ve=Wr(he=>he.rooms);return O.useEffect(()=>{for(const he of Ve)G(he);return()=>{for(const he of Ve)B(he)}},[Ve,G,B]),O.useEffect(()=>(G("_expxagents"),()=>B("_expxagents")),[G,B]),O.useEffect(()=>{if(f)return G("_jarvis"),()=>B("_jarvis")},[f,G,B]),O.useEffect(()=>{e||o()},[]),O.useEffect(()=>{!n&&!e&&l("/login",{state:{from:u.pathname}})},[n,e,l,u.pathname]),f?y.jsxDEV(aV,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:286,columnNumber:12},this):y.jsxDEV("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[y.jsxDEV("header",{"data-layout":"header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:311,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:326,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:335,columnNumber:11},this),y.jsxDEV(m7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:346,columnNumber:11},this),y.jsxDEV(p7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:347,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:310,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[y.jsxDEV("button",{"data-testid":"btn-restart-server",onClick:async()=>{if(confirm("Restart the server? It will be briefly unavailable."))try{await fetch("/api/system/restart",{method:"POST",credentials:"include"})}catch{}},title:"Restart server",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-muted)",he.currentTarget.style.borderColor="var(--border-subtle)"},children:"↻ Restart"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:356,columnNumber:11},this),y.jsxDEV("button",{"data-testid":"btn-toggle-theme",onClick:p,title:`Switch to ${h==="dark"?"light":"dark"} mode`,style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.85rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4,lineHeight:1},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-muted)",he.currentTarget.style.borderColor="var(--border-subtle)"},children:h==="dark"?"☀":"☽"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:390,columnNumber:11},this),y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[y.jsxDEV("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:428,columnNumber:13},this),y.jsxDEV("span",{children:t==null?void 0:t.username},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:437,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:420,columnNumber:11},this),y.jsxDEV("button",{onClick:s,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:he=>he.currentTarget.style.color="var(--status-error)",onMouseLeave:he=>he.currentTarget.style.color="var(--text-muted)",children:"Logout"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:439,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:351,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:298,columnNumber:7},this),y.jsxDEV(d7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:461,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[y.jsxDEV("aside",{"data-layout":"sidebar",style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[y.jsxDEV("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:482,columnNumber:13},this),v7.map(he=>y.jsxDEV(KO,{to:he.to,style:({isActive:Ne})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:Ne?600:400,color:Ne?"var(--accent)":"var(--text-secondary)",background:Ne?"var(--accent-glow)":"transparent",border:Ne?"1px solid var(--accent-glow)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:he.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:513,columnNumber:17},this),he.label]},he.to,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:495,columnNumber:15},this)),y.jsxDEV("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:525,columnNumber:13},this),y.jsxDEV("a",{href:"/docs",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:400,color:"var(--text-secondary)",background:"transparent",border:"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.background="var(--accent-glow)",he.currentTarget.style.borderColor="var(--accent-glow)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-secondary)",he.currentTarget.style.background="transparent",he.currentTarget.style.borderColor="transparent"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"≡"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:559,columnNumber:15},this),"Docs",y.jsxDEV("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:567,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:530,columnNumber:13},this),y.jsxDEV("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid var(--status-active-glow)",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:593,columnNumber:15},this),"Ava",y.jsxDEV("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:601,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:574,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:475,columnNumber:11},this),y.jsxDEV("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[y.jsxDEV("span",{children:[g.length," squad",g.length!==1?"s":""]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:620,columnNumber:13},this),y.jsxDEV("span",{children:"v0.1.0"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:621,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:611,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:466,columnNumber:9},this),y.jsxDEV("main",{className:"grid-bg",style:{flex:1,overflow:"hidden",position:"relative"},children:[y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(y7,{opacity:.4},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:632,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:631,columnNumber:11},this),y.jsxDEV("div",{style:{position:"relative",zIndex:1,height:"100%",overflow:"auto"},children:y.jsxDEV(aV,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:635,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:634,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:626,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:464,columnNumber:7},this),y.jsxDEV("div",{"data-layout":"statusbar",children:y.jsxDEV(qB,{state:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:642,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:641,columnNumber:7},this),y.jsxDEV(x7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:644,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:290,columnNumber:5},this)}const _7=O.lazy(()=>$f(()=>import("./ThreeBackground-8UywK1HF.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ThreeBackground})));function w7(){var S;const[t,e]=O.useState(""),[n,s]=O.useState(""),o=au(T=>T.login),l=au(T=>T.loading),u=au(T=>T.error),f=au(T=>T.isAuthenticated),h=rD(),g=((S=wc().state)==null?void 0:S.from)||"/";O.useEffect(()=>{f&&h(g,{replace:!0})},[f,h,g]);const x=T=>{T.preventDefault(),o(t,n)},v=jS(T=>T.theme),E=jS(T=>T.toggle);return y.jsxDEV("div",{className:"noise-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)",position:"relative",overflow:"hidden"},children:[y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(_7,{opacity:.6},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:41,columnNumber:33},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:41,columnNumber:7},this),y.jsxDEV("button",{onClick:E,title:`Switch to ${v==="dark"?"light":"dark"} mode`,style:{position:"absolute",top:16,right:16,zIndex:10,background:"var(--surface-2)",border:"1px solid var(--border-default)",color:"var(--text-secondary)",cursor:"pointer",fontSize:"1rem",padding:"6px 10px",borderRadius:"var(--radius-sm)",transition:"all var(--duration-fast) var(--ease-out)",lineHeight:1},children:v==="dark"?"☀":"☽"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:43,columnNumber:7},this),y.jsxDEV("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360,position:"relative",zIndex:1},children:[y.jsxDEV("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[y.jsxDEV("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:75,columnNumber:11},this),y.jsxDEV("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:91,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:101,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:71,columnNumber:9},this),y.jsxDEV("form",{onSubmit:x,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[u&&y.jsxDEV("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:123,columnNumber:13},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-3)"},children:[y.jsxDEV("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:138,columnNumber:13},this),y.jsxDEV("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:T=>e(T.target.value),autoFocus:!0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:149,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:137,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:160,columnNumber:13},this),y.jsxDEV("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:T=>s(T.target.value)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:171,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:159,columnNumber:11},this),y.jsxDEV("button",{type:"submit",disabled:l,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:l?"wait":"pointer",opacity:l?.7:1},children:l?"Authenticating...":"Access Mission Control"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:180,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:113,columnNumber:9},this),y.jsxDEV("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:197,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:64,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:32,columnNumber:5},this)}var uC={exports:{}},JE={},SV;function N7(){if(SV)return JE;SV=1;/**
289
+ Active sessions will be aborted.`))){T(!0),f(!1);try{const J=await fetch("/api/system/engine",{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({engine:F})});if(J.ok)(await J.json()).ok&&(e(),alert(`Engine switched to ${F==="opencode"?"OpenCode":F==="claude-code"?"Claude Code":"Auto"}!`));else{const X=await J.json();alert(`Failed to switch engine: ${X.error}`)}}catch{alert("Failed to switch engine")}finally{T(!1)}}},te=[{id:"opencode",label:"OpenCode",icon:"⚡",desc:"Use OpenCode as AI backend"},{id:"claude-code",label:"Claude Code",icon:"🤖",desc:"Use Claude Code as AI backend"},{id:"auto",label:"Auto",icon:"🔄",desc:"Auto-detect available engine"}],H=n.filter(F=>{const $=g.toLowerCase();return F.name.toLowerCase().includes($)||F.id.toLowerCase().includes($)||F.provider.toLowerCase().includes($)}),I=F=>{F.key==="ArrowDown"?(F.preventDefault(),E($=>Math.min($+1,H.length-1))):F.key==="ArrowUp"?(F.preventDefault(),E($=>Math.max($-1,0))):F.key==="Enter"&&H[v]?(F.preventDefault(),l(H[v].id),p(!1),x("")):F.key==="Escape"&&(p(!1),x(""))};return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("div",{ref:D,style:{position:"relative"},children:[y.jsxDEV("button",{onClick:()=>{f(!u)},style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:P,background:`${P}18`,border:`1px solid ${P}44`,padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.04em",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[y.jsxDEV("span",{style:{width:5,height:5,borderRadius:"50%",background:P,boxShadow:`0 0 4px ${P}`}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:150,columnNumber:11},this),j==="opencode"?"OpenCode":j==="claude-code"?"Claude Code":"Auto",y.jsxDEV("span",{style:{fontSize:"0.5rem",opacity:.7,marginLeft:2},children:"⚙"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:160,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:130,columnNumber:9},this),u&&y.jsxDEV("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",zIndex:1001,minWidth:220,overflow:"hidden"},children:[y.jsxDEV("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--border-subtle)",fontSize:"0.6rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:"Switch Engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:179,columnNumber:13},this),te.map(F=>y.jsxDEV("button",{onClick:()=>K(F.id),disabled:S,style:{width:"100%",padding:"8px 12px",background:j===F.id?`${P}12`:"transparent",border:"none",textAlign:"left",cursor:S?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:j===F.id?P:"var(--text-secondary)",borderBottom:"1px solid var(--border-subtle)",opacity:S?.5:1},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[y.jsxDEV("span",{children:F.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:212,columnNumber:19},this),y.jsxDEV("span",{style:{fontWeight:600},children:F.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:213,columnNumber:19},this),j===F.id&&y.jsxDEV("span",{style:{fontSize:"0.5rem",background:P,color:"#000",padding:"1px 4px",borderRadius:3},children:"Active"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:215,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:211,columnNumber:17},this),y.jsxDEV("div",{style:{fontSize:"0.55rem",color:"var(--text-muted)",paddingLeft:20},children:F.desc},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:220,columnNumber:17},this)]},F.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:191,columnNumber:15},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:164,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:129,columnNumber:7},this),U&&n.length>0&&y.jsxDEV("div",{ref:A,style:{position:"relative"},children:[y.jsxDEV("button",{onClick:()=>{p(!h),x(""),E(0)},style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:P,background:`${P}18`,border:`1px solid ${P}44`,padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.04em",display:"flex",alignItems:"center",gap:4,cursor:"pointer"},children:[(z==null?void 0:z.name)||s||"Select Model",y.jsxDEV("span",{style:{fontSize:"0.5rem",opacity:.7,marginLeft:2},children:"▼"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:255,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:232,columnNumber:11},this),h&&y.jsxDEV("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,0.3)",zIndex:1e3,minWidth:280,overflow:"hidden",display:"flex",flexDirection:"column"},children:[y.jsxDEV("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem"},children:"🔍"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:285,columnNumber:17},this),y.jsxDEV("input",{ref:M,type:"text",placeholder:"Search models...",value:g,onChange:F=>{x(F.target.value),E(0)},onKeyDown:I,style:{flex:1,background:"transparent",border:"none",outline:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-primary)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:286,columnNumber:17},this),g&&y.jsxDEV("button",{onClick:()=>x(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:"0.65rem",padding:0},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:307,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:276,columnNumber:15},this),y.jsxDEV("div",{style:{overflowY:"auto",maxHeight:240},children:H.length===0?y.jsxDEV("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)"},children:"No models found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:324,columnNumber:19},this):H.map((F,$)=>y.jsxDEV("button",{onClick:()=>{l(F.id),p(!1),x("")},onMouseEnter:()=>E($),style:{width:"100%",padding:"6px 12px",background:$===v?`${P}20`:s===F.id?`${P}12`:"transparent",border:"none",textAlign:"left",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:$===v||s===F.id?P:"var(--text-secondary)",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("div",{style:{fontWeight:600,marginBottom:2},children:F.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:368,columnNumber:23},this),y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.55rem",color:"var(--text-muted)"},children:[y.jsxDEV("span",{children:F.provider},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:377,columnNumber:25},this),y.jsxDEV("span",{style:{opacity:.6},children:["$",F.cost.input,"/$",F.cost.output]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:378,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:369,columnNumber:23},this)]},F.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:337,columnNumber:21},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:322,columnNumber:15},this),y.jsxDEV("div",{style:{padding:"4px 12px",borderTop:"1px solid var(--border-subtle)",fontSize:"0.55rem",color:"var(--text-muted)",fontFamily:"var(--font-mono)",display:"flex",justifyContent:"space-between"},children:[y.jsxDEV("span",{children:"↑↓ Navigate • Enter Select • Esc Close"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:397,columnNumber:17},this),y.jsxDEV("span",{children:[H.length," models"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:398,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:386,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:259,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:231,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/EngineBadge.tsx",lineNumber:127,columnNumber:5},this)}function NV(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return e>0?`${e}h ${n}m`:`${n}m`}function p7(){const[t,e]=O.useState(null),[n,s]=O.useState(!1);if(O.useEffect(()=>{let u=!0;const f=()=>{fetch("/api/health").then(p=>p.json()).then(p=>{u&&(e(p),s(!1))}).catch(()=>{u&&s(!0)})};f();const h=setInterval(f,3e4);return()=>{u=!1,clearInterval(h)}},[]),n)return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6,fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"#ef4444",padding:"4px 10px",background:"#2a0a0a",border:"1px solid #ef444444",borderRadius:20},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"#ef4444"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:45,columnNumber:9},this),"Offline"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:38,columnNumber:7},this);if(!t)return null;const o=t.status==="ok",l=o?"#4ade80":"#f59e0b";return y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",padding:"4px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:20,cursor:"default"},title:`DB: ${t.database} | Engine: ${t.engine??"none"} | RAM: ${t.memory.heapUsedMB}/${t.memory.heapTotalMB}MB | Uptime: ${NV(t.uptime)}`,children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:l,boxShadow:o?`0 0 6px ${l}`:"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:64,columnNumber:7},this),y.jsxDEV("span",{children:t.engine??"no engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:68,columnNumber:7},this),y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:69,columnNumber:7},this),y.jsxDEV("span",{children:NV(t.uptime)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:70,columnNumber:7},this),y.jsxDEV("span",{style:{color:"var(--border-subtle)"},children:"|"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:71,columnNumber:7},this),y.jsxDEV("span",{children:[t.memory.heapUsedMB,"MB"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:72,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/HealthIndicator.tsx",lineNumber:57,columnNumber:5},this)}const g7={success:5e3,info:5e3,warning:8e3,error:null},qT=Nc((t,e)=>({notifications:[],notify:(n,s,o)=>{const l=crypto.randomUUID(),u={id:l,type:n,message:s,detail:o,createdAt:Date.now()};t(h=>({notifications:[...h.notifications.slice(-19),u]}));const f=g7[n];f&&setTimeout(()=>e().dismiss(l),f)},dismiss:n=>{t(s=>({notifications:s.notifications.filter(o=>o.id!==n)}))},clearAll:()=>t({notifications:[]})})),MN=(t,e,n)=>qT.getState().notify(t,e,n),b7={success:{bg:"#05230e",border:"#4ade80",icon:"✓"},error:{bg:"#2a0a0a",border:"#ef4444",icon:"✕"},warning:{bg:"#2a1f0a",border:"#f59e0b",icon:"!"},info:{bg:"#0a1a2a",border:"#3b82f6",icon:"i"}};function x7(){const t=qT(n=>n.notifications),e=qT(n=>n.dismiss);return t.length===0?null:y.jsxDEV("div",{style:{position:"fixed",bottom:16,right:16,zIndex:9999,display:"flex",flexDirection:"column-reverse",gap:8,maxHeight:"calc(100vh - 32px)",overflow:"hidden",pointerEvents:"none"},children:t.slice(-5).map(n=>{const s=b7[n.type];return y.jsxDEV("div",{style:{background:s.bg,border:`1px solid ${s.border}44`,borderLeft:`3px solid ${s.border}`,borderRadius:6,padding:"10px 14px",minWidth:280,maxWidth:400,fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-primary)",pointerEvents:"auto",animation:"fadeInUp 0.3s ease-out",display:"flex",gap:10,alignItems:"flex-start"},children:[y.jsxDEV("span",{style:{color:s.border,fontWeight:800,fontSize:"0.85rem",flexShrink:0,width:18,height:18,display:"flex",alignItems:"center",justifyContent:"center",background:`${s.border}22`,borderRadius:"50%"},children:s.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:35,columnNumber:13},this),y.jsxDEV("div",{style:{flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{fontWeight:600},children:n.message},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:42,columnNumber:15},this),n.detail&&y.jsxDEV("div",{style:{fontSize:"0.7rem",color:"var(--text-muted)",marginTop:4,wordBreak:"break-word"},children:n.detail},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:44,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:41,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>e(n.id),style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.9rem",padding:0,flexShrink:0,lineHeight:1},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:49,columnNumber:13},this)]},n.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:26,columnNumber:11},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ToastContainer.tsx",lineNumber:17,columnNumber:5},this)}const al=Nc(t=>({entries:[],loading:!1,filter:{level:"all",squad:"",search:""},pinToBottom:!0,addEntry:e=>{const n={...e,id:crypto.randomUUID(),createdAt:new Date().toISOString()};t(s=>({entries:[...s.entries.slice(-499),n]}))},setFilter:e=>t(n=>({filter:{...n.filter,...e}})),setPinToBottom:e=>t({pinToBottom:e}),clear:()=>t({entries:[]}),fetchLogs:async e=>{t({loading:!0});try{const n=new URLSearchParams;e!=null&&e.level&&n.set("level",e.level),e!=null&&e.squad&&n.set("squad",e.squad),e!=null&&e.search&&n.set("search",e.search),n.set("limit","200");const s=await fetch(`/api/logs?${n}`,{credentials:"include"});if(s.ok){const l=(await s.json()).map(u=>({id:String(u.id),level:u.level,squadCode:u.squad_code??void 0,source:u.source,message:u.message,detail:u.detail??void 0,createdAt:u.created_at}));t({entries:l.reverse()})}}catch{}t({loading:!1})}})),y7=O.lazy(()=>$f(()=>import("./ThreeBackground-BJYqxm3t.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ThreeBackground})));O.lazy(()=>$f(()=>Promise.resolve().then(()=>Nle),void 0).then(t=>({default:t.MarketplaceView})));const v7=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/marketplace",label:"Marketplace",icon:"🏪"},{to:"/dashboard",label:"Dashboard",icon:"▣"},{to:"/logs",label:"Logs",icon:"▥"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/knowledge",label:"Knowledge",icon:"◆"},{to:"/settings",label:"Settings",icon:"⚙"}];function E7(){const t=au(he=>he.user),e=au(he=>he.isAuthenticated),n=au(he=>he.loading),s=au(he=>he.logout),o=au(he=>he.checkAuth),l=rD(),u=wc();u.pathname==="/office"||u.pathname;const f=u.pathname==="/jarvis",h=jS(he=>he.theme),p=jS(he=>he.toggle),g=Ps(he=>he.squads),x=Ps(he=>he.selectedSquad),v=Ps(he=>x?he.activeStates[x]:null),E=Ps(he=>he.fetchSquads),S=Ps(he=>he.setSquadState),T=Ps(he=>he.clearSquadState),D=O.useCallback((he,Ne)=>{S(he,Ne);const De=Wr.getState();De.rooms.includes(he)||De.syncRooms([...De.rooms,he]),Ne.status!=="checkpoint"&&De.clearCheckpoint(he),Ne.agents&&De.setAgents(he,Ne.agents.map(me=>({id:me.id,name:me.name,status:me.status})))},[S]),A=O.useCallback(he=>{T(he);const Ne=Wr.getState(),De=Ne.agentVisuals[he];if(De)for(const me of De)Ne.setAgentStatus(he,me.id,"idle")},[T]),M=O.useCallback((he,Ne)=>{Ei.setState(De=>({conversationId:Ne,messages:[],conversations:[{id:Ne,createdAt:new Date().toISOString(),preview:""},...De.conversations.filter(me=>me.id!==Ne)]}))},[]),j=O.useCallback((he,Ne,De)=>{if(he==="_jarvis"){lC.getState().appendChunk(De);return}const me=Ei.getState();me.streaming||me.startStreaming(),me.appendChunk(De),window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"chat:chunk",squadName:he,delta:De}}))},[]),U=O.useCallback((he,Ne,De)=>{if(he==="_jarvis"){lC.getState().finalizeMessage(De);return}Ei.getState().finishStreaming(De)},[]),P=O.useCallback((he,Ne)=>{if(he==="_jarvis"){lC.getState().setMode("LISTENING");return}Ei.getState().setError(Ne),MN("error",`Erro em ${he}`,Ne),al.getState().addEntry({level:"error",squadCode:he,source:"chat",message:Ne})},[]),z=O.useCallback((he,Ne,De)=>{he!=="_jarvis"&&(Ei.getState().setActivity(`${Ne}${De?" "+De:""}`),al.getState().addEntry({level:"info",squadCode:he,source:"activity",message:`[${Ne}] ${De}`}),window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"chat:activity",squadName:he,tool:Ne,summary:De}})))},[]),K=O.useCallback((he,Ne,De,me,qe)=>{Ei.getState().addAgentDm({agentId:De,agentName:me,content:qe})},[]),te=O.useCallback((he,Ne,De,me)=>{Wr.getState().appendBubble(he,Ne,me)},[]),H=O.useCallback((he,Ne,De,me,qe)=>{Wr.getState().addActivity(he,De,`started "${qe}"`),Wr.getState().setAgentStatus(he,Ne,"working"),al.getState().addEntry({level:"info",squadCode:he,source:"agent",message:`${De} iniciou step ${me}: ${qe}`})},[]),I=O.useCallback((he,Ne,De,me,qe)=>{Wr.getState().addActivity(he,De,`completed "${qe}"`),Wr.getState().setAgentStatus(he,Ne,"idle")},[]),F=O.useCallback((he,Ne,De,me)=>{Wr.getState().setCheckpoint(he,Ne,De,me),Wr.getState().setAgentStatus(he,Ne,"checkpoint"),MN("warning",`Checkpoint: ${De}`,me.slice(0,120))},[]),$=O.useCallback(()=>{Wr.getState().clearAllBubbles()},[]),J=O.useCallback((he,Ne,De)=>{window.dispatchEvent(new CustomEvent("execution:chunk",{detail:{type:"schedule:chunk",squadName:he,jobId:Ne,delta:De}}))},[]),X=O.useCallback((he,Ne,De)=>{zo.getState().fetchJobs(),al.getState().addEntry({level:"info",squadCode:he,source:"scheduler",message:`Pipeline iniciado (tentativa ${De})`})},[]),Q=O.useCallback((he,Ne,De,me)=>{zo.getState().fetchJobs(),MN("success",`Pipeline concluído: ${he}`,De.slice(0,120)),al.getState().addEntry({level:"info",squadCode:he,source:"scheduler",message:"Pipeline concluído",detail:De.slice(0,200)})},[]),L=O.useCallback((he,Ne,De,me,qe)=>{zo.getState().fetchJobs(),MN("error",`Pipeline falhou: ${he}`,qe?`Tentativa ${me} — retry automático`:De),al.getState().addEntry({level:"error",squadCode:he,source:"scheduler",message:`Pipeline falhou: ${De}`,detail:qe?`Retry automático (tentativa ${me})`:void 0})},[]),ee=O.useCallback((he,Ne)=>{zo.getState().updateJobStatus(he,Ne)},[]),ne=O.useCallback(he=>{window.dispatchEvent(new CustomEvent("kanban:task_updated",{detail:he}))},[]),oe=O.useCallback((he,Ne)=>{Ps.getState().setUiComponents(he,Ne)},[]),{subscribe:G,unsubscribe:B,sendChat:ae,newConversation:Z,sendCheckpointResponse:be}=LB({onSquadState:D,onSquadInactive:A,onChatConversationCreated:M,onChatChunk:j,onChatActivity:z,onChatDone:U,onChatError:P,onChatAgentDm:K,onAgentOutputChunk:te,onAgentStepStart:H,onAgentStepComplete:I,onSquadCheckpoint:F,onReconnect:$,onScheduleChunk:J,onScheduleStarted:X,onScheduleDone:Q,onScheduleError:L,onScheduleStatusChanged:ee,onKanbanTaskUpdated:ne,onA2uiUpdate:oe});O.useEffect(()=>{FB(ae)},[ae]),O.useEffect(()=>{GB(Z)},[Z]),O.useEffect(()=>{$B(be)},[be]),O.useEffect(()=>{E().then(()=>{const{squads:he}=Ps.getState();if(he.length>0){const Ne=Wr.getState(),De=he.map(Te=>Te.code),me=Ne.rooms,qe=[...new Set([...me,...De])];Ne.syncRooms(qe);for(const Te of he)!Ne.agentVisuals[Te.code]&&Te.agents&&Te.agents.length>0&&Ne.setAgents(Te.code,Te.agents.map(Ke=>({id:Ke.id,name:Ke.name,avatar:Ke.avatar,status:"idle"})))}})},[E]);const Ve=Wr(he=>he.rooms);return O.useEffect(()=>{for(const he of Ve)G(he);return()=>{for(const he of Ve)B(he)}},[Ve,G,B]),O.useEffect(()=>(G("_expxagents"),()=>B("_expxagents")),[G,B]),O.useEffect(()=>{if(f)return G("_jarvis"),()=>B("_jarvis")},[f,G,B]),O.useEffect(()=>{e||o()},[]),O.useEffect(()=>{!n&&!e&&l("/login",{state:{from:u.pathname}})},[n,e,l,u.pathname]),f?y.jsxDEV(aV,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:286,columnNumber:12},this):y.jsxDEV("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[y.jsxDEV("header",{"data-layout":"header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:311,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:326,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:335,columnNumber:11},this),y.jsxDEV(m7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:346,columnNumber:11},this),y.jsxDEV(p7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:347,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:310,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[y.jsxDEV("button",{"data-testid":"btn-restart-server",onClick:async()=>{if(confirm("Restart the server? It will be briefly unavailable."))try{await fetch("/api/system/restart",{method:"POST",credentials:"include"})}catch{}},title:"Restart server",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-muted)",he.currentTarget.style.borderColor="var(--border-subtle)"},children:"↻ Restart"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:356,columnNumber:11},this),y.jsxDEV("button",{"data-testid":"btn-toggle-theme",onClick:p,title:`Switch to ${h==="dark"?"light":"dark"} mode`,style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.85rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4,lineHeight:1},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-muted)",he.currentTarget.style.borderColor="var(--border-subtle)"},children:h==="dark"?"☀":"☽"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:390,columnNumber:11},this),y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[y.jsxDEV("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:428,columnNumber:13},this),y.jsxDEV("span",{children:t==null?void 0:t.username},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:437,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:420,columnNumber:11},this),y.jsxDEV("button",{onClick:s,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:he=>he.currentTarget.style.color="var(--status-error)",onMouseLeave:he=>he.currentTarget.style.color="var(--text-muted)",children:"Logout"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:439,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:351,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:298,columnNumber:7},this),y.jsxDEV(d7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:461,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[y.jsxDEV("aside",{"data-layout":"sidebar",style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[y.jsxDEV("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:482,columnNumber:13},this),v7.map(he=>y.jsxDEV(KO,{to:he.to,style:({isActive:Ne})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:Ne?600:400,color:Ne?"var(--accent)":"var(--text-secondary)",background:Ne?"var(--accent-glow)":"transparent",border:Ne?"1px solid var(--accent-glow)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:he.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:513,columnNumber:17},this),he.label]},he.to,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:495,columnNumber:15},this)),y.jsxDEV("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:525,columnNumber:13},this),y.jsxDEV("a",{href:"/docs",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:400,color:"var(--text-secondary)",background:"transparent",border:"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"},onMouseEnter:he=>{he.currentTarget.style.color="var(--accent)",he.currentTarget.style.background="var(--accent-glow)",he.currentTarget.style.borderColor="var(--accent-glow)"},onMouseLeave:he=>{he.currentTarget.style.color="var(--text-secondary)",he.currentTarget.style.background="transparent",he.currentTarget.style.borderColor="transparent"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"≡"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:559,columnNumber:15},this),"Docs",y.jsxDEV("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:567,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:530,columnNumber:13},this),y.jsxDEV("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid var(--status-active-glow)",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:593,columnNumber:15},this),"Ava",y.jsxDEV("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:601,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:574,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:475,columnNumber:11},this),y.jsxDEV("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[y.jsxDEV("span",{children:[g.length," squad",g.length!==1?"s":""]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:620,columnNumber:13},this),y.jsxDEV("span",{children:"v0.1.0"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:621,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:611,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:466,columnNumber:9},this),y.jsxDEV("main",{className:"grid-bg",style:{flex:1,overflow:"hidden",position:"relative"},children:[y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(y7,{opacity:.4},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:632,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:631,columnNumber:11},this),y.jsxDEV("div",{style:{position:"relative",zIndex:1,height:"100%",overflow:"auto"},children:y.jsxDEV(aV,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:635,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:634,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:626,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:464,columnNumber:7},this),y.jsxDEV("div",{"data-layout":"statusbar",children:y.jsxDEV(qB,{state:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:642,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:641,columnNumber:7},this),y.jsxDEV(x7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:644,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/App.tsx",lineNumber:290,columnNumber:5},this)}const _7=O.lazy(()=>$f(()=>import("./ThreeBackground-BJYqxm3t.js"),__vite__mapDeps([0,1])).then(t=>({default:t.ThreeBackground})));function w7(){var S;const[t,e]=O.useState(""),[n,s]=O.useState(""),o=au(T=>T.login),l=au(T=>T.loading),u=au(T=>T.error),f=au(T=>T.isAuthenticated),h=rD(),g=((S=wc().state)==null?void 0:S.from)||"/";O.useEffect(()=>{f&&h(g,{replace:!0})},[f,h,g]);const x=T=>{T.preventDefault(),o(t,n)},v=jS(T=>T.theme),E=jS(T=>T.toggle);return y.jsxDEV("div",{className:"noise-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)",position:"relative",overflow:"hidden"},children:[y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(_7,{opacity:.6},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:41,columnNumber:33},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:41,columnNumber:7},this),y.jsxDEV("button",{onClick:E,title:`Switch to ${v==="dark"?"light":"dark"} mode`,style:{position:"absolute",top:16,right:16,zIndex:10,background:"var(--surface-2)",border:"1px solid var(--border-default)",color:"var(--text-secondary)",cursor:"pointer",fontSize:"1rem",padding:"6px 10px",borderRadius:"var(--radius-sm)",transition:"all var(--duration-fast) var(--ease-out)",lineHeight:1},children:v==="dark"?"☀":"☽"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:43,columnNumber:7},this),y.jsxDEV("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360,position:"relative",zIndex:1},children:[y.jsxDEV("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[y.jsxDEV("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:75,columnNumber:11},this),y.jsxDEV("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:91,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:101,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:71,columnNumber:9},this),y.jsxDEV("form",{onSubmit:x,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[u&&y.jsxDEV("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:123,columnNumber:13},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-3)"},children:[y.jsxDEV("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:138,columnNumber:13},this),y.jsxDEV("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:T=>e(T.target.value),autoFocus:!0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:149,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:137,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:160,columnNumber:13},this),y.jsxDEV("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:T=>s(T.target.value)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:171,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:159,columnNumber:11},this),y.jsxDEV("button",{type:"submit",disabled:l,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:l?"wait":"pointer",opacity:l?.7:1},children:l?"Authenticating...":"Access Mission Control"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:180,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:113,columnNumber:9},this),y.jsxDEV("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:197,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:64,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/LoginPage.tsx",lineNumber:32,columnNumber:5},this)}var uC={exports:{}},JE={},SV;function N7(){if(SV)return JE;SV=1;/**
290
290
  * @license React
291
291
  * react-jsx-runtime.development.js
292
292
  *
@@ -299,7 +299,7 @@ Active sessions will be aborted.`))){T(!0),f(!1);try{const J=await fetch("/api/s
299
299
  <%s {...props} />
300
300
  React keys must be passed directly to JSX without using spread:
301
301
  let props = %s;
302
- <%s key={someKey} {...props} />`,be,Ne,De,Ne),G[Ne+be]=!0)}if(Ne=null,Z!==void 0&&(n(Z),Ne=""+Z),u(ae)&&(n(ae.key),Ne=""+ae.key),"key"in ae){Z={};for(var me in ae)me!=="key"&&(Z[me]=ae[me])}else Z=ae;return Ne&&f(Z,typeof B=="function"?B.displayName||B.name||"Unknown":B),p(B,Ne,Z,o(),Ve,he)}function x(B){v(B)?B._store&&(B._store.validated=1):typeof B=="object"&&B!==null&&B.$$typeof===H&&(B._payload.status==="fulfilled"?v(B._payload.value)&&B._payload.value._store&&(B._payload.value._store.validated=1):B._store&&(B._store.validated=1))}function v(B){return typeof B=="object"&&B!==null&&B.$$typeof===S}var E=Um(),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),U=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),$=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,X=Array.isArray,Q=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(B){return B()}};var L,ee={},ne=E.react_stack_bottom_frame.bind(E,l)(),oe=Q(s(l)),G={};JE.Fragment=D,JE.jsx=function(B,ae,Z){var be=1e4>$.recentlyCreatedOwnerStacks++;return g(B,ae,Z,!1,be?Error("react-stack-top-frame"):ne,be?Q(s(B)):oe)},JE.jsxs=function(B,ae,Z){var be=1e4>$.recentlyCreatedOwnerStacks++;return g(B,ae,Z,!0,be?Error("react-stack-top-frame"):ne,be?Q(s(B)):oe)}})(),JE}var DV;function S7(){return DV||(DV=1,uC.exports=N7()),uC.exports}var Le=S7();function t5(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const o=t5(s,e,n);if(o)return o;s=s.sibling}}function n5(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const QR=n5(O.createContext(null));let r5=class extends O.Component{render(){return O.createElement(QR.Provider,{value:this._reactInternals},this.props.children)}};function D7(){const t=O.useContext(QR);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=O.useId();return O.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const s=t5(n,!1,o=>{let l=o.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(s)return s}},[t,e])}const A7=Symbol.for("react.context"),C7=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===A7;function T7(){const t=D7(),[e]=O.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;C7(s)&&s!==QR&&!e.has(s)&&e.set(s,O.use(n5(s))),n=n.return}return e}function R7(){const t=T7();return O.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>s=>O.createElement(e,null,O.createElement(n.Provider,{...s,value:t.get(n)})),e=>O.createElement(r5,{...e})),[t])}var hn=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(hn||{});const FT=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},VN=(t,e)=>FT(t).priority??e,Zr={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(FT).forEach(e=>{e.type.forEach(n=>{var s,o;return(o=(s=this._removeHandlers)[n])==null?void 0:o.call(s,e)})}),this},add(...t){return t.map(FT).forEach(e=>{e.type.forEach(n=>{var l,u;const s=this._addHandlers,o=this._queue;s[n]?(u=s[n])==null||u.call(s,e):(o[n]=o[n]||[],(l=o[n])==null||l.push(e))})}),this},handle(t,e,n){var u;const s=this._addHandlers,o=this._removeHandlers;if(s[t]||o[t])throw new Error(`Extension type ${t} already has a handler`);s[t]=e,o[t]=n;const l=this._queue;return l[t]&&((u=l[t])==null||u.forEach(f=>e(f)),delete l[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,s=>{e.findIndex(l=>l.name===s.name)>=0||(e.push({name:s.name,value:s.ref}),e.sort((l,u)=>VN(u.value,n)-VN(l.value,n)))},s=>{const o=e.findIndex(l=>l.name===s.name);o!==-1&&e.splice(o,1)})},handleByList(t,e,n=-1){return this.handle(t,s=>{e.includes(s.ref)||(e.push(s.ref),e.sort((o,l)=>VN(l,n)-VN(o,n)))},s=>{const o=e.indexOf(s.ref);o!==-1&&e.splice(o,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},j7={extension:{type:hn.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await $f(()=>import("./browserAll-BIYvjpLn.js"),__vite__mapDeps([2,3]))}},k7={extension:{type:hn.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await $f(()=>import("./webworkerAll-BVyCZ61t.js"),[])}};class Ui{constructor(e,n,s){this._x=n||0,this._y=s||0,this._observer=e}clone(e){return new Ui(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var cC={exports:{}},AV;function M7(){return AV||(AV=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function o(h,p,g){this.fn=h,this.context=p,this.once=g||!1}function l(h,p,g,x,v){if(typeof g!="function")throw new TypeError("The listener must be a function");var E=new o(g,x||h,v),S=n?n+p:p;return h._events[S]?h._events[S].fn?h._events[S]=[h._events[S],E]:h._events[S].push(E):(h._events[S]=E,h._eventsCount++),h}function u(h,p){--h._eventsCount===0?h._events=new s:delete h._events[p]}function f(){this._events=new s,this._eventsCount=0}f.prototype.eventNames=function(){var p=[],g,x;if(this._eventsCount===0)return p;for(x in g=this._events)e.call(g,x)&&p.push(n?x.slice(1):x);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(g)):p},f.prototype.listeners=function(p){var g=n?n+p:p,x=this._events[g];if(!x)return[];if(x.fn)return[x.fn];for(var v=0,E=x.length,S=new Array(E);v<E;v++)S[v]=x[v].fn;return S},f.prototype.listenerCount=function(p){var g=n?n+p:p,x=this._events[g];return x?x.fn?1:x.length:0},f.prototype.emit=function(p,g,x,v,E,S){var T=n?n+p:p;if(!this._events[T])return!1;var D=this._events[T],A=arguments.length,M,j;if(D.fn){switch(D.once&&this.removeListener(p,D.fn,void 0,!0),A){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,g),!0;case 3:return D.fn.call(D.context,g,x),!0;case 4:return D.fn.call(D.context,g,x,v),!0;case 5:return D.fn.call(D.context,g,x,v,E),!0;case 6:return D.fn.call(D.context,g,x,v,E,S),!0}for(j=1,M=new Array(A-1);j<A;j++)M[j-1]=arguments[j];D.fn.apply(D.context,M)}else{var U=D.length,P;for(j=0;j<U;j++)switch(D[j].once&&this.removeListener(p,D[j].fn,void 0,!0),A){case 1:D[j].fn.call(D[j].context);break;case 2:D[j].fn.call(D[j].context,g);break;case 3:D[j].fn.call(D[j].context,g,x);break;case 4:D[j].fn.call(D[j].context,g,x,v);break;default:if(!M)for(P=1,M=new Array(A-1);P<A;P++)M[P-1]=arguments[P];D[j].fn.apply(D[j].context,M)}}return!0},f.prototype.on=function(p,g,x){return l(this,p,g,x,!1)},f.prototype.once=function(p,g,x){return l(this,p,g,x,!0)},f.prototype.removeListener=function(p,g,x,v){var E=n?n+p:p;if(!this._events[E])return this;if(!g)return u(this,E),this;var S=this._events[E];if(S.fn)S.fn===g&&(!v||S.once)&&(!x||S.context===x)&&u(this,E);else{for(var T=0,D=[],A=S.length;T<A;T++)(S[T].fn!==g||v&&!S[T].once||x&&S[T].context!==x)&&D.push(S[T]);D.length?this._events[E]=D.length===1?D[0]:D:u(this,E)}return this},f.prototype.removeAllListeners=function(p){var g;return p?(g=n?n+p:p,this._events[g]&&u(this,g)):(this._events=new s,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=n,f.EventEmitter=f,t.exports=f})(cC)),cC.exports}var V7=M7();const bd=Jf(V7),U7=Math.PI*2,P7=180/Math.PI,O7=Math.PI/180;class ao{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new ao(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return dC.x=0,dC.y=0,dC}}const dC=new ao;class Sn{constructor(e=1,n=0,s=0,o=1,l=0,u=0){this.array=null,this.a=e,this.b=n,this.c=s,this.d=o,this.tx=l,this.ty=u}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,s,o,l,u){return this.a=e,this.b=n,this.c=s,this.d=o,this.tx=l,this.ty=u,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const s=n||this.array;return e?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(e,n){n=n||new ao;const s=e.x,o=e.y;return n.x=this.a*s+this.c*o+this.tx,n.y=this.b*s+this.d*o+this.ty,n}applyInverse(e,n){n=n||new ao;const s=this.a,o=this.b,l=this.c,u=this.d,f=this.tx,h=this.ty,p=1/(s*u+l*-o),g=e.x,x=e.y;return n.x=u*p*g+-l*p*x+(h*l-f*u)*p,n.y=s*p*x+-o*p*g+(-h*s+f*o)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),o=this.a,l=this.c,u=this.tx;return this.a=o*n-this.b*s,this.b=o*s+this.b*n,this.c=l*n-this.d*s,this.d=l*s+this.d*n,this.tx=u*n-this.ty*s,this.ty=u*s+this.ty*n,this}append(e){const n=this.a,s=this.b,o=this.c,l=this.d;return this.a=e.a*n+e.b*o,this.b=e.a*s+e.b*l,this.c=e.c*n+e.d*o,this.d=e.c*s+e.d*l,this.tx=e.tx*n+e.ty*o+this.tx,this.ty=e.tx*s+e.ty*l+this.ty,this}appendFrom(e,n){const s=e.a,o=e.b,l=e.c,u=e.d,f=e.tx,h=e.ty,p=n.a,g=n.b,x=n.c,v=n.d;return this.a=s*p+o*x,this.b=s*g+o*v,this.c=l*p+u*x,this.d=l*g+u*v,this.tx=f*p+h*x+n.tx,this.ty=f*g+h*v+n.ty,this}setTransform(e,n,s,o,l,u,f,h,p){return this.a=Math.cos(f+p)*l,this.b=Math.sin(f+p)*l,this.c=-Math.sin(f-h)*u,this.d=Math.cos(f-h)*u,this.tx=e-(s*this.a+o*this.c),this.ty=n-(s*this.b+o*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,o=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=o*e.a+this.d*e.c,this.d=o*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,s=this.b,o=this.c,l=this.d,u=e.pivot,f=-Math.atan2(-o,l),h=Math.atan2(s,n),p=Math.abs(f+h);return p<1e-5||Math.abs(U7-p)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=f,e.skew.y=h),e.scale.x=Math.sqrt(n*n+s*s),e.scale.y=Math.sqrt(o*o+l*l),e.position.x=this.tx+(u.x*n+u.y*o),e.position.y=this.ty+(u.x*s+u.y*l),e}invert(){const e=this.a,n=this.b,s=this.c,o=this.d,l=this.tx,u=e*o-n*s;return this.a=o/u,this.b=-n/u,this.c=-s/u,this.d=e/u,this.tx=(s*this.ty-o*l)/u,this.ty=-(e*this.ty-n*l)/u,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Sn;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return L7.identity()}static get shared(){return z7.identity()}}const z7=new Sn,L7=new Sn,Bg=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ig=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Hg=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],qg=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],GT=[],s5=[],UN=Math.sign;function B7(){for(let t=0;t<16;t++){const e=[];GT.push(e);for(let n=0;n<16;n++){const s=UN(Bg[t]*Bg[n]+Hg[t]*Ig[n]),o=UN(Ig[t]*Bg[n]+qg[t]*Ig[n]),l=UN(Bg[t]*Hg[n]+Hg[t]*qg[n]),u=UN(Ig[t]*Hg[n]+qg[t]*qg[n]);for(let f=0;f<16;f++)if(Bg[f]===s&&Ig[f]===o&&Hg[f]===l&&qg[f]===u){e.push(f);break}}}for(let t=0;t<16;t++){const e=new Sn;e.set(Bg[t],Ig[t],Hg[t],qg[t],0,0),s5.push(e)}}B7();const pr={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Bg[t],uY:t=>Ig[t],vX:t=>Hg[t],vY:t=>qg[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>GT[t][e],sub:(t,e)=>GT[t][pr.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?pr.S:pr.N:Math.abs(e)*2<=Math.abs(t)?t>0?pr.E:pr.W:e>0?t>0?pr.SE:pr.SW:t>0?pr.NE:pr.NW,matrixAppendRotationInv:(t,e,n=0,s=0,o=0,l=0)=>{const u=s5[pr.inv(e)],f=u.a,h=u.b,p=u.c,g=u.d,x=n-Math.min(0,f*o,p*l,f*o+p*l),v=s-Math.min(0,h*o,g*l,h*o+g*l),E=t.a,S=t.b,T=t.c,D=t.d;t.a=f*E+h*T,t.b=f*S+h*D,t.c=p*E+g*T,t.d=p*S+g*D,t.tx=x*E+v*T+t.tx,t.ty=x*S+v*D+t.ty},transformRectCoords:(t,e,n,s)=>{const{x:o,y:l,width:u,height:f}=t,{x:h,y:p,width:g,height:x}=e;return n===pr.E?(s.set(o+h,l+p,u,f),s):n===pr.S?s.set(g-l-f+h,o+p,f,u):n===pr.W?s.set(g-o-u+h,x-l-f+p,u,f):n===pr.N?s.set(l+h,x-o-u+p,f,u):s.set(o+h,l+p,u,f)}},PN=[new ao,new ao,new ao,new ao];class ws{constructor(e=0,n=0,s=0,o=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(s),this.height=Number(o)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new ws(0,0,0,0)}clone(){return new ws(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,s,o=.5){const{width:l,height:u}=this;if(l<=0||u<=0)return!1;const f=this.x,h=this.y,p=s*(1-o),g=s-p,x=f-p,v=f+l+p,E=h-p,S=h+u+p,T=f+g,D=f+l-g,A=h+g,M=h+u-g;return e>=x&&e<=v&&n>=E&&n<=S&&!(e>T&&e<D&&n>A&&n<M)}intersects(e,n){if(!n){const te=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=te)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const s=this.left,o=this.right,l=this.top,u=this.bottom;if(o<=s||u<=l)return!1;const f=PN[0].set(e.left,e.top),h=PN[1].set(e.left,e.bottom),p=PN[2].set(e.right,e.top),g=PN[3].set(e.right,e.bottom);if(p.x<=f.x||h.y<=f.y)return!1;const x=Math.sign(n.a*n.d-n.b*n.c);if(x===0||(n.apply(f,f),n.apply(h,h),n.apply(p,p),n.apply(g,g),Math.max(f.x,h.x,p.x,g.x)<=s||Math.min(f.x,h.x,p.x,g.x)>=o||Math.max(f.y,h.y,p.y,g.y)<=l||Math.min(f.y,h.y,p.y,g.y)>=u))return!1;const v=x*(h.y-f.y),E=x*(f.x-h.x),S=v*s+E*l,T=v*o+E*l,D=v*s+E*u,A=v*o+E*u;if(Math.max(S,T,D,A)<=v*f.x+E*f.y||Math.min(S,T,D,A)>=v*g.x+E*g.y)return!1;const M=x*(f.y-p.y),j=x*(p.x-f.x),U=M*s+j*l,P=M*o+j*l,z=M*s+j*u,K=M*o+j*u;return!(Math.max(U,P,z,K)<=M*f.x+j*f.y||Math.min(U,P,z,K)>=M*g.x+j*g.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),s=Math.min(this.x+this.width,e.x+e.width),o=Math.max(this.y,e.y),l=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(s-n,0),this.y=o,this.height=Math.max(l-o,0),this}ceil(e=1,n=.001){const s=Math.ceil((this.x+this.width-n)*e)/e,o=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=s-this.x,this.height=o-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),s=Math.max(this.x+this.width,e.x+e.width),o=Math.min(this.y,e.y),l=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=s-n,this.y=o,this.height=l-o,this}getBounds(e){return e||(e=new ws),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,s=e.y,o=e.x+e.width,l=e.y+e.height;return n>=this.x&&n<this.x+this.width&&s>=this.y&&s<this.y+this.height&&o>=this.x&&o<this.x+this.width&&l>=this.y&&l<this.y+this.height}set(e,n,s,o){return this.x=e,this.y=n,this.width=s,this.height=o,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const fC={default:-1};function gs(t="default"){return fC[t]===void 0&&(fC[t]=-1),++fC[t]}const CV=new Set,ps="8.0.0",I7="8.3.4",qy={quiet:!1,noColor:!1},Ln=((t,e,n=3)=>{if(qy.quiet||CV.has(e))return;let s=new Error().stack;const o=`${e}
302
+ <%s key={someKey} {...props} />`,be,Ne,De,Ne),G[Ne+be]=!0)}if(Ne=null,Z!==void 0&&(n(Z),Ne=""+Z),u(ae)&&(n(ae.key),Ne=""+ae.key),"key"in ae){Z={};for(var me in ae)me!=="key"&&(Z[me]=ae[me])}else Z=ae;return Ne&&f(Z,typeof B=="function"?B.displayName||B.name||"Unknown":B),p(B,Ne,Z,o(),Ve,he)}function x(B){v(B)?B._store&&(B._store.validated=1):typeof B=="object"&&B!==null&&B.$$typeof===H&&(B._payload.status==="fulfilled"?v(B._payload.value)&&B._payload.value._store&&(B._payload.value._store.validated=1):B._store&&(B._store.validated=1))}function v(B){return typeof B=="object"&&B!==null&&B.$$typeof===S}var E=Um(),S=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),U=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),$=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=Object.prototype.hasOwnProperty,X=Array.isArray,Q=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(B){return B()}};var L,ee={},ne=E.react_stack_bottom_frame.bind(E,l)(),oe=Q(s(l)),G={};JE.Fragment=D,JE.jsx=function(B,ae,Z){var be=1e4>$.recentlyCreatedOwnerStacks++;return g(B,ae,Z,!1,be?Error("react-stack-top-frame"):ne,be?Q(s(B)):oe)},JE.jsxs=function(B,ae,Z){var be=1e4>$.recentlyCreatedOwnerStacks++;return g(B,ae,Z,!0,be?Error("react-stack-top-frame"):ne,be?Q(s(B)):oe)}})(),JE}var DV;function S7(){return DV||(DV=1,uC.exports=N7()),uC.exports}var Le=S7();function t5(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const o=t5(s,e,n);if(o)return o;s=s.sibling}}function n5(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const QR=n5(O.createContext(null));let r5=class extends O.Component{render(){return O.createElement(QR.Provider,{value:this._reactInternals},this.props.children)}};function D7(){const t=O.useContext(QR);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=O.useId();return O.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const s=t5(n,!1,o=>{let l=o.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(s)return s}},[t,e])}const A7=Symbol.for("react.context"),C7=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===A7;function T7(){const t=D7(),[e]=O.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;C7(s)&&s!==QR&&!e.has(s)&&e.set(s,O.use(n5(s))),n=n.return}return e}function R7(){const t=T7();return O.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>s=>O.createElement(e,null,O.createElement(n.Provider,{...s,value:t.get(n)})),e=>O.createElement(r5,{...e})),[t])}var hn=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(hn||{});const FT=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},VN=(t,e)=>FT(t).priority??e,Zr={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(FT).forEach(e=>{e.type.forEach(n=>{var s,o;return(o=(s=this._removeHandlers)[n])==null?void 0:o.call(s,e)})}),this},add(...t){return t.map(FT).forEach(e=>{e.type.forEach(n=>{var l,u;const s=this._addHandlers,o=this._queue;s[n]?(u=s[n])==null||u.call(s,e):(o[n]=o[n]||[],(l=o[n])==null||l.push(e))})}),this},handle(t,e,n){var u;const s=this._addHandlers,o=this._removeHandlers;if(s[t]||o[t])throw new Error(`Extension type ${t} already has a handler`);s[t]=e,o[t]=n;const l=this._queue;return l[t]&&((u=l[t])==null||u.forEach(f=>e(f)),delete l[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,s=>{e.findIndex(l=>l.name===s.name)>=0||(e.push({name:s.name,value:s.ref}),e.sort((l,u)=>VN(u.value,n)-VN(l.value,n)))},s=>{const o=e.findIndex(l=>l.name===s.name);o!==-1&&e.splice(o,1)})},handleByList(t,e,n=-1){return this.handle(t,s=>{e.includes(s.ref)||(e.push(s.ref),e.sort((o,l)=>VN(l,n)-VN(o,n)))},s=>{const o=e.indexOf(s.ref);o!==-1&&e.splice(o,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},j7={extension:{type:hn.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await $f(()=>import("./browserAll-B0GfJV5B.js"),__vite__mapDeps([2,3]))}},k7={extension:{type:hn.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await $f(()=>import("./webworkerAll-efCwQfSA.js"),[])}};class Ui{constructor(e,n,s){this._x=n||0,this._y=s||0,this._observer=e}clone(e){return new Ui(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var cC={exports:{}},AV;function M7(){return AV||(AV=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function o(h,p,g){this.fn=h,this.context=p,this.once=g||!1}function l(h,p,g,x,v){if(typeof g!="function")throw new TypeError("The listener must be a function");var E=new o(g,x||h,v),S=n?n+p:p;return h._events[S]?h._events[S].fn?h._events[S]=[h._events[S],E]:h._events[S].push(E):(h._events[S]=E,h._eventsCount++),h}function u(h,p){--h._eventsCount===0?h._events=new s:delete h._events[p]}function f(){this._events=new s,this._eventsCount=0}f.prototype.eventNames=function(){var p=[],g,x;if(this._eventsCount===0)return p;for(x in g=this._events)e.call(g,x)&&p.push(n?x.slice(1):x);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(g)):p},f.prototype.listeners=function(p){var g=n?n+p:p,x=this._events[g];if(!x)return[];if(x.fn)return[x.fn];for(var v=0,E=x.length,S=new Array(E);v<E;v++)S[v]=x[v].fn;return S},f.prototype.listenerCount=function(p){var g=n?n+p:p,x=this._events[g];return x?x.fn?1:x.length:0},f.prototype.emit=function(p,g,x,v,E,S){var T=n?n+p:p;if(!this._events[T])return!1;var D=this._events[T],A=arguments.length,M,j;if(D.fn){switch(D.once&&this.removeListener(p,D.fn,void 0,!0),A){case 1:return D.fn.call(D.context),!0;case 2:return D.fn.call(D.context,g),!0;case 3:return D.fn.call(D.context,g,x),!0;case 4:return D.fn.call(D.context,g,x,v),!0;case 5:return D.fn.call(D.context,g,x,v,E),!0;case 6:return D.fn.call(D.context,g,x,v,E,S),!0}for(j=1,M=new Array(A-1);j<A;j++)M[j-1]=arguments[j];D.fn.apply(D.context,M)}else{var U=D.length,P;for(j=0;j<U;j++)switch(D[j].once&&this.removeListener(p,D[j].fn,void 0,!0),A){case 1:D[j].fn.call(D[j].context);break;case 2:D[j].fn.call(D[j].context,g);break;case 3:D[j].fn.call(D[j].context,g,x);break;case 4:D[j].fn.call(D[j].context,g,x,v);break;default:if(!M)for(P=1,M=new Array(A-1);P<A;P++)M[P-1]=arguments[P];D[j].fn.apply(D[j].context,M)}}return!0},f.prototype.on=function(p,g,x){return l(this,p,g,x,!1)},f.prototype.once=function(p,g,x){return l(this,p,g,x,!0)},f.prototype.removeListener=function(p,g,x,v){var E=n?n+p:p;if(!this._events[E])return this;if(!g)return u(this,E),this;var S=this._events[E];if(S.fn)S.fn===g&&(!v||S.once)&&(!x||S.context===x)&&u(this,E);else{for(var T=0,D=[],A=S.length;T<A;T++)(S[T].fn!==g||v&&!S[T].once||x&&S[T].context!==x)&&D.push(S[T]);D.length?this._events[E]=D.length===1?D[0]:D:u(this,E)}return this},f.prototype.removeAllListeners=function(p){var g;return p?(g=n?n+p:p,this._events[g]&&u(this,g)):(this._events=new s,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=n,f.EventEmitter=f,t.exports=f})(cC)),cC.exports}var V7=M7();const bd=Jf(V7),U7=Math.PI*2,P7=180/Math.PI,O7=Math.PI/180;class ao{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new ao(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return dC.x=0,dC.y=0,dC}}const dC=new ao;class Sn{constructor(e=1,n=0,s=0,o=1,l=0,u=0){this.array=null,this.a=e,this.b=n,this.c=s,this.d=o,this.tx=l,this.ty=u}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,s,o,l,u){return this.a=e,this.b=n,this.c=s,this.d=o,this.tx=l,this.ty=u,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const s=n||this.array;return e?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(e,n){n=n||new ao;const s=e.x,o=e.y;return n.x=this.a*s+this.c*o+this.tx,n.y=this.b*s+this.d*o+this.ty,n}applyInverse(e,n){n=n||new ao;const s=this.a,o=this.b,l=this.c,u=this.d,f=this.tx,h=this.ty,p=1/(s*u+l*-o),g=e.x,x=e.y;return n.x=u*p*g+-l*p*x+(h*l-f*u)*p,n.y=s*p*x+-o*p*g+(-h*s+f*o)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),o=this.a,l=this.c,u=this.tx;return this.a=o*n-this.b*s,this.b=o*s+this.b*n,this.c=l*n-this.d*s,this.d=l*s+this.d*n,this.tx=u*n-this.ty*s,this.ty=u*s+this.ty*n,this}append(e){const n=this.a,s=this.b,o=this.c,l=this.d;return this.a=e.a*n+e.b*o,this.b=e.a*s+e.b*l,this.c=e.c*n+e.d*o,this.d=e.c*s+e.d*l,this.tx=e.tx*n+e.ty*o+this.tx,this.ty=e.tx*s+e.ty*l+this.ty,this}appendFrom(e,n){const s=e.a,o=e.b,l=e.c,u=e.d,f=e.tx,h=e.ty,p=n.a,g=n.b,x=n.c,v=n.d;return this.a=s*p+o*x,this.b=s*g+o*v,this.c=l*p+u*x,this.d=l*g+u*v,this.tx=f*p+h*x+n.tx,this.ty=f*g+h*v+n.ty,this}setTransform(e,n,s,o,l,u,f,h,p){return this.a=Math.cos(f+p)*l,this.b=Math.sin(f+p)*l,this.c=-Math.sin(f-h)*u,this.d=Math.cos(f-h)*u,this.tx=e-(s*this.a+o*this.c),this.ty=n-(s*this.b+o*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,o=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=o*e.a+this.d*e.c,this.d=o*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,s=this.b,o=this.c,l=this.d,u=e.pivot,f=-Math.atan2(-o,l),h=Math.atan2(s,n),p=Math.abs(f+h);return p<1e-5||Math.abs(U7-p)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=f,e.skew.y=h),e.scale.x=Math.sqrt(n*n+s*s),e.scale.y=Math.sqrt(o*o+l*l),e.position.x=this.tx+(u.x*n+u.y*o),e.position.y=this.ty+(u.x*s+u.y*l),e}invert(){const e=this.a,n=this.b,s=this.c,o=this.d,l=this.tx,u=e*o-n*s;return this.a=o/u,this.b=-n/u,this.c=-s/u,this.d=e/u,this.tx=(s*this.ty-o*l)/u,this.ty=-(e*this.ty-n*l)/u,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Sn;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return L7.identity()}static get shared(){return z7.identity()}}const z7=new Sn,L7=new Sn,Bg=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ig=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Hg=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],qg=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],GT=[],s5=[],UN=Math.sign;function B7(){for(let t=0;t<16;t++){const e=[];GT.push(e);for(let n=0;n<16;n++){const s=UN(Bg[t]*Bg[n]+Hg[t]*Ig[n]),o=UN(Ig[t]*Bg[n]+qg[t]*Ig[n]),l=UN(Bg[t]*Hg[n]+Hg[t]*qg[n]),u=UN(Ig[t]*Hg[n]+qg[t]*qg[n]);for(let f=0;f<16;f++)if(Bg[f]===s&&Ig[f]===o&&Hg[f]===l&&qg[f]===u){e.push(f);break}}}for(let t=0;t<16;t++){const e=new Sn;e.set(Bg[t],Ig[t],Hg[t],qg[t],0,0),s5.push(e)}}B7();const pr={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>Bg[t],uY:t=>Ig[t],vX:t=>Hg[t],vY:t=>qg[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>GT[t][e],sub:(t,e)=>GT[t][pr.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?pr.S:pr.N:Math.abs(e)*2<=Math.abs(t)?t>0?pr.E:pr.W:e>0?t>0?pr.SE:pr.SW:t>0?pr.NE:pr.NW,matrixAppendRotationInv:(t,e,n=0,s=0,o=0,l=0)=>{const u=s5[pr.inv(e)],f=u.a,h=u.b,p=u.c,g=u.d,x=n-Math.min(0,f*o,p*l,f*o+p*l),v=s-Math.min(0,h*o,g*l,h*o+g*l),E=t.a,S=t.b,T=t.c,D=t.d;t.a=f*E+h*T,t.b=f*S+h*D,t.c=p*E+g*T,t.d=p*S+g*D,t.tx=x*E+v*T+t.tx,t.ty=x*S+v*D+t.ty},transformRectCoords:(t,e,n,s)=>{const{x:o,y:l,width:u,height:f}=t,{x:h,y:p,width:g,height:x}=e;return n===pr.E?(s.set(o+h,l+p,u,f),s):n===pr.S?s.set(g-l-f+h,o+p,f,u):n===pr.W?s.set(g-o-u+h,x-l-f+p,u,f):n===pr.N?s.set(l+h,x-o-u+p,f,u):s.set(o+h,l+p,u,f)}},PN=[new ao,new ao,new ao,new ao];class ws{constructor(e=0,n=0,s=0,o=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(s),this.height=Number(o)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new ws(0,0,0,0)}clone(){return new ws(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,s,o=.5){const{width:l,height:u}=this;if(l<=0||u<=0)return!1;const f=this.x,h=this.y,p=s*(1-o),g=s-p,x=f-p,v=f+l+p,E=h-p,S=h+u+p,T=f+g,D=f+l-g,A=h+g,M=h+u-g;return e>=x&&e<=v&&n>=E&&n<=S&&!(e>T&&e<D&&n>A&&n<M)}intersects(e,n){if(!n){const te=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=te)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const s=this.left,o=this.right,l=this.top,u=this.bottom;if(o<=s||u<=l)return!1;const f=PN[0].set(e.left,e.top),h=PN[1].set(e.left,e.bottom),p=PN[2].set(e.right,e.top),g=PN[3].set(e.right,e.bottom);if(p.x<=f.x||h.y<=f.y)return!1;const x=Math.sign(n.a*n.d-n.b*n.c);if(x===0||(n.apply(f,f),n.apply(h,h),n.apply(p,p),n.apply(g,g),Math.max(f.x,h.x,p.x,g.x)<=s||Math.min(f.x,h.x,p.x,g.x)>=o||Math.max(f.y,h.y,p.y,g.y)<=l||Math.min(f.y,h.y,p.y,g.y)>=u))return!1;const v=x*(h.y-f.y),E=x*(f.x-h.x),S=v*s+E*l,T=v*o+E*l,D=v*s+E*u,A=v*o+E*u;if(Math.max(S,T,D,A)<=v*f.x+E*f.y||Math.min(S,T,D,A)>=v*g.x+E*g.y)return!1;const M=x*(f.y-p.y),j=x*(p.x-f.x),U=M*s+j*l,P=M*o+j*l,z=M*s+j*u,K=M*o+j*u;return!(Math.max(U,P,z,K)<=M*f.x+j*f.y||Math.min(U,P,z,K)>=M*g.x+j*g.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),s=Math.min(this.x+this.width,e.x+e.width),o=Math.max(this.y,e.y),l=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(s-n,0),this.y=o,this.height=Math.max(l-o,0),this}ceil(e=1,n=.001){const s=Math.ceil((this.x+this.width-n)*e)/e,o=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=s-this.x,this.height=o-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),s=Math.max(this.x+this.width,e.x+e.width),o=Math.min(this.y,e.y),l=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=s-n,this.y=o,this.height=l-o,this}getBounds(e){return e||(e=new ws),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,s=e.y,o=e.x+e.width,l=e.y+e.height;return n>=this.x&&n<this.x+this.width&&s>=this.y&&s<this.y+this.height&&o>=this.x&&o<this.x+this.width&&l>=this.y&&l<this.y+this.height}set(e,n,s,o){return this.x=e,this.y=n,this.width=s,this.height=o,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const fC={default:-1};function gs(t="default"){return fC[t]===void 0&&(fC[t]=-1),++fC[t]}const CV=new Set,ps="8.0.0",I7="8.3.4",qy={quiet:!1,noColor:!1},Ln=((t,e,n=3)=>{if(qy.quiet||CV.has(e))return;let s=new Error().stack;const o=`${e}
303
303
  Deprecated since v${t}`,l=typeof console.groupCollapsed=="function"&&!qy.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",o):(s=s.split(`
304
304
  `).splice(n).join(`
305
305
  `),l?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",o),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",o),console.warn(s))),CV.add(e)});Object.defineProperties(Ln,{quiet:{get:()=>qy.quiet,set:t=>{qy.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>qy.noColor,set:t=>{qy.noColor=t},enumerable:!0,configurable:!1}});const i5=()=>{};function ev(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function TV(t){return!(t&t-1)&&!!t}function o5(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const RV=Object.create(null);function H7(t){const e=RV[t];return e===void 0&&(RV[t]=gs("resource")),e}const a5=class l5 extends bd{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...l5.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){Ln(ps,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=H7(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};a5.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let tv=a5;const u5=class c5 extends bd{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=gs("textureSource"),this._resourceType="textureSource",this._resourceId=gs("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...c5.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new tv(o5(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var n,s;this.style!==e&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=e,(s=this._style)==null||s.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var e,n;this._resourceId=gs("resource"),this.emit("change",this),this.emit("unload",this);for(const s in this._gpuData)(n=(e=this._gpuData[s])==null?void 0:e.destroy)==null||n.call(e);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,s){s||(s=this._resolution),e||(e=this.width),n||(n=this.height);const o=Math.round(e*s),l=Math.round(n*s);return this.width=o/s,this.height=l/s,this._resolution=s,this.pixelWidth===o&&this.pixelHeight===l?!1:(this._refreshPOT(),this.pixelWidth=o,this.pixelHeight=l,this.emit("resize",this),this._resourceId=gs("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=TV(this.pixelWidth)&&TV(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};u5.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let du=u5;class ZR extends du{constructor(e){const n=e.resource||new Float32Array(e.width*e.height*4);let s=e.format;s||(n instanceof Float32Array?s="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?s="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?s="rgba16uint":(n instanceof Int8Array,s="bgra8unorm")),super({...e,resource:n,format:s}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}ZR.extension=hn.TextureSource;const jV=new Sn;class q7{constructor(e,n){this.mapCoord=new Sn,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var n;this.texture!==e&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,n){n===void 0&&(n=e);const s=this.mapCoord;for(let o=0;o<e.length;o+=2){const l=e[o],u=e[o+1];n[o]=l*s.a+u*s.c+s.tx,n[o+1]=l*s.b+u*s.d+s.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const s=e.orig,o=e.trim;o&&(jV.set(s.width/o.width,0,0,s.height/o.height,-o.x/o.width,-o.y/o.height),this.mapCoord.append(jV));const l=e.source,u=this.uClampFrame,f=this.clampMargin/l._resolution,h=this.clampOffset/l._resolution;return u[0]=(e.frame.x+f+h)/l.width,u[1]=(e.frame.y+f+h)/l.height,u[2]=(e.frame.x+e.frame.width-f+h)/l.width,u[3]=(e.frame.y+e.frame.height-f+h)/l.height,this.uClampOffset[0]=this.clampOffset/l.pixelWidth,this.uClampOffset[1]=this.clampOffset/l.pixelHeight,this.isSimple=e.frame.width===l.width&&e.frame.height===l.height&&e.rotate===0,!0}}class ur extends bd{constructor({source:e,label:n,frame:s,orig:o,trim:l,defaultAnchor:u,defaultBorders:f,rotate:h,dynamic:p}={}){if(super(),this.uid=gs("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new ws,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(e==null?void 0:e.source)??new du,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:g,height:x}=this._source;this.frame.width=g,this.frame.height=x}this.orig=o||this.frame,this.trim=l,this.rotate=h??0,this.defaultAnchor=u,this.defaultBorders=f,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new q7(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:s,height:o}=this._source,l=n.x/s,u=n.y/o,f=n.width/s,h=n.height/o;let p=this.rotate;if(p){const g=f/2,x=h/2,v=l+g,E=u+x;p=pr.add(p,pr.NW),e.x0=v+g*pr.uX(p),e.y0=E+x*pr.uY(p),p=pr.add(p,2),e.x1=v+g*pr.uX(p),e.y1=E+x*pr.uY(p),p=pr.add(p,2),e.x2=v+g*pr.uX(p),e.y2=E+x*pr.uY(p),p=pr.add(p,2),e.x3=v+g*pr.uX(p),e.y3=E+x*pr.uY(p)}else e.x0=l,e.y0=u,e.x1=l+f,e.y1=u,e.x2=l+f,e.y2=u+h,e.x3=l,e.y3=u+h}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return Ln(ps,"Texture.baseTexture is now Texture.source"),this._source}}ur.EMPTY=new ur({label:"EMPTY",source:new du({label:"EMPTY"})});ur.EMPTY.destroy=i5;ur.WHITE=new ur({source:new ZR({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});ur.WHITE.destroy=i5;function d5(t,e,n){const{width:s,height:o}=n.orig,l=n.trim;if(l){const u=l.width,f=l.height;t.minX=l.x-e._x*s,t.maxX=t.minX+u,t.minY=l.y-e._y*o,t.maxY=t.minY+f}else t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*o,t.maxY=t.minY+o}const kV=new Sn;class cu{constructor(e=1/0,n=1/0,s=-1/0,o=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=kV,this.minX=e,this.minY=n,this.maxX=s,this.maxY=o}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new ws);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=kV,this}set(e,n,s,o){this.minX=e,this.minY=n,this.maxX=s,this.maxY=o}addFrame(e,n,s,o,l){l||(l=this.matrix);const u=l.a,f=l.b,h=l.c,p=l.d,g=l.tx,x=l.ty;let v=this.minX,E=this.minY,S=this.maxX,T=this.maxY,D=u*e+h*n+g,A=f*e+p*n+x;D<v&&(v=D),A<E&&(E=A),D>S&&(S=D),A>T&&(T=A),D=u*s+h*n+g,A=f*s+p*n+x,D<v&&(v=D),A<E&&(E=A),D>S&&(S=D),A>T&&(T=A),D=u*e+h*o+g,A=f*e+p*o+x,D<v&&(v=D),A<E&&(E=A),D>S&&(S=D),A>T&&(T=A),D=u*s+h*o+g,A=f*s+p*o+x,D<v&&(v=D),A<E&&(E=A),D>S&&(S=D),A>T&&(T=A),this.minX=v,this.minY=E,this.maxX=S,this.maxY=T}addRect(e,n){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,n)}addBounds(e,n){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,n)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const n=this.minX,s=this.minY,o=this.maxX,l=this.maxY,{a:u,b:f,c:h,d:p,tx:g,ty:x}=e;let v=u*n+h*s+g,E=f*n+p*s+x;this.minX=v,this.minY=E,this.maxX=v,this.maxY=E,v=u*o+h*s+g,E=f*o+p*s+x,this.minX=v<this.minX?v:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=v>this.maxX?v:this.maxX,this.maxY=E>this.maxY?E:this.maxY,v=u*n+h*l+g,E=f*n+p*l+x,this.minX=v<this.minX?v:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=v>this.maxX?v:this.maxX,this.maxY=E>this.maxY?E:this.maxY,v=u*o+h*l+g,E=f*o+p*l+x,this.minX=v<this.minX?v:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=v>this.maxX?v:this.maxX,this.maxY=E>this.maxY?E:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,n,s,o){return this.minX<e&&(this.minX=e),this.maxX>n&&(this.maxX=n),this.minY<s&&(this.minY=s),this.maxY>o&&(this.maxY=o),this}pad(e,n=e){return this.minX-=e,this.maxX+=e,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new cu(this.minX,this.minY,this.maxX,this.maxY)}scale(e,n=e){return this.minX*=e,this.minY*=n,this.maxX*=e,this.maxY*=n,this}get x(){return this.minX}set x(e){const n=this.maxX-this.minX;this.minX=e,this.maxX=e+n}get y(){return this.minY}set y(e){const n=this.maxY-this.minY;this.minY=e,this.maxY=e+n}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,n,s,o){let l=this.minX,u=this.minY,f=this.maxX,h=this.maxY;o||(o=this.matrix);const p=o.a,g=o.b,x=o.c,v=o.d,E=o.tx,S=o.ty;for(let T=n;T<s;T+=2){const D=e[T],A=e[T+1],M=p*D+x*A+E,j=g*D+v*A+S;l=M<l?M:l,u=j<u?j:u,f=M>f?M:f,h=j>h?j:h}this.minX=l,this.minY=u,this.maxX=f,this.maxY=h}containsPoint(e,n){return this.minX<=e&&this.minY<=n&&this.maxX>=e&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var F7={grad:.9,turn:360,rad:360/(2*Math.PI)},Bf=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},_i=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},lu=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},f5=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},MV=function(t){return{r:lu(t.r,0,255),g:lu(t.g,0,255),b:lu(t.b,0,255),a:lu(t.a)}},hC=function(t){return{r:_i(t.r),g:_i(t.g),b:_i(t.b),a:_i(t.a,3)}},G7=/^#([0-9a-f]{3,8})$/i,ON=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},h5=function(t){var e=t.r,n=t.g,s=t.b,o=t.a,l=Math.max(e,n,s),u=l-Math.min(e,n,s),f=u?l===e?(n-s)/u:l===n?2+(s-e)/u:4+(e-n)/u:0;return{h:60*(f<0?f+6:f),s:l?u/l*100:0,v:l/255*100,a:o}},m5=function(t){var e=t.h,n=t.s,s=t.v,o=t.a;e=e/360*6,n/=100,s/=100;var l=Math.floor(e),u=s*(1-n),f=s*(1-(e-l)*n),h=s*(1-(1-e+l)*n),p=l%6;return{r:255*[s,f,u,u,h,s][p],g:255*[h,s,s,f,u,u][p],b:255*[u,u,h,s,s,f][p],a:o}},VV=function(t){return{h:f5(t.h),s:lu(t.s,0,100),l:lu(t.l,0,100),a:lu(t.a)}},UV=function(t){return{h:_i(t.h),s:_i(t.s),l:_i(t.l),a:_i(t.a,3)}},PV=function(t){return m5((n=(e=t).s,{h:e.h,s:(n*=((s=e.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:e.a}));var e,n,s},D1=function(t){return{h:(e=h5(t)).h,s:(o=(200-(n=e.s))*(s=e.v)/100)>0&&o<200?n*s/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,n,s,o},Y7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,X7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,K7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,YT={string:[[function(t){var e=G7.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?_i(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?_i(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=X7.exec(t)||K7.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:MV({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=Y7.exec(t)||$7.exec(t);if(!e)return null;var n,s,o=VV({h:(n=e[1],s=e[2],s===void 0&&(s="deg"),Number(n)*(F7[s]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return PV(o)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,s=t.b,o=t.a,l=o===void 0?1:o;return Bf(e)&&Bf(n)&&Bf(s)?MV({r:Number(e),g:Number(n),b:Number(s),a:Number(l)}):null},"rgb"],[function(t){var e=t.h,n=t.s,s=t.l,o=t.a,l=o===void 0?1:o;if(!Bf(e)||!Bf(n)||!Bf(s))return null;var u=VV({h:Number(e),s:Number(n),l:Number(s),a:Number(l)});return PV(u)},"hsl"],[function(t){var e=t.h,n=t.s,s=t.v,o=t.a,l=o===void 0?1:o;if(!Bf(e)||!Bf(n)||!Bf(s))return null;var u=(function(f){return{h:f5(f.h),s:lu(f.s,0,100),v:lu(f.v,0,100),a:lu(f.a)}})({h:Number(e),s:Number(n),v:Number(s),a:Number(l)});return m5(u)},"hsv"]]},OV=function(t,e){for(var n=0;n<e.length;n++){var s=e[n][0](t);if(s)return[s,e[n][1]]}return[null,void 0]},W7=function(t){return typeof t=="string"?OV(t.trim(),YT.string):typeof t=="object"&&t!==null?OV(t,YT.object):[null,void 0]},mC=function(t,e){var n=D1(t);return{h:n.h,s:lu(n.s+100*e,0,100),l:n.l,a:n.a}},pC=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},zV=function(t,e){var n=D1(t);return{h:n.h,s:n.s,l:lu(n.l+100*e,0,100),a:n.a}},$T=(function(){function t(e){this.parsed=W7(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return _i(pC(this.rgba),2)},t.prototype.isDark=function(){return pC(this.rgba)<.5},t.prototype.isLight=function(){return pC(this.rgba)>=.5},t.prototype.toHex=function(){return e=hC(this.rgba),n=e.r,s=e.g,o=e.b,u=(l=e.a)<1?ON(_i(255*l)):"","#"+ON(n)+ON(s)+ON(o)+u;var e,n,s,o,l,u},t.prototype.toRgb=function(){return hC(this.rgba)},t.prototype.toRgbString=function(){return e=hC(this.rgba),n=e.r,s=e.g,o=e.b,(l=e.a)<1?"rgba("+n+", "+s+", "+o+", "+l+")":"rgb("+n+", "+s+", "+o+")";var e,n,s,o,l},t.prototype.toHsl=function(){return UV(D1(this.rgba))},t.prototype.toHslString=function(){return e=UV(D1(this.rgba)),n=e.h,s=e.s,o=e.l,(l=e.a)<1?"hsla("+n+", "+s+"%, "+o+"%, "+l+")":"hsl("+n+", "+s+"%, "+o+"%)";var e,n,s,o,l},t.prototype.toHsv=function(){return e=h5(this.rgba),{h:_i(e.h),s:_i(e.s),v:_i(e.v),a:_i(e.a,3)};var e},t.prototype.invert=function(){return ld({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),ld(mC(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),ld(mC(this.rgba,-e))},t.prototype.grayscale=function(){return ld(mC(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),ld(zV(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),ld(zV(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?ld({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):_i(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=D1(this.rgba);return typeof e=="number"?ld({h:e,s:n.s,l:n.l,a:n.a}):_i(n.h)},t.prototype.isEqual=function(e){return this.toHex()===ld(e).toHex()},t})(),ld=function(t){return t instanceof $T?t:new $T(t)},LV=[],Q7=function(t){t.forEach(function(e){LV.indexOf(e)<0&&(e($T,YT),LV.push(e))})};function Z7(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var o in n)s[n[o]]=o;var l={};t.prototype.toName=function(u){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var f,h,p=s[this.toHex()];if(p)return p;if(u!=null&&u.closest){var g=this.toRgb(),x=1/0,v="black";if(!l.length)for(var E in n)l[E]=new t(n[E]).toRgb();for(var S in n){var T=(f=g,h=l[S],Math.pow(f.r-h.r,2)+Math.pow(f.g-h.g,2)+Math.pow(f.b-h.b,2));T<x&&(x=T,v=S)}return v}},e.string.push([function(u){var f=u.toLowerCase(),h=f==="transparent"?"#0000":n[f];return h?new t(h).toRgb():null},"name"])}Q7([Z7]);const nv=class x1{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof x1)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,n){const s=typeof e;if(s!==typeof n)return!1;if(s==="number"||s==="string"||e instanceof Number)return e===n;if(Array.isArray(e)&&Array.isArray(n)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(n))return e.length!==n.length?!1:e.every((l,u)=>l===n[u]);if(e!==null&&n!==null){const l=Object.keys(e),u=Object.keys(n);return l.length!==u.length?!1:l.every(f=>e[f]===n[f])}return e===n}toRgba(){const[e,n,s,o]=this._components;return{r:e,g:n,b:s,a:o}}toRgb(){const[e,n,s]=this._components;return{r:e,g:n,b:s}}toRgbaString(){const[e,n,s]=this.toUint8RgbArray();return`rgba(${e},${n},${s},${this.alpha})`}toUint8RgbArray(e){const[n,s,o]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(n*255),e[1]=Math.round(s*255),e[2]=Math.round(o*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[n,s,o,l]=this._components;return e[0]=n,e[1]=s,e[2]=o,e[3]=l,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[n,s,o]=this._components;return e[0]=n,e[1]=s,e[2]=o,e}toNumber(){return this._int}toBgrNumber(){const[e,n,s]=this.toUint8RgbArray();return(s<<16)+(n<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[n,s,o,l]=x1._temp.setValue(e)._components;return this._components[0]*=n,this._components[1]*=s,this._components[2]*=o,this._components[3]*=l,this._refreshInt(),this._value=null,this}premultiply(e,n=!0){return n&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,n=!0){if(e===1)return(255<<24)+this._int;if(e===0)return n?0:this._int;let s=this._int>>16&255,o=this._int>>8&255,l=this._int&255;return n&&(s=s*e+.5|0,o=o*e+.5|0,l=l*e+.5|0),(e*255<<24)+(s<<16)+(o<<8)+l}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(e){let n,s,o,l;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const u=e;n=(u>>16&255)/255,s=(u>>8&255)/255,o=(u&255)/255,l=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[n,s,o,l=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[n,s,o,l=255]=e,n/=255,s/=255,o/=255,l/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const f=x1.HEX_PATTERN.exec(e);f&&(e=`#${f[2]}`)}const u=ld(e);u.isValid()&&({r:n,g:s,b:o,a:l}=u.rgba,n/=255,s/=255,o/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=s,this._components[2]=o,this._components[3]=l,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,n,s]=this._components;this._int=(e*255<<16)+(n*255<<8)+(s*255|0)}_clamp(e,n=0,s=1){return typeof e=="number"?Math.min(Math.max(e,n),s):(e.forEach((o,l)=>{e[l]=Math.min(Math.max(o,n),s)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof x1||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};nv.shared=new nv;nv._temp=new nv;nv.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let si=nv;const J7={cullArea:null,cullable:!1,cullableChildren:!0};let gC=0;const BV=500;function qo(...t){gC!==BV&&(gC++,gC===BV?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}const n_={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}};class eI{constructor(e,n){this._pool=[],this._count=0,this._index=0,this._classType=e,n&&this.prepopulate(n)}prepopulate(e){for(let n=0;n<e;n++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var s;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(s=n.init)==null||s.call(n,e),n}return(e){var n;(n=e.reset)==null||n.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class tI{constructor(){this._poolsByClass=new Map}prepopulate(e,n){this.getPool(e).prepopulate(n)}get(e,n){return this.getPool(e).get(n)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new eI(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(n=>{const s=e[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;e[s]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const pa=new tI;n_.register(pa);const nI={get isCachedAsTexture(){var t;return!!((t=this.renderGroup)!=null&&t.isCachedAsTexture)},cacheAsTexture(t){typeof t=="boolean"&&t===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(t===!0?{}:t))},updateCacheTexture(){var t;(t=this.renderGroup)==null||t.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){Ln("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};function rI(t,e,n){const s=t.length;let o;if(e>=s||n===0)return;n=e+n>s?s-e:n;const l=s-n;for(o=e;o<l;++o)t[o]=t[o+n];t.length=l}const sI={allowChildren:!0,removeChildren(t=0,e){var l;const n=e??this.children.length,s=n-t,o=[];if(s>0&&s<=n){for(let f=n-1;f>=t;f--){const h=this.children[f];h&&(o.push(h),h.parent=null)}rI(this.children,t,n);const u=this.renderGroup||this.parentRenderGroup;u&&u.removeChildren(o);for(let f=0;f<o.length;++f){const h=o[f];(l=h.parentRenderLayer)==null||l.detach(h),this.emit("childRemoved",h,this,f),o[f].emit("removed",this)}return o.length>0&&this._didViewChangeTick++,o}else if(s===0&&this.children.length===0)return o;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||Ln(ps,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(e<0||e>n.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);const s=t.parent===this;if(t.parent){const l=t.parent.children.indexOf(t);if(s){if(l===e)return t;t.parent.children.splice(l,1)}else t.removeFromParent()}e===n.length?n.push(t):n.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const o=this.renderGroup||this.parentRenderGroup;return o&&o.addChild(t),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const n=this.getChildIndex(t),s=this.getChildIndex(e);this.children[n]=e,this.children[s]=t;const o=this.renderGroup||this.parentRenderGroup;o&&(o.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)},reparentChild(...t){return t.length===1?this.reparentChildAt(t[0],this.children.length):(t.forEach(e=>this.reparentChildAt(e,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const n=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const s=this.worldTransform.clone();return s.invert(),n.prepend(s),t.setFromMatrix(n),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},iI={collectRenderables(t,e,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,n):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,n))},collectRenderablesSimple(t,e,n){const s=this.children,o=s.length;for(let l=0;l<o;l++)s[l].collectRenderables(t,e,n)},collectRenderablesWithEffects(t,e,n){const{renderPipes:s}=e;for(let o=0;o<this.effects.length;o++){const l=this.effects[o];s[l.pipe].push(l,this,t)}this.collectRenderablesSimple(t,e,n);for(let o=this.effects.length-1;o>=0;o--){const l=this.effects[o];s[l.pipe].pop(l,this,t)}}};class IV{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class oI{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const s=this._tests[n];if(s.test(e))return pa.get(s.maskClass,e)}return e}returnMaskEffect(e){pa.return(e)}}const XT=new oI;Zr.handleByList(hn.MaskEffect,XT._effectClasses);const aI={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){this.effects.indexOf(t)===-1&&(this.effects.push(t),this.effects.sort((n,s)=>n.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;(e==null?void 0:e.mask)!==t&&(e&&(this.removeEffect(e),XT.returnMaskEffect(e),this._maskEffect=null),t!=null&&(this._maskEffect=XT.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){var t;return(t=this._maskEffect)==null?void 0:t.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){var l;!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new IV);t=t;const n=(t==null?void 0:t.length)>0,s=((l=e.filters)==null?void 0:l.length)>0,o=n!==s;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),o&&(n?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){var t;return(t=this._filterEffect)==null?void 0:t.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new IV),this._filterEffect.filterArea=t},get filterArea(){var t;return(t=this._filterEffect)==null?void 0:t.filterArea}},lI={label:null,get name(){return Ln(ps,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){Ln(ps,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const n=this.children;for(let s=0;s<n.length;s++){const o=n[s];if(o.label===t||t instanceof RegExp&&t.test(o.label))return o}if(e)for(let s=0;s<n.length;s++){const l=n[s].getChildByLabel(t,!0);if(l)return l}return null},getChildrenByLabel(t,e=!1,n=[]){const s=this.children;for(let o=0;o<s.length;o++){const l=s[o];(l.label===t||t instanceof RegExp&&t.test(l.label))&&n.push(l)}if(e)for(let o=0;o<s.length;o++)s[o].getChildrenByLabel(t,!0,n);return n}},Ho=pa.getPool(Sn),Xf=pa.getPool(cu),uI=new Sn,cI={getFastGlobalBounds(t,e){e||(e=new cu),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(n.worldTransform),e},_getGlobalBoundsRecursive(t,e,n){let s=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const o=!!this.effects.length;if((this.renderGroup||o)&&(s=Xf.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const u=this.bounds;s.addFrame(u.minX,u.minY,u.maxX,u.maxY,this.groupTransform)}const l=this.children;for(let u=0;u<l.length;u++)l[u]._getGlobalBoundsRecursive(t,s,n)}if(o){let l=!1;const u=this.renderGroup||this.parentRenderGroup;for(let f=0;f<this.effects.length;f++)this.effects[f].addBounds&&(l||(l=!0,s.applyMatrix(u.worldTransform)),this.effects[f].addBounds(s,!0));l&&s.applyMatrix(u.worldTransform.copyTo(uI).invert()),e.addBounds(s),Xf.return(s)}else this.renderGroup&&(e.addBounds(s,this.relativeGroupTransform),Xf.return(s))}};function p5(t,e,n){n.clear();let s,o;return t.parent?e?s=t.parent.worldTransform:(o=Ho.get().identity(),s=JR(t,o)):s=Sn.IDENTITY,g5(t,n,s,e),o&&Ho.return(o),n.isValid||n.set(0,0,0,0),n}function g5(t,e,n,s){var f,h;if(!t.visible||!t.measurable)return;let o;s?o=t.worldTransform:(t.updateLocalTransform(),o=Ho.get(),o.appendFrom(t.localTransform,n));const l=e,u=!!t.effects.length;if(u&&(e=Xf.get().clear()),t.boundsArea)e.addRect(t.boundsArea,o);else{const p=t.bounds;p&&!p.isEmpty()&&(e.matrix=o,e.addBounds(p));for(let g=0;g<t.children.length;g++)g5(t.children[g],e,o,s)}if(u){for(let p=0;p<t.effects.length;p++)(h=(f=t.effects[p]).addBounds)==null||h.call(f,e);l.addBounds(e,Sn.IDENTITY),Xf.return(e)}s||Ho.return(o)}function JR(t,e){const n=t.parent;return n&&(JR(n,e),n.updateLocalTransform(),e.append(n.localTransform)),e}function b5(t,e){if(t===16777215||!e)return e;if(e===16777215||!t)return t;const n=t>>16&255,s=t>>8&255,o=t&255,l=e>>16&255,u=e>>8&255,f=e&255,h=n*l/255|0,p=s*u/255|0,g=o*f/255|0;return(h<<16)+(p<<8)+g}const HV=16777215;function qV(t,e){return t===HV?e:e===HV?t:b5(t,e)}function ES(t){return((t&255)<<16)+(t&65280)+(t>>16&255)}const dI={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,n=this.parent;for(;n;)e*=n.alpha,n=n.parent;return e},getGlobalTransform(t=new Sn,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const n=JR(this,Ho.get().identity());return t.appendFrom(this.localTransform,n),Ho.return(n),t},getGlobalTint(t){if(t)return this.renderGroup?ES(this.renderGroup.worldColor):this.parentRenderGroup?ES(qV(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,n=this.parent;for(;n;)e=qV(e,n.localColor),n=n.parent;return ES(e)}};function x5(t,e,n){return e.clear(),n||(n=Sn.IDENTITY),y5(t,e,n,t,!0),e.isValid||e.set(0,0,0,0),e}function y5(t,e,n,s,o){var h,p;let l;if(o)l=Ho.get(),l=n.copyTo(l);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const g=t.localTransform;l=Ho.get(),l.appendFrom(g,n)}const u=e,f=!!t.effects.length;if(f&&(e=Xf.get().clear()),t.boundsArea)e.addRect(t.boundsArea,l);else{t.renderPipeId&&(e.matrix=l,e.addBounds(t.bounds));const g=t.children;for(let x=0;x<g.length;x++)y5(g[x],e,l,s,!1)}if(f){for(let g=0;g<t.effects.length;g++)(p=(h=t.effects[g]).addLocalBounds)==null||p.call(h,e,s);u.addBounds(e,Sn.IDENTITY),Xf.return(e)}Ho.return(l)}function v5(t,e){const n=t.children;for(let s=0;s<n.length;s++){const o=n[s],l=o.uid,u=(o._didViewChangeTick&65535)<<16|o._didContainerChangeTick&65535,f=e.index;(e.data[f]!==l||e.data[f+1]!==u)&&(e.data[e.index]=l,e.data[e.index+1]=u,e.didChange=!0),e.index=f+2,o.children.length&&v5(o,e)}return e.didChange}const fI=new Sn,hI={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const n=Math.sign(this.scale.x)||1;e!==0?this.scale.x=t/e*n:this.scale.x=n},_setHeight(t,e){const n=Math.sign(this.scale.y)||1;e!==0?this.scale.y=t/e*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new cu});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),v5(this,t),t.didChange&&x5(this,t.localBounds,fI),t.localBounds},getBounds(t,e){return p5(this,t,e||new cu)}},mI={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},pI={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(gI))}};function gI(t,e){return t._zIndex-e._zIndex}const bI={getGlobalPosition(t=new ao,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,n=!1){const s=this.getGlobalTransform(Ho.get(),n);return e=s.apply(t,e),Ho.return(s),e},toLocal(t,e,n,s){e&&(t=e.toGlobal(t,n,s));const o=this.getGlobalTransform(Ho.get(),s);return n=o.applyInverse(t,n),Ho.return(o),n}};class ej{constructor(){this.uid=gs("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let xI=0;class yI{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new tv(this.textureOptions)}createTexture(e,n,s,o){const l=new du({...this.textureOptions,width:e,height:n,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:o});return new ur({source:l,label:`texturePool_${xI++}`})}getOptimalTexture(e,n,s=1,o,l=!1){let u=Math.ceil(e*s-1e-6),f=Math.ceil(n*s-1e-6);u=ev(u),f=ev(f);const h=o?1:0,p=l?1:0,g=(u<<17)+(f<<2)+(p<<1)+h;this._texturePool[g]||(this._texturePool[g]=[]);let x=this._texturePool[g].pop();return x||(x=this.createTexture(u,f,o,l)),x.source._resolution=s,x.source.width=u/s,x.source.height=f/s,x.source.pixelWidth=u,x.source.pixelHeight=f,x.frame.x=0,x.frame.y=0,x.frame.width=e,x.frame.height=n,x.updateUvs(),this._poolKeyHash[x.uid]=g,x}getSameSizeTexture(e,n=!1){const s=e.source;return this.getOptimalTexture(e.width,e.height,s._resolution,n)}returnTexture(e,n=!1){const s=this._poolKeyHash[e.uid];n&&(e.source.style=this.textureStyle),this._texturePool[s].push(e)}clear(e){if(e=e!==!1,e)for(const n in this._texturePool){const s=this._texturePool[n];if(s)for(let o=0;o<s.length;o++)s[o].destroy(!0)}this._texturePool={}}}const iD=new yI;n_.register(iD);class vI{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Sn,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new ej,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const n=e.children;for(let s=0;s<n.length;s++){const o=n[s];o._updateFlags=15,this.addChild(o)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(iD.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const n=this.childrenToUpdate[e];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const n=this.renderGroupChildren.indexOf(e);n>-1&&this.renderGroupChildren.splice(n,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const n=e.children;for(let s=0;s<n.length;s++)this.addChild(n[s])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const n=e.children;for(let s=0;s<n.length;s++)this.removeChild(n[s])}removeChildren(e){for(let n=0;n<e.length;n++)this.removeChild(e[n])}onChildUpdate(e){let n=this.childrenToUpdate[e.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const n=this.root.children;for(let s=0;s<n.length;s++)this._getChildren(n[s],e);return e}_getChildren(e,n=[]){if(n.push(e),e.renderGroup)return n;const s=e.children;for(let o=0;o<s.length;o++)this._getChildren(s[o],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Sn),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Sn),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Sn),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function EI(t,e,n={}){for(const s in e)!n[s]&&e[s]!==void 0&&(t[s]=e[s])}const bC=new Ui(null),zN=new Ui(null),xC=new Ui(null,1,1),LN=new Ui(null),FV=1,_I=2,yC=4;class Pi extends bd{constructor(e={}){var n,s;super(),this.uid=gs("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new Sn,this.relativeGroupTransform=new Sn,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Ui(this,0,0),this._scale=xC,this._pivot=zN,this._origin=LN,this._skew=bC,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],EI(this,e,{children:!0,parent:!0,effects:!0}),(n=e.children)==null||n.forEach(o=>this.addChild(o)),(s=e.parent)==null||s.addChild(this)}static mixin(e){Ln("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Zr.mixin(Pi,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||Ln(ps,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let o=0;o<e.length;o++)this.addChild(e[o]);return e[0]}const n=e[0],s=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),s&&(s.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,s&&s.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let o=0;o<e.length;o++)this.removeChild(e[o]);return e[0]}const n=e[0],s=this.children.indexOf(n);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,s),n.emit("removed",this)),n}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=pa.get(vI,this),this.groupTransform=Sn.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),pa.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Sn),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*P7}set angle(e){this.rotation=e*O7}get pivot(){return this._pivot===zN&&(this._pivot=new Ui(this,0,0)),this._pivot}set pivot(e){this._pivot===zN&&(this._pivot=new Ui(this,0,0),this._origin!==LN&&qo("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===bC&&(this._skew=new Ui(this,0,0)),this._skew}set skew(e){this._skew===bC&&(this._skew=new Ui(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===xC&&(this._scale=new Ui(this,1,1)),this._scale}set scale(e){this._scale===xC&&(this._scale=new Ui(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===LN&&(this._origin=new Ui(this,0,0)),this._origin}set origin(e){this._origin===LN&&(this._origin=new Ui(this,0,0),this._pivot!==zN&&qo("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const n=this.getLocalBounds().width;this._setWidth(e,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const n=this.getLocalBounds().height;this._setHeight(e,n)}getSize(e){e||(e={});const n=this.getLocalBounds();return e.width=Math.abs(this.scale.x*n.width),e.height=Math.abs(this.scale.y*n.height),e}setSize(e,n){const s=this.getLocalBounds();typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,s.width),n!==void 0&&this._setHeight(n,s.height)}_updateSkew(){const e=this._rotation,n=this._skew;this._cx=Math.cos(e+n._y),this._sx=Math.sin(e+n._y),this._cy=-Math.sin(e-n._x),this._sy=Math.cos(e-n._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const n=this.localTransform,s=this._scale,o=this._pivot,l=this._origin,u=this._position,f=s._x,h=s._y,p=o._x,g=o._y,x=-l._x,v=-l._y;n.a=this._cx*f,n.b=this._sx*f,n.c=this._cy*h,n.d=this._sy*h,n.tx=u._x-(p*n.a+g*n.c)+(x*n.a+v*n.c)-x,n.ty=u._y-(p*n.b+g*n.d)+(x*n.b+v*n.d)-v}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=FV,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const s=si.shared.setValue(e??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=FV,this._onUpdate())}get tint(){return ES(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=_I,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const n=e?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yC,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const n=e?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=yC,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const n=e?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=yC,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var o;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e==null?void 0:e.children)&&n)for(let l=0;l<n.length;++l)n[l].destroy(e);(o=this.renderGroup)==null||o.destroy(),this.renderGroup=null}}Zr.mixin(Pi,sI,cI,bI,mI,hI,aI,lI,pI,J7,nI,dI,iI);class tj extends Pi{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new cu(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const n=this.bounds,{x:s,y:o}=e;return s>=n.minX&&s<=n.maxX&&o>=n.minY&&o<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,n,s){const{renderPipes:o}=n;o.blendMode.pushBlendMode(this,this.groupBlendMode,e);const u=o[this.renderPipeId];u!=null&&u.addRenderable&&u.addRenderable(this,e),this.didViewUpdate=!1;const f=this.children,h=f.length;for(let p=0;p<h;p++)f[p].collectRenderables(e,n,s);o.blendMode.popBlendMode(e)}}class rv extends tj{constructor(e=ur.EMPTY){e instanceof ur&&(e={texture:e});const{texture:n=ur.EMPTY,anchor:s,roundPixels:o,width:l,height:u,...f}=e;super({label:"Sprite",...f}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Ui({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=o??!1,l!==void 0&&(this.width=l),u!==void 0&&(this.height=u)}static from(e,n=!1){return e instanceof ur?new rv(e):new rv(ur.from(e,n))}set texture(e){e||(e=ur.EMPTY);const n=this._texture;n!==e&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return d5(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return Ln("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,n=this._texture,s=this._bounds,{width:o,height:l}=n.orig;s.minX=-e._x*o,s.maxX=s.minX+o,s.minY=-e._y*l,s.maxY=s.minY+l}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const s=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const wI=new cu;function E5(t,e,n){const s=wI;t.measurable=!0,p5(t,n,s),e.addBoundsMask(s),t.measurable=!1}function _5(t,e,n){const s=Xf.get();t.measurable=!0;const o=Ho.get().identity(),l=w5(t,n,o);x5(t,s,l),t.measurable=!1,e.addBoundsMask(s),Ho.return(o),Xf.return(s)}function w5(t,e,n){return t?(t!==e&&(w5(t.parent,e,n),t.updateLocalTransform(),n.append(t.localTransform)),n):(qo("Mask bounds, renderable is not inside the root container"),n)}class N5{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof rv),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,n){this.inverse||E5(this.mask,e,n)}addLocalBounds(e,n){_5(this.mask,e,n)}containsPoint(e,n){const s=this.mask;return n(s,e)}destroy(){this.reset()}static test(e){return e instanceof rv}}N5.extension=hn.MaskEffect;class S5{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}S5.extension=hn.MaskEffect;class D5{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,n){E5(this.mask,e,n)}addLocalBounds(e,n){_5(this.mask,e,n)}containsPoint(e,n){const s=this.mask;return n(s,e)}destroy(){this.reset()}static test(e){return e instanceof Pi}}D5.extension=hn.MaskEffect;const NI={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};let GV=NI;const ul={get(){return GV},set(t){GV=t}};class A5 extends du{constructor(e){e.resource||(e.resource=ul.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,n=this.height,s=this._resolution){const o=super.resize(e,n,s);return o&&this.resizeCanvas(),o}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}A5.extension=hn.TextureSource;class kS extends du{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}kS.extension=hn.TextureSource;var MS=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(MS||{});class vC{constructor(e,n=null,s=0,o=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=n,this.priority=s,this._once=o}match(e,n=null){return this._fn===e&&this._context===n}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=e?null:n,this.previous=null,n}}const C5=class sl{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new vC(null,null,1/0),this.deltaMS=1/sl.targetFPMS,this.elapsedMS=1/sl.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,n,s=MS.NORMAL){return this._addListener(new vC(e,n,s))}addOnce(e,n,s=MS.NORMAL){return this._addListener(new vC(e,n,s,!0))}_addListener(e){let n=this._head.next,s=this._head;if(!n)e.connect(s);else{for(;n;){if(e.priority>n.priority){e.connect(s);break}s=n,n=n.next}e.previous||e.connect(s)}return this._startIfPossible(),this}remove(e,n){let s=this._head.next;for(;s;)s.match(e,n)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,n=this._head;for(;n=n.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let n;if(e>this.lastTime){if(n=this.elapsedMS=e-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const l=e-this._lastFrame|0;if(l<this._minElapsedMS)return;this._lastFrame=e-l%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*sl.targetFPMS;const s=this._head;let o=s.next;for(;o;)o=o.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const n=Math.min(Math.max(0,e)/1e3,sl.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!sl._shared){const e=sl._shared=new sl;e.autoStart=!0,e._protected=!0}return sl._shared}static get system(){if(!sl._system){const e=sl._system=new sl;e.autoStart=!0,e._protected=!0}return sl._system}};C5.targetFPMS=.06;let Fy=C5,EC;async function SI(){return EC??(EC=(async()=>{var u;const e=ul.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const n=await new Promise(f=>{const h=document.createElement("video");h.onloadeddata=()=>f(h),h.onerror=()=>f(null),h.autoplay=!1,h.crossOrigin="anonymous",h.preload="auto",h.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",h.load()});if(!n)return"premultiply-alpha-on-upload";const s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n);const l=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,l),e.deleteFramebuffer(o),e.deleteTexture(s),(u=e.getExtension("WEBGL_lose_context"))==null||u.loseContext(),l[0]<=l[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),EC}const oD=class T5 extends du{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...T5.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=Fy.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,n=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await SI(),this._load=new Promise((s,o)=>{this.isValid?s(this):(this._resolve=s,this._reject=o,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Fy.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Fy.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Fy.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};oD.extension=hn.TextureSource;oD.defaultOptions={...du.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};oD.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let DI=oD;const Oy=(t,e,n=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(s=>typeof s=="string"||n?e(s):s):t);class AI{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const n=this._cache.get(e);return n||qo(`[Assets] Asset id ${e} was not found in the Cache`),n}set(e,n){const s=Oy(e);let o;for(let h=0;h<this.parsers.length;h++){const p=this.parsers[h];if(p.test(n)){o=p.getCacheableAssets(s,n);break}}const l=new Map(Object.entries(o||{}));o||s.forEach(h=>{l.set(h,n)});const u=[...l.keys()],f={cacheKeys:u,keys:s};s.forEach(h=>{this._cacheMap.set(h,f)}),u.forEach(h=>{const p=o?o[h]:n;this._cache.has(h)&&this._cache.get(h)!==p&&qo("[Cache] already has key:",h),this._cache.set(h,l.get(h))})}remove(e){if(!this._cacheMap.has(e)){qo(`[Assets] Asset id ${e} was not found in the Cache`);return}const n=this._cacheMap.get(e);n.cacheKeys.forEach(o=>{this._cache.delete(o)}),n.keys.forEach(o=>{this._cacheMap.delete(o)})}get parsers(){return this._parsers}}const zy=new AI,KT=[];Zr.handleByList(hn.TextureSource,KT);function R5(t={}){const e=t&&t.resource,n=e?t.resource:t,s=e?t:{resource:t};for(let o=0;o<KT.length;o++){const l=KT[o];if(l.test(n))return new l(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function CI(t={},e=!1){const n=t&&t.resource,s=n?t.resource:t,o=n?t:{resource:t};if(!e&&zy.has(s))return zy.get(s);const l=new ur({source:R5(o)});return l.on("destroy",()=>{zy.has(s)&&zy.remove(s)}),e||zy.set(s,l),l}function TI(t,e=!1){return typeof t=="string"?zy.get(t):t instanceof du?new ur({source:t}):CI(t,e)}ur.from=TI;du.from=R5;Zr.add(N5,S5,D5,DI,kS,A5,ZR);var j5=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(j5||{});function uc(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function e1(t){return t.split("?")[0].split("#")[0]}function RI(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jI(t,e,n){return t.replace(new RegExp(RI(e),"g"),n)}function kI(t,e){let n="",s=0,o=-1,l=0,u=-1;for(let f=0;f<=t.length;++f){if(f<t.length)u=t.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(o===f-1||l===1))if(o!==f-1&&l===2){if(n.length<2||s!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const h=n.lastIndexOf("/");if(h!==n.length-1){h===-1?(n="",s=0):(n=n.slice(0,h),s=n.length-1-n.lastIndexOf("/")),o=f,l=0;continue}}else if(n.length===2||n.length===1){n="",s=0,o=f,l=0;continue}}}else n.length>0?n+=`/${t.slice(o+1,f)}`:n=t.slice(o+1,f),s=f-o-1;o=f,l=0}else u===46&&l!==-1?++l:l=-1}return n}const P1={toPosix(t){return jI(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){uc(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const n=/^[^/:]+:\/{0,2}/.exec(t);return n?n[0]:""},toAbsolute(t,e,n){if(uc(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const s=e1(this.toPosix(e??ul.get().getBaseUrl())),o=e1(this.toPosix(n??this.rootname(s)));return t=this.toPosix(t),t.startsWith("/")?P1.join(o,t.slice(1)):this.isAbsolute(t)?t:this.join(s,t)},normalize(t){if(uc(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const n=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const s=t.endsWith("/");return t=kI(t),t.length>0&&s&&(t+="/"),n?`/${t}`:e+t},isAbsolute(t){return uc(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let n=0;n<t.length;++n){const s=t[n];if(uc(s),s.length>0)if(e===void 0)e=s;else{const o=t[n-1]??"";this.joinExtensions.includes(this.extname(o).toLowerCase())?e+=`/../${s}`:e+=`/${s}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(uc(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const n=e===47;let s=-1,o=!0;const l=this.getProtocol(t),u=t;t=t.slice(l.length);for(let f=t.length-1;f>=1;--f)if(e=t.charCodeAt(f),e===47){if(!o){s=f;break}}else o=!1;return s===-1?n?"/":this.isUrl(u)?l+t:l:n&&s===1?"//":l+t.slice(0,s)},rootname(t){uc(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const n=t.indexOf("/",e.length);n!==-1?e=t.slice(0,n):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){uc(t),e&&uc(e),t=e1(this.toPosix(t));let n=0,s=-1,o=!0,l;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let u=e.length-1,f=-1;for(l=t.length-1;l>=0;--l){const h=t.charCodeAt(l);if(h===47){if(!o){n=l+1;break}}else f===-1&&(o=!1,f=l+1),u>=0&&(h===e.charCodeAt(u)?--u===-1&&(s=l):(u=-1,s=f))}return n===s?s=f:s===-1&&(s=t.length),t.slice(n,s)}for(l=t.length-1;l>=0;--l)if(t.charCodeAt(l)===47){if(!o){n=l+1;break}}else s===-1&&(o=!1,s=l+1);return s===-1?"":t.slice(n,s)},extname(t){uc(t),t=e1(this.toPosix(t));let e=-1,n=0,s=-1,o=!0,l=0;for(let u=t.length-1;u>=0;--u){const f=t.charCodeAt(u);if(f===47){if(!o){n=u+1;break}continue}s===-1&&(o=!1,s=u+1),f===46?e===-1?e=u:l!==1&&(l=1):e!==-1&&(l=-1)}return e===-1||s===-1||l===0||l===1&&e===s-1&&e===n+1?"":t.slice(e,s)},parse(t){uc(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=e1(this.toPosix(t));let n=t.charCodeAt(0);const s=this.isAbsolute(t);let o;e.root=this.rootname(t),s||this.hasProtocol(t)?o=1:o=0;let l=-1,u=0,f=-1,h=!0,p=t.length-1,g=0;for(;p>=o;--p){if(n=t.charCodeAt(p),n===47){if(!h){u=p+1;break}continue}f===-1&&(h=!1,f=p+1),n===46?l===-1?l=p:g!==1&&(g=1):l!==-1&&(g=-1)}return l===-1||f===-1||g===0||g===1&&l===f-1&&l===u+1?f!==-1&&(u===0&&s?e.base=e.name=t.slice(1,f):e.base=e.name=t.slice(u,f)):(u===0&&s?(e.name=t.slice(1,l),e.base=t.slice(1,f)):(e.name=t.slice(u,l),e.base=t.slice(u,f)),e.ext=t.slice(l,f)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function k5(t,e,n,s,o){const l=e[n];for(let u=0;u<l.length;u++){const f=l[u];n<e.length-1?k5(t.replace(s[n],f),e,n+1,s,o):o.push(t.replace(s[n],f))}}function MI(t){const e=/\{(.*?)\}/g,n=t.match(e),s=[];if(n){const o=[];n.forEach(l=>{const u=l.substring(1,l.length-1).split(",");o.push(u)}),k5(t,o,0,n,s)}else s.push(t);return s}const YV=t=>!Array.isArray(t);class M5{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,n)=>`${e}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(e,n)=>n.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const n=e;this._defaultSearchParams=Object.keys(n).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(n[s])}`).join("&")}}getAlias(e){const{alias:n,src:s}=e;return Oy(n||s,l=>typeof l=="string"?l:Array.isArray(l)?l.map(u=>(u==null?void 0:u.src)??u):l!=null&&l.src?l.src:l,!0)}removeAlias(e,n){this._assetMap[e]&&(n&&n!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&qo("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(e,n){const s=[];let o=n;Array.isArray(n)||(o=Object.entries(n).map(([l,u])=>typeof u=="string"||Array.isArray(u)?{alias:l,src:u}:{alias:l,...u})),o.forEach(l=>{const u=l.src,f=l.alias;let h;if(typeof f=="string"){const p=this._createBundleAssetId(e,f);s.push(p),h=[f,p]}else{const p=f.map(g=>this._createBundleAssetId(e,g));s.push(...p),h=[...f,...p]}this.add({...l,alias:h,src:u})}),this._bundles[e]=s}add(e){const n=[];Array.isArray(e)?n.push(...e):n.push(e);let s;s=l=>{this.hasKey(l)&&qo(`[Resolver] already has key: ${l} overwriting`)},Oy(n).forEach(l=>{const{src:u}=l;let{data:f,format:h,loadParser:p,parser:g}=l;const x=Oy(u).map(T=>typeof T=="string"?MI(T):Array.isArray(T)?T:[T]),v=this.getAlias(l);Array.isArray(v)?v.forEach(s):s(v);const E=[],S=T=>{const D=this._parsers.find(A=>A.test(T));return{src:T,...D==null?void 0:D.parse(T)}};x.forEach(T=>{T.forEach(D=>{let A={};if(typeof D!="object"?A=S(D):(f=D.data??f,h=D.format??h,(D.loadParser||D.parser)&&(p=D.loadParser??p,g=D.parser??g),A={...S(D.src),...D}),!v)throw new Error(`[Resolver] alias is undefined for this asset: ${A.src}`);A=this._buildResolvedAsset(A,{aliases:v,data:f,format:h,loadParser:p,parser:g,progressSize:l.progressSize}),E.push(A)})}),v.forEach(T=>{this._assetMap[T]=E})})}resolveBundle(e){const n=YV(e);e=Oy(e);const s={};return e.forEach(o=>{const l=this._bundles[o];if(l){const u=this.resolve(l),f={};for(const h in u){const p=u[h];f[this._extractAssetIdFromBundle(o,h)]=p}s[o]=f}}),n?s[e[0]]:s}resolveUrl(e){const n=this.resolve(e);if(typeof e!="string"){const s={};for(const o in n)s[o]=n[o].src;return s}return n.src}resolve(e){const n=YV(e);e=Oy(e);const s={};return e.forEach(o=>{if(!this._resolverHash[o])if(this._assetMap[o]){let l=this._assetMap[o];const u=this._getPreferredOrder(l);u==null||u.priority.forEach(f=>{u.params[f].forEach(h=>{const p=l.filter(g=>g[f]?g[f]===h:!1);p.length&&(l=p)})}),this._resolverHash[o]=l[0]}else this._resolverHash[o]=this._buildResolvedAsset({alias:[o],src:o},{});s[o]=this._resolverHash[o]}),n?s[e[0]]:s}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let n=0;n<e.length;n++){const s=e[n],o=this._preferredOrder.find(l=>l.params.format.includes(s.format));if(o)return o}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const n=/\?/.test(e)?"&":"?";return`${e}${n}${this._defaultSearchParams}`}_buildResolvedAsset(e,n){const{aliases:s,data:o,loadParser:l,parser:u,format:f,progressSize:h}=n;return(this._basePath||this._rootPath)&&(e.src=P1.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=s??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...o||{},...e.data},e.loadParser=l??e.loadParser,e.parser=u??e.parser,e.format=f??e.format??VI(e.src),h!==void 0&&(e.progressSize=h),e}}M5.RETINA_PREFIX=/@([0-9\.]+)x/;function VI(t){return t.split(".").pop().split("?").shift().split("#").shift()}const $V=(t,e)=>{const n=e.split("?")[1];return n&&(t+=`?${n}`),t},V5=class y1{constructor(e,n){this.linkedSheets=[];let s=e;(e==null?void 0:e.source)instanceof du&&(s={texture:e,data:n});const{texture:o,data:l,cachePrefix:u=""}=s;this.cachePrefix=u,this._texture=o instanceof ur?o:null,this.textureSource=o.source,this.textures={},this.animations={},this.data=l;const f=parseFloat(l.meta.scale);f?(this.resolution=f,o.source.resolution=this.resolution):this.resolution=o.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=y1.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,n=!1){let s=e;const o=n?1/0:y1.BATCH_SIZE;for(;s-e<o&&s<this._frameKeys.length;){const l=this._frameKeys[s],u=this._frames[l],f=u.frame;if(f){let h=null,p=null;const g=u.trimmed!==!1&&u.sourceSize?u.sourceSize:u.frame,x=new ws(0,0,Math.floor(g.w)/this.resolution,Math.floor(g.h)/this.resolution);u.rotated?h=new ws(Math.floor(f.x)/this.resolution,Math.floor(f.y)/this.resolution,Math.floor(f.h)/this.resolution,Math.floor(f.w)/this.resolution):h=new ws(Math.floor(f.x)/this.resolution,Math.floor(f.y)/this.resolution,Math.floor(f.w)/this.resolution,Math.floor(f.h)/this.resolution),u.trimmed!==!1&&u.spriteSourceSize&&(p=new ws(Math.floor(u.spriteSourceSize.x)/this.resolution,Math.floor(u.spriteSourceSize.y)/this.resolution,Math.floor(f.w)/this.resolution,Math.floor(f.h)/this.resolution)),this.textures[l]=new ur({source:this.textureSource,frame:h,orig:x,trim:p,rotate:u.rotated?2:0,defaultAnchor:u.anchor,defaultBorders:u.borders,label:l.toString()})}s++}}_processAnimations(){const e=this.data.animations||{};for(const n in e){this.animations[n]=[];for(let s=0;s<e[n].length;s++){const o=e[n][s];this.animations[n].push(this.textures[o])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*y1.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*y1.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var n;for(const s in this.textures)this.textures[s].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};V5.BATCH_SIZE=1e3;let XV=V5;const UI=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function U5(t,e,n){const s={};if(t.forEach(o=>{s[o]=e}),Object.keys(e.textures).forEach(o=>{s[`${e.cachePrefix}${o}`]=e.textures[o]}),!n){const o=P1.dirname(t[0]);e.linkedSheets.forEach((l,u)=>{const f=U5([`${o}/${e.data.meta.related_multi_packs[u]}`],l,!0);Object.assign(s,f)})}return s}const PI={extension:hn.Asset,cache:{test:t=>t instanceof XV,getCacheableAssets:(t,e)=>U5(t,e,!1)},resolver:{extension:{type:hn.ResolveParser,name:"resolveSpritesheet"},test:t=>{const n=t.split("?")[0].split("."),s=n.pop(),o=n.pop();return s==="json"&&UI.includes(o)},parse:t=>{var n;const e=t.split(".");return{resolution:parseFloat(((n=M5.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:hn.LoadParser,priority:j5.Normal,name:"spritesheetLoader"},async testParse(t,e){return P1.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,n){var x,v;const{texture:s,imageFilename:o,textureOptions:l,cachePrefix:u}=(e==null?void 0:e.data)??{};let f=P1.dirname(e.src);f&&f.lastIndexOf("/")!==f.length-1&&(f+="/");let h;if(s instanceof ur)h=s;else{const E=$V(f+(o??t.meta.image),e.src);h=(await n.load([{src:E,data:l}]))[E]}const p=new XV({texture:h.source,data:t,cachePrefix:u});await p.parse();const g=(x=t==null?void 0:t.meta)==null?void 0:x.related_multi_packs;if(Array.isArray(g)){const E=[];for(const T of g){if(typeof T!="string")continue;let D=f+T;(v=e.data)!=null&&v.ignoreMultiPack||(D=$V(D,e.src),E.push(n.load({src:D,data:{textureOptions:l,ignoreMultiPack:!0}})))}const S=await Promise.all(E);p.linkedSheets=S,S.forEach(T=>{T.linkedSheets=[p].concat(p.linkedSheets.filter(D=>D!==T))})}return p},async unload(t,e,n){await n.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};Zr.add(PI);const _C=Object.create(null),KV=Object.create(null);function nj(t,e){let n=KV[t];return n===void 0&&(_C[e]===void 0&&(_C[e]=1),KV[t]=n=_C[e]++),n}let Cy;function P5(){return(!Cy||Cy!=null&&Cy.isContextLost())&&(Cy=ul.get().createCanvas().getContext("webgl",{})),Cy}let BN;function OI(){if(!BN){BN="mediump";const t=P5();t&&t.getShaderPrecisionFormat&&(BN=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return BN}function zI(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
@@ -320,7 +320,7 @@ Deprecated since v${t}`,l=typeof console.groupCollapsed=="function"&&!qy.noColor
320
320
  `}function LI(t,e,n){const s=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let o=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;return o==="highp"&&s!=="highp"&&(o="mediump"),`precision ${o} float;
321
321
  ${t}`}else if(s!=="highp"&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}function BI(t,e){return e?`#version 300 es
322
322
  ${t}`:t}const II={},HI={};function qI(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const s=n?II:HI;return s[e]?(s[e]++,e+=`-${s[e]}`):s[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
323
- ${t}`}function FI(t,e){return e?t.replace("#version 300 es",""):t}const wC={stripVersion:FI,ensurePrecision:LI,addProgramDefines:zI,setProgramName:qI,insertVersion:BI},t1=Object.create(null),O5=class WT{constructor(e){e={...WT.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:OI()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let o=e.fragment,l=e.vertex;Object.keys(wC).forEach(u=>{const f=s[u];o=wC[u](o,f,!0),l=wC[u](l,f,!1)}),this.fragment=o,this.vertex=l,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=nj(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,t1[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return t1[n]||(t1[n]=new WT(e),t1[n]._cacheKey=n),t1[n]}};O5.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let rj=O5;const WV={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function GI(t){return WV[t]??WV.float32}const YI={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},QV=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function ZV(t,e){let n;for(;(n=QV.exec(t))!==null;){const s=YI[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:s,stride:GI(s).stride,offset:0,instance:!1,start:0}}QV.lastIndex=0}function $I(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function XI({source:t,entryPoint:e}){const n={},s=$I(t),o=s.indexOf(`fn ${e}(`);if(o===-1)return n;const l=s.indexOf("->",o);if(l===-1)return n;const u=s.substring(o,l);if(ZV(u,n),Object.keys(n).length===0){const f=u.match(/\(\s*\w+\s*:\s*(\w+)/);if(f){const h=f[1],p=new RegExp(`struct\\s+${h}\\s*\\{([^}]+)\\}`,"s"),g=s.match(p);g&&ZV(g[1],n)}}return n}function NC(t){var x,v;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,l=/:\s*([\w<>]+)/,u=/struct\s+(\w+)\s*{([^}]+)}/g,f=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,p=(x=t.match(e))==null?void 0:x.map(E=>({group:parseInt(E.match(n)[1],10),binding:parseInt(E.match(s)[1],10),name:E.match(o)[2],isUniform:E.match(o)[1]==="<uniform>",type:E.match(l)[1]}));if(!p)return{groups:[],structs:[]};const g=((v=t.match(u))==null?void 0:v.map(E=>{const S=E.match(h)[1],T=E.match(f).reduce((D,A)=>{const[M,j]=A.split(":");return D[M.trim()]=j.trim(),D},{});return T?{name:S,members:T}:null}).filter(({name:E})=>p.some(S=>S.type===E||S.type.includes(`<${E}>`))))??[];return{groups:p,structs:g}}var Fg=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Fg||{});function KI({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]=[]),s.isUniform?e[s.group].push({binding:s.binding,visibility:Fg.VERTEX|Fg.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function WI({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]={}),e[s.group][s.name]=s.binding}return e}function QI(t,e){const n=new Set,s=new Set,o=[...t.structs,...e.structs].filter(u=>n.has(u.name)?!1:(n.add(u.name),!0)),l=[...t.groups,...e.groups].filter(u=>{const f=`${u.name}-${u.binding}`;return s.has(f)?!1:(s.add(f),!0)});return{structs:o,groups:l}}const n1=Object.create(null);class r_{constructor(e){var f,h;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:s,layout:o,gpuLayout:l,name:u}=e;if(this.name=u,this.fragment=n,this.vertex=s,n.source===s.source){const p=NC(n.source);this.structsAndGroups=p}else{const p=NC(s.source),g=NC(n.source);this.structsAndGroups=QI(p,g)}this.layout=o??WI(this.structsAndGroups),this.gpuLayout=l??KI(this.structsAndGroups),this.autoAssignGlobalUniforms=((f=this.layout[0])==null?void 0:f.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((h=this.layout[1])==null?void 0:h.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,s=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=nj(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=XI(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,n1[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return n1[n]||(n1[n]=new r_(e),n1[n]._cacheKey=n),n1[n]}}const z5=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],ZI=z5.reduce((t,e)=>(t[e]=!0,t),{});function JI(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const L5=class B5{constructor(e,n){this._touched=0,this.uid=gs("uniform"),this._resourceType="uniformGroup",this._resourceId=gs("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...B5.defaultOptions,...n},this.uniformStructures=e;const s={};for(const o in e){const l=e[o];if(l.name=o,l.size=l.size??1,!ZI[l.type]){const u=l.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(u){const[,f,h]=u;throw new Error(`Uniform type ${l.type} is not supported. Use type: '${f}', size: ${h} instead.`)}throw new Error(`Uniform type ${l.type} is not supported. Supported uniform types are: ${z5.join(", ")}`)}l.value??(l.value=JI(l.type,l.size)),s[o]=l.value}this.uniforms=s,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=nj(Object.keys(s).map(o=>`${o}-${e[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};L5.defaultOptions={ubo:!1,isStatic:!1};let I5=L5;class _S{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const s in e){const o=e[s];this.setResource(o,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const s in this.resources)e[n++]=this.resources[s]._resourceId;this._key=e.join("|")}setResource(e,n){var o,l;const s=this.resources[n];e!==s&&((o=s==null?void 0:s.off)==null||o.call(s,"change",this.onResourceChange,this),(l=e.on)==null||l.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const s=this.resources;for(const o in s)s[o]._gcLastUsed=e,s[o]._touched=n}destroy(){var n;const e=this.resources;for(const s in e){const o=e[s];(n=o==null?void 0:o.off)==null||n.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var QT=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(QT||{});class aD extends bd{constructor(e){super(),this.uid=gs("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:s,groups:o,resources:l,compatibleRenderers:u,groupMap:f}=e;this.gpuProgram=n,this.glProgram=s,u===void 0&&(u=0,n&&(u|=QT.WEBGPU),s&&(u|=QT.WEBGL)),this.compatibleRenderers=u;const h={};if(!l&&!o&&(l={}),l&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&o&&!f)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&o&&f)for(const p in f)for(const g in f[p]){const x=f[p][g];h[x]={group:p,binding:g,name:x}}else if(n&&o&&!f){const p=n.structsAndGroups.groups;f={},p.forEach(g=>{f[g.group]=f[g.group]||{},f[g.group][g.binding]=g.name,h[g.name]=g})}else if(l){o={},f={},n&&n.structsAndGroups.groups.forEach(x=>{f[x.group]=f[x.group]||{},f[x.group][x.binding]=x.name,h[x.name]=x});let p=0;for(const g in l)h[g]||(o[99]||(o[99]=new _S,this._ownedBindGroups.push(o[99])),h[g]={group:99,binding:p,name:g},f[99]=f[99]||{},f[99][p]=g,p++);for(const g in l){const x=g;let v=l[g];!v.source&&!v._resourceType&&(v=new I5(v));const E=h[x];E&&(o[E.group]||(o[E.group]=new _S,this._ownedBindGroups.push(o[E.group])),o[E.group].setResource(v,E.binding))}}this.groups=o,this._uniformBindMap=f,this.resources=this._buildResourceAccessor(o,h)}addResource(e,n,s){var o,l;(o=this._uniformBindMap)[n]||(o[n]={}),(l=this._uniformBindMap[n])[s]||(l[s]=e),this.groups[n]||(this.groups[n]=new _S,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const s={};for(const o in n){const l=n[o];Object.defineProperty(s,l.name,{get(){return e[l.group].getResource(l.binding)},set(u){e[l.group].setResource(u,l.binding)}})}return s}destroy(e=!1){var n,s;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(s=this.glProgram)==null||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:s,...o}=e;let l,u;return n&&(l=r_.from(n)),s&&(u=rj.from(s)),new aD({gpuProgram:l,glProgram:u,...o})}}const e9={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},SC=0,DC=1,AC=2,CC=3,TC=4,RC=5,ZT=class H5{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<SC)}set blend(e){!!(this.data&1<<SC)!==e&&(this.data^=1<<SC)}get offsets(){return!!(this.data&1<<DC)}set offsets(e){!!(this.data&1<<DC)!==e&&(this.data^=1<<DC)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<AC)}set culling(e){!!(this.data&1<<AC)!==e&&(this.data^=1<<AC)}get depthTest(){return!!(this.data&1<<CC)}set depthTest(e){!!(this.data&1<<CC)!==e&&(this.data^=1<<CC)}get depthMask(){return!!(this.data&1<<RC)}set depthMask(e){!!(this.data&1<<RC)!==e&&(this.data^=1<<RC)}get clockwiseFrontFace(){return!!(this.data&1<<TC)}set clockwiseFrontFace(e){!!(this.data&1<<TC)!==e&&(this.data^=1<<TC)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=e9[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new H5;return e.depthTest=!1,e.blend=!0,e}};ZT.default2d=ZT.for2d();let sj=ZT;const q5=class JT extends aD{constructor(e){e={...JT.defaultOptions,...e},super(e),this.enabled=!0,this._state=sj.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,s,o){e.applyFilter(this,n,s,o)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:s,...o}=e;let l,u;return n&&(l=r_.from(n)),s&&(u=rj.from(s)),new JT({gpuProgram:l,glProgram:u,...o})}};q5.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let ob=q5;const eR=[];Zr.handleByNamedList(hn.Environment,eR);async function t9(t){if(!t)for(let e=0;e<eR.length;e++){const n=eR[e];if(n.value.test()){await n.value.load();return}}}let r1;function n9(){if(typeof r1=="boolean")return r1;try{r1=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{r1=!1}return r1}function JV(t,e,n=2){const s=e&&e.length,o=s?e[0]*n:t.length;let l=F5(t,0,o,n,!0);const u=[];if(!l||l.next===l.prev)return u;let f,h,p;if(s&&(l=a9(t,e,l,n)),t.length>80*n){f=t[0],h=t[1];let g=f,x=h;for(let v=n;v<o;v+=n){const E=t[v],S=t[v+1];E<f&&(f=E),S<h&&(h=S),E>g&&(g=E),S>x&&(x=S)}p=Math.max(g-f,x-h),p=p!==0?32767/p:0}return O1(l,u,n,f,h,p,0),u}function F5(t,e,n,s,o){let l;if(o===x9(t,e,n,s)>0)for(let u=e;u<n;u+=s)l=eU(u/s|0,t[u],t[u+1],l);else for(let u=n-s;u>=e;u-=s)l=eU(u/s|0,t[u],t[u+1],l);return l&&sv(l,l.next)&&(L1(l),l=l.next),l}function Jg(t,e){if(!t)return t;e||(e=t);let n=t,s;do if(s=!1,!n.steiner&&(sv(n,n.next)||Qr(n.prev,n,n.next)===0)){if(L1(n),n=e=n.prev,n===n.next)break;s=!0}else n=n.next;while(s||n!==e);return e}function O1(t,e,n,s,o,l,u){if(!t)return;!u&&l&&f9(t,s,o,l);let f=t;for(;t.prev!==t.next;){const h=t.prev,p=t.next;if(l?s9(t,s,o,l):r9(t)){e.push(h.i,t.i,p.i),L1(t),t=p.next,f=p.next;continue}if(t=p,t===f){u?u===1?(t=i9(Jg(t),e),O1(t,e,n,s,o,l,2)):u===2&&o9(t,e,n,s,o,l):O1(Jg(t),e,n,s,o,l,1);break}}}function r9(t){const e=t.prev,n=t,s=t.next;if(Qr(e,n,s)>=0)return!1;const o=e.x,l=n.x,u=s.x,f=e.y,h=n.y,p=s.y,g=Math.min(o,l,u),x=Math.min(f,h,p),v=Math.max(o,l,u),E=Math.max(f,h,p);let S=s.next;for(;S!==e;){if(S.x>=g&&S.x<=v&&S.y>=x&&S.y<=E&&v1(o,f,l,h,u,p,S.x,S.y)&&Qr(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function s9(t,e,n,s){const o=t.prev,l=t,u=t.next;if(Qr(o,l,u)>=0)return!1;const f=o.x,h=l.x,p=u.x,g=o.y,x=l.y,v=u.y,E=Math.min(f,h,p),S=Math.min(g,x,v),T=Math.max(f,h,p),D=Math.max(g,x,v),A=tR(E,S,e,n,s),M=tR(T,D,e,n,s);let j=t.prevZ,U=t.nextZ;for(;j&&j.z>=A&&U&&U.z<=M;){if(j.x>=E&&j.x<=T&&j.y>=S&&j.y<=D&&j!==o&&j!==u&&v1(f,g,h,x,p,v,j.x,j.y)&&Qr(j.prev,j,j.next)>=0||(j=j.prevZ,U.x>=E&&U.x<=T&&U.y>=S&&U.y<=D&&U!==o&&U!==u&&v1(f,g,h,x,p,v,U.x,U.y)&&Qr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;j&&j.z>=A;){if(j.x>=E&&j.x<=T&&j.y>=S&&j.y<=D&&j!==o&&j!==u&&v1(f,g,h,x,p,v,j.x,j.y)&&Qr(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;U&&U.z<=M;){if(U.x>=E&&U.x<=T&&U.y>=S&&U.y<=D&&U!==o&&U!==u&&v1(f,g,h,x,p,v,U.x,U.y)&&Qr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function i9(t,e){let n=t;do{const s=n.prev,o=n.next.next;!sv(s,o)&&Y5(s,n,n.next,o)&&z1(s,o)&&z1(o,s)&&(e.push(s.i,n.i,o.i),L1(n),L1(n.next),n=t=o),n=n.next}while(n!==t);return Jg(n)}function o9(t,e,n,s,o,l){let u=t;do{let f=u.next.next;for(;f!==u.prev;){if(u.i!==f.i&&p9(u,f)){let h=$5(u,f);u=Jg(u,u.next),h=Jg(h,h.next),O1(u,e,n,s,o,l,0),O1(h,e,n,s,o,l,0);return}f=f.next}u=u.next}while(u!==t)}function a9(t,e,n,s){const o=[];for(let l=0,u=e.length;l<u;l++){const f=e[l]*s,h=l<u-1?e[l+1]*s:t.length,p=F5(t,f,h,s,!1);p===p.next&&(p.steiner=!0),o.push(m9(p))}o.sort(l9);for(let l=0;l<o.length;l++)n=u9(o[l],n);return n}function l9(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const s=(t.next.y-t.y)/(t.next.x-t.x),o=(e.next.y-e.y)/(e.next.x-e.x);n=s-o}return n}function u9(t,e){const n=c9(t,e);if(!n)return e;const s=$5(n,t);return Jg(s,s.next),Jg(n,n.next)}function c9(t,e){let n=e;const s=t.x,o=t.y;let l=-1/0,u;if(sv(t,n))return n;do{if(sv(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const x=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=s&&x>l&&(l=x,u=n.x<n.next.x?n:n.next,x===s))return u}n=n.next}while(n!==e);if(!u)return null;const f=u,h=u.x,p=u.y;let g=1/0;n=u;do{if(s>=n.x&&n.x>=h&&s!==n.x&&G5(o<p?s:l,o,h,p,o<p?l:s,o,n.x,n.y)){const x=Math.abs(o-n.y)/(s-n.x);z1(n,t)&&(x<g||x===g&&(n.x>u.x||n.x===u.x&&d9(u,n)))&&(u=n,g=x)}n=n.next}while(n!==f);return u}function d9(t,e){return Qr(t.prev,t,e.prev)<0&&Qr(e.next,t,t.next)<0}function f9(t,e,n,s){let o=t;do o.z===0&&(o.z=tR(o.x,o.y,e,n,s)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,h9(o)}function h9(t){let e,n=1;do{let s=t,o;t=null;let l=null;for(e=0;s;){e++;let u=s,f=0;for(let p=0;p<n&&(f++,u=u.nextZ,!!u);p++);let h=n;for(;f>0||h>0&&u;)f!==0&&(h===0||!u||s.z<=u.z)?(o=s,s=s.nextZ,f--):(o=u,u=u.nextZ,h--),l?l.nextZ=o:t=o,o.prevZ=l,l=o;s=u}l.nextZ=null,n*=2}while(e>1);return t}function tR(t,e,n,s,o){return t=(t-n)*o|0,e=(e-s)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function m9(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function G5(t,e,n,s,o,l,u,f){return(o-u)*(e-f)>=(t-u)*(l-f)&&(t-u)*(s-f)>=(n-u)*(e-f)&&(n-u)*(l-f)>=(o-u)*(s-f)}function v1(t,e,n,s,o,l,u,f){return!(t===u&&e===f)&&G5(t,e,n,s,o,l,u,f)}function p9(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!g9(t,e)&&(z1(t,e)&&z1(e,t)&&b9(t,e)&&(Qr(t.prev,t,e.prev)||Qr(t,e.prev,e))||sv(t,e)&&Qr(t.prev,t,t.next)>0&&Qr(e.prev,e,e.next)>0)}function Qr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function sv(t,e){return t.x===e.x&&t.y===e.y}function Y5(t,e,n,s){const o=HN(Qr(t,e,n)),l=HN(Qr(t,e,s)),u=HN(Qr(n,s,t)),f=HN(Qr(n,s,e));return!!(o!==l&&u!==f||o===0&&IN(t,n,e)||l===0&&IN(t,s,e)||u===0&&IN(n,t,s)||f===0&&IN(n,e,s))}function IN(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function HN(t){return t>0?1:t<0?-1:0}function g9(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Y5(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function z1(t,e){return Qr(t.prev,t,t.next)<0?Qr(t,e,t.next)>=0&&Qr(t,t.prev,e)>=0:Qr(t,e,t.prev)<0||Qr(t,t.next,e)<0}function b9(t,e){let n=t,s=!1;const o=(t.x+e.x)/2,l=(t.y+e.y)/2;do n.y>l!=n.next.y>l&&n.next.y!==n.y&&o<(n.next.x-n.x)*(l-n.y)/(n.next.y-n.y)+n.x&&(s=!s),n=n.next;while(n!==t);return s}function $5(t,e){const n=nR(t.i,t.x,t.y),s=nR(e.i,e.x,e.y),o=t.next,l=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,s.next=n,n.prev=s,l.next=s,s.prev=l,s}function eU(t,e,n,s){const o=nR(t,e,n);return s?(o.next=s.next,o.prev=s,s.next.prev=o,s.next=o):(o.prev=o,o.next=o),o}function L1(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function nR(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function x9(t,e,n,s){let o=0;for(let l=e,u=n-s;l<n;l+=s)o+=(t[u]-t[l])*(t[l+1]+t[u+1]),u=l;return o}const y9=JV.default||JV;var X5=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(X5||{});class v9{constructor(e){this.items=[],this._name=e}emit(e,n,s,o,l,u,f,h){const{name:p,items:g}=this;for(let x=0,v=g.length;x<v;x++)g[x][p](e,n,s,o,l,u,f,h);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const E9=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],K5=class W5 extends bd{constructor(e){super(),this.tick=0,this.uid=gs("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...E9,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await t9(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)e={...this._systemsHash[s].constructor.defaultOptions,...e};e={...W5.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(e);this._initOptions=e}render(e,n){this.tick++;let s=e;if(s instanceof Pi&&(s={container:s},n&&(Ln(ps,"passing a second argument is deprecated, please use render options instead"),s.target=n.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const o=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=o?s.clearColor:si.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(e,n,s){const o=this.view.resolution;this.view.resize(e,n,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==o&&this.runners.resolutionChange.emit(s)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=X5.ALL);const{clear:s,clearColor:o,target:l,mipLevel:u,layer:f}=e;si.shared.setValue(o??this.background.colorRgba),n.renderTarget.clear(l,s,si.shared.toArray(),u??0,f??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new v9(n)})}_addSystems(e){let n;for(n in e){const s=e[n];this._addSystem(s.value,s.name)}}_addSystem(e,n){const s=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=s,this._systemsHash[n]=s;for(const o in this.runners)this.runners[o].add(s);return this}_addPipes(e,n){const s=n.reduce((o,l)=>(o[l.name]=l.value,o),{});e.forEach(o=>{const l=o.value,u=o.name,f=s[u];this.renderPipes[u]=new l(this,f?new f:null),this.runners.destroy.add(this.renderPipes[u])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&n_.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!n9())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};K5.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Q5=K5,qN;function _9(t){return qN!==void 0||(qN=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??Q5.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ul.get().getWebGLRenderingContext())return!1;let o=ul.get().createCanvas().getContext("webgl",e);const l=!!((n=o==null?void 0:o.getContextAttributes())!=null&&n.stencil);if(o){const u=o.getExtension("WEBGL_lose_context");u&&u.loseContext()}return o=null,l}catch{return!1}})()),qN}let FN;async function w9(t={}){return FN!==void 0||(FN=await(async()=>{const e=ul.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),FN}const tU=["webgl","webgpu","canvas"];async function N9(t){let e=[];t.preference?(e.push(t.preference),tU.forEach(l=>{l!==t.preference&&e.push(l)})):e=tU.slice();let n,s={};for(let l=0;l<e.length;l++){const u=e[l];if(u==="webgpu"&&await w9()){const{WebGPURenderer:f}=await $f(async()=>{const{WebGPURenderer:h}=await import("./WebGPURenderer-CagvVx3-.js");return{WebGPURenderer:h}},__vite__mapDeps([4,5,6]));n=f,s={...t,...t.webgpu};break}else if(u==="webgl"&&_9(t.failIfMajorPerformanceCaveat??Q5.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:f}=await $f(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-DOwJATTm.js");return{WebGLRenderer:h}},__vite__mapDeps([7,5,6]));n=f,s={...t,...t.webgl};break}else if(u==="canvas"){const{CanvasRenderer:f}=await $f(async()=>{const{CanvasRenderer:h}=await import("./CanvasRenderer-CQD8OFie.js");return{CanvasRenderer:h}},__vite__mapDeps([8,6]));n=f,s={...t,...t.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!n)throw new Error("No available renderer for the current environment");const o=new n;return await o.init(s),o}const Z5="8.17.0";class J5{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,Z5)}static destroy(){}}J5.extension=hn.Application;class S9{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,Z5)}destroy(){this._renderer=null}}S9.extension={type:[hn.WebGLSystem,hn.WebGPUSystem],name:"initHook",priority:-10};class e2{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,s;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:o,clientHeight:l}=this._resizeTo;n=o,s=l}this.renderer.resize(n,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}e2.extension=hn.Application;class t2{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,MS.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Fy.shared:new Fy,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}t2.extension=hn.Application;Zr.add(e2);Zr.add(t2);const n2=class rR{constructor(...e){this.stage=new Pi,e[0]!==void 0&&Ln(ps,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new Pi),this.renderer=await N9(e),rR._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Ln(ps,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const s=rR._plugins.slice(0);s.reverse(),s.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};n2._plugins=[];let ij=n2;Zr.handleByList(hn.Application,ij._plugins);Zr.add(J5);var jC,nU;function D9(){if(nU)return jC;nU=1,jC=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(l){var u=[];return l.replace(e,function(f,h,p){var g=h.toLowerCase();for(p=o(p),g=="m"&&p.length>2&&(u.push([h].concat(p.splice(0,2))),g="l",h=h=="m"?"l":"L");;){if(p.length==t[g])return p.unshift(h),u.push(p);if(p.length<t[g])throw new Error("malformed path data");u.push([h].concat(p.splice(0,t[g])))}}),u}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function o(l){var u=l.match(s);return u?u.map(Number):[]}return jC}var A9=D9();const C9=Jf(A9);function T9(t,e){const n=C9(t),s=[];let o=null,l=0,u=0;for(let f=0;f<n.length;f++){const h=n[f],p=h[0],g=h;switch(p){case"M":l=g[1],u=g[2],e.moveTo(l,u);break;case"m":l+=g[1],u+=g[2],e.moveTo(l,u);break;case"H":l=g[1],e.lineTo(l,u);break;case"h":l+=g[1],e.lineTo(l,u);break;case"V":u=g[1],e.lineTo(l,u);break;case"v":u+=g[1],e.lineTo(l,u);break;case"L":l=g[1],u=g[2],e.lineTo(l,u);break;case"l":l+=g[1],u+=g[2],e.lineTo(l,u);break;case"C":l=g[5],u=g[6],e.bezierCurveTo(g[1],g[2],g[3],g[4],l,u);break;case"c":e.bezierCurveTo(l+g[1],u+g[2],l+g[3],u+g[4],l+g[5],u+g[6]),l+=g[5],u+=g[6];break;case"S":l=g[3],u=g[4],e.bezierCurveToShort(g[1],g[2],l,u);break;case"s":e.bezierCurveToShort(l+g[1],u+g[2],l+g[3],u+g[4]),l+=g[3],u+=g[4];break;case"Q":l=g[3],u=g[4],e.quadraticCurveTo(g[1],g[2],l,u);break;case"q":e.quadraticCurveTo(l+g[1],u+g[2],l+g[3],u+g[4]),l+=g[3],u+=g[4];break;case"T":l=g[1],u=g[2],e.quadraticCurveToShort(l,u);break;case"t":l+=g[1],u+=g[2],e.quadraticCurveToShort(l,u);break;case"A":l=g[6],u=g[7],e.arcToSvg(g[1],g[2],g[3],g[4],g[5],l,u);break;case"a":l+=g[6],u+=g[7],e.arcToSvg(g[1],g[2],g[3],g[4],g[5],l,u);break;case"Z":case"z":e.closePath(),s.length>0&&(o=s.pop(),o?(l=o.startX,u=o.startY):(l=0,u=0)),o=null;break;default:qo(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&o===null&&(o={startX:l,startY:u},s.push(o))}return e}class oj{constructor(e=0,n=0,s=0){this.type="circle",this.x=e,this.y=n,this.radius=s}clone(){return new oj(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const s=this.radius*this.radius;let o=this.x-e,l=this.y-n;return o*=o,l*=l,o+l<=s}strokeContains(e,n,s,o=.5){if(this.radius===0)return!1;const l=this.x-e,u=this.y-n,f=this.radius,h=(1-o)*s,p=Math.sqrt(l*l+u*u);return p<=f+h&&p>f-(s-h)}getBounds(e){return e||(e=new ws),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class aj{constructor(e=0,n=0,s=0,o=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=s,this.halfHeight=o}clone(){return new aj(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(e-this.x)/this.halfWidth,o=(n-this.y)/this.halfHeight;return s*=s,o*=o,s+o<=1}strokeContains(e,n,s,o=.5){const{halfWidth:l,halfHeight:u}=this;if(l<=0||u<=0)return!1;const f=s*(1-o),h=s-f,p=l-h,g=u-h,x=l+f,v=u+f,E=e-this.x,S=n-this.y,T=E*E/(p*p)+S*S/(g*g),D=E*E/(x*x)+S*S/(v*v);return T>1&&D<=1}getBounds(e){return e||(e=new ws),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function R9(t,e,n,s,o,l){const u=t-n,f=e-s,h=o-n,p=l-s,g=u*h+f*p,x=h*h+p*p;let v=-1;x!==0&&(v=g/x);let E,S;v<0?(E=n,S=s):v>1?(E=o,S=l):(E=n+v*h,S=s+v*p);const T=t-E,D=e-S;return T*T+D*D}let j9,k9;class A1{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const s=[];for(let o=0,l=n.length;o<l;o++)s.push(n[o].x,n[o].y);n=s}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,s=n.length;for(let o=0;o<s;o+=2){const l=n[o],u=n[o+1],f=n[(o+2)%s],h=n[(o+3)%s];e+=(f-l)*(h+u)}return e<0}containsPolygon(e){const n=this.getBounds(j9),s=e.getBounds(k9);if(!n.containsRect(s))return!1;const o=e.points;for(let l=0;l<o.length;l+=2){const u=o[l],f=o[l+1];if(!this.contains(u,f))return!1}return!0}clone(){const e=this.points.slice(),n=new A1(e);return n.closePath=this.closePath,n}contains(e,n){let s=!1;const o=this.points.length/2;for(let l=0,u=o-1;l<o;u=l++){const f=this.points[l*2],h=this.points[l*2+1],p=this.points[u*2],g=this.points[u*2+1];h>n!=g>n&&e<(p-f)*((n-h)/(g-h))+f&&(s=!s)}return s}strokeContains(e,n,s,o=.5){const l=s*s,u=l*(1-o),f=l-u,{points:h}=this,p=h.length-(this.closePath?0:2);for(let g=0;g<p;g+=2){const x=h[g],v=h[g+1],E=h[(g+2)%h.length],S=h[(g+3)%h.length],T=R9(e,n,x,v,E,S),D=Math.sign((E-x)*(n-v)-(S-v)*(e-x));if(T<=(D<0?f:u))return!0}return!1}getBounds(e){e||(e=new ws);const n=this.points;let s=1/0,o=-1/0,l=1/0,u=-1/0;for(let f=0,h=n.length;f<h;f+=2){const p=n[f],g=n[f+1];s=p<s?p:s,o=p>o?p:o,l=g<l?g:l,u=g>u?g:u}return e.x=s,e.width=o-s,e.y=l,e.height=u-l,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return Ln("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return Ln("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const GN=(t,e,n,s,o,l,u)=>{const f=t-n,h=e-s,p=Math.sqrt(f*f+h*h);return p>=o-l&&p<=o+u};class lj{constructor(e=0,n=0,s=0,o=0,l=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=s,this.height=o,this.radius=l}getBounds(e){return e||(e=new ws),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new lj(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+s&&n<=this.y+this.height-s||e>=this.x+s&&e<=this.x+this.width-s)return!0;let o=e-(this.x+s),l=n-(this.y+s);const u=s*s;if(o*o+l*l<=u||(o=e-(this.x+this.width-s),o*o+l*l<=u)||(l=n-(this.y+this.height-s),o*o+l*l<=u)||(o=e-(this.x+s),o*o+l*l<=u))return!0}return!1}strokeContains(e,n,s,o=.5){const{x:l,y:u,width:f,height:h,radius:p}=this,g=s*(1-o),x=s-g,v=l+p,E=u+p,S=f-p*2,T=h-p*2,D=l+f,A=u+h;return(e>=l-g&&e<=l+x||e>=D-x&&e<=D+g)&&n>=E&&n<=E+T||(n>=u-g&&n<=u+x||n>=A-x&&n<=A+g)&&e>=v&&e<=v+S?!0:e<v&&n<E&&GN(e,n,v,E,p,x,g)||e>D-p&&n<E&&GN(e,n,D-p,E,p,x,g)||e>D-p&&n>A-p&&GN(e,n,D-p,A-p,p,x,g)||e<v&&n>A-p&&GN(e,n,v,A-p,p,x,g)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const r2={};function M9(t,e,n){let s=2166136261;for(let o=0;o<e;o++)s^=t[o].uid,s=Math.imul(s,16777619),s>>>=0;return r2[s]||V9(t,e,s,n)}function V9(t,e,n,s){const o={};let l=0;for(let f=0;f<s;f++){const h=f<e?t[f]:ur.EMPTY.source;o[l++]=h.source,o[l++]=h.style}const u=new _S(o);return r2[n]=u,u}class rU{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function sU(t,e,n,s){if(n??(n=0),s??(s=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(s&7)){const o=s/8;new Float64Array(e,0,o).set(new Float64Array(t,n,o))}else if(!(n&3)&&!(s&3)){const o=s/4;new Float32Array(e,0,o).set(new Float32Array(t,n,o))}else new Uint8Array(e).set(new Uint8Array(t,n,s))}const U9={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var P9=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(P9||{});function iU(t,e){return e.alphaMode==="no-premultiply-alpha"&&U9[t]||t}const O9=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
323
+ ${t}`}function FI(t,e){return e?t.replace("#version 300 es",""):t}const wC={stripVersion:FI,ensurePrecision:LI,addProgramDefines:zI,setProgramName:qI,insertVersion:BI},t1=Object.create(null),O5=class WT{constructor(e){e={...WT.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:OI()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let o=e.fragment,l=e.vertex;Object.keys(wC).forEach(u=>{const f=s[u];o=wC[u](o,f,!0),l=wC[u](l,f,!1)}),this.fragment=o,this.vertex=l,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=nj(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,t1[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return t1[n]||(t1[n]=new WT(e),t1[n]._cacheKey=n),t1[n]}};O5.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let rj=O5;const WV={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function GI(t){return WV[t]??WV.float32}const YI={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},QV=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function ZV(t,e){let n;for(;(n=QV.exec(t))!==null;){const s=YI[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:s,stride:GI(s).stride,offset:0,instance:!1,start:0}}QV.lastIndex=0}function $I(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function XI({source:t,entryPoint:e}){const n={},s=$I(t),o=s.indexOf(`fn ${e}(`);if(o===-1)return n;const l=s.indexOf("->",o);if(l===-1)return n;const u=s.substring(o,l);if(ZV(u,n),Object.keys(n).length===0){const f=u.match(/\(\s*\w+\s*:\s*(\w+)/);if(f){const h=f[1],p=new RegExp(`struct\\s+${h}\\s*\\{([^}]+)\\}`,"s"),g=s.match(p);g&&ZV(g[1],n)}}return n}function NC(t){var x,v;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,l=/:\s*([\w<>]+)/,u=/struct\s+(\w+)\s*{([^}]+)}/g,f=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,p=(x=t.match(e))==null?void 0:x.map(E=>({group:parseInt(E.match(n)[1],10),binding:parseInt(E.match(s)[1],10),name:E.match(o)[2],isUniform:E.match(o)[1]==="<uniform>",type:E.match(l)[1]}));if(!p)return{groups:[],structs:[]};const g=((v=t.match(u))==null?void 0:v.map(E=>{const S=E.match(h)[1],T=E.match(f).reduce((D,A)=>{const[M,j]=A.split(":");return D[M.trim()]=j.trim(),D},{});return T?{name:S,members:T}:null}).filter(({name:E})=>p.some(S=>S.type===E||S.type.includes(`<${E}>`))))??[];return{groups:p,structs:g}}var Fg=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(Fg||{});function KI({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]=[]),s.isUniform?e[s.group].push({binding:s.binding,visibility:Fg.VERTEX|Fg.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&e[s.group].push({binding:s.binding,visibility:Fg.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function WI({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]={}),e[s.group][s.name]=s.binding}return e}function QI(t,e){const n=new Set,s=new Set,o=[...t.structs,...e.structs].filter(u=>n.has(u.name)?!1:(n.add(u.name),!0)),l=[...t.groups,...e.groups].filter(u=>{const f=`${u.name}-${u.binding}`;return s.has(f)?!1:(s.add(f),!0)});return{structs:o,groups:l}}const n1=Object.create(null);class r_{constructor(e){var f,h;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:s,layout:o,gpuLayout:l,name:u}=e;if(this.name=u,this.fragment=n,this.vertex=s,n.source===s.source){const p=NC(n.source);this.structsAndGroups=p}else{const p=NC(s.source),g=NC(n.source);this.structsAndGroups=QI(p,g)}this.layout=o??WI(this.structsAndGroups),this.gpuLayout=l??KI(this.structsAndGroups),this.autoAssignGlobalUniforms=((f=this.layout[0])==null?void 0:f.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((h=this.layout[1])==null?void 0:h.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,s=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=nj(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=XI(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,n1[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return n1[n]||(n1[n]=new r_(e),n1[n]._cacheKey=n),n1[n]}}const z5=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],ZI=z5.reduce((t,e)=>(t[e]=!0,t),{});function JI(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const L5=class B5{constructor(e,n){this._touched=0,this.uid=gs("uniform"),this._resourceType="uniformGroup",this._resourceId=gs("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...B5.defaultOptions,...n},this.uniformStructures=e;const s={};for(const o in e){const l=e[o];if(l.name=o,l.size=l.size??1,!ZI[l.type]){const u=l.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(u){const[,f,h]=u;throw new Error(`Uniform type ${l.type} is not supported. Use type: '${f}', size: ${h} instead.`)}throw new Error(`Uniform type ${l.type} is not supported. Supported uniform types are: ${z5.join(", ")}`)}l.value??(l.value=JI(l.type,l.size)),s[o]=l.value}this.uniforms=s,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=nj(Object.keys(s).map(o=>`${o}-${e[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};L5.defaultOptions={ubo:!1,isStatic:!1};let I5=L5;class _S{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const s in e){const o=e[s];this.setResource(o,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const s in this.resources)e[n++]=this.resources[s]._resourceId;this._key=e.join("|")}setResource(e,n){var o,l;const s=this.resources[n];e!==s&&((o=s==null?void 0:s.off)==null||o.call(s,"change",this.onResourceChange,this),(l=e.on)==null||l.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const s=this.resources;for(const o in s)s[o]._gcLastUsed=e,s[o]._touched=n}destroy(){var n;const e=this.resources;for(const s in e){const o=e[s];(n=o==null?void 0:o.off)==null||n.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var QT=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(QT||{});class aD extends bd{constructor(e){super(),this.uid=gs("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:s,groups:o,resources:l,compatibleRenderers:u,groupMap:f}=e;this.gpuProgram=n,this.glProgram=s,u===void 0&&(u=0,n&&(u|=QT.WEBGPU),s&&(u|=QT.WEBGL)),this.compatibleRenderers=u;const h={};if(!l&&!o&&(l={}),l&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&o&&!f)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&o&&f)for(const p in f)for(const g in f[p]){const x=f[p][g];h[x]={group:p,binding:g,name:x}}else if(n&&o&&!f){const p=n.structsAndGroups.groups;f={},p.forEach(g=>{f[g.group]=f[g.group]||{},f[g.group][g.binding]=g.name,h[g.name]=g})}else if(l){o={},f={},n&&n.structsAndGroups.groups.forEach(x=>{f[x.group]=f[x.group]||{},f[x.group][x.binding]=x.name,h[x.name]=x});let p=0;for(const g in l)h[g]||(o[99]||(o[99]=new _S,this._ownedBindGroups.push(o[99])),h[g]={group:99,binding:p,name:g},f[99]=f[99]||{},f[99][p]=g,p++);for(const g in l){const x=g;let v=l[g];!v.source&&!v._resourceType&&(v=new I5(v));const E=h[x];E&&(o[E.group]||(o[E.group]=new _S,this._ownedBindGroups.push(o[E.group])),o[E.group].setResource(v,E.binding))}}this.groups=o,this._uniformBindMap=f,this.resources=this._buildResourceAccessor(o,h)}addResource(e,n,s){var o,l;(o=this._uniformBindMap)[n]||(o[n]={}),(l=this._uniformBindMap[n])[s]||(l[s]=e),this.groups[n]||(this.groups[n]=new _S,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const s={};for(const o in n){const l=n[o];Object.defineProperty(s,l.name,{get(){return e[l.group].getResource(l.binding)},set(u){e[l.group].setResource(u,l.binding)}})}return s}destroy(e=!1){var n,s;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(s=this.glProgram)==null||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:s,...o}=e;let l,u;return n&&(l=r_.from(n)),s&&(u=rj.from(s)),new aD({gpuProgram:l,glProgram:u,...o})}}const e9={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},SC=0,DC=1,AC=2,CC=3,TC=4,RC=5,ZT=class H5{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<SC)}set blend(e){!!(this.data&1<<SC)!==e&&(this.data^=1<<SC)}get offsets(){return!!(this.data&1<<DC)}set offsets(e){!!(this.data&1<<DC)!==e&&(this.data^=1<<DC)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<AC)}set culling(e){!!(this.data&1<<AC)!==e&&(this.data^=1<<AC)}get depthTest(){return!!(this.data&1<<CC)}set depthTest(e){!!(this.data&1<<CC)!==e&&(this.data^=1<<CC)}get depthMask(){return!!(this.data&1<<RC)}set depthMask(e){!!(this.data&1<<RC)!==e&&(this.data^=1<<RC)}get clockwiseFrontFace(){return!!(this.data&1<<TC)}set clockwiseFrontFace(e){!!(this.data&1<<TC)!==e&&(this.data^=1<<TC)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=e9[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new H5;return e.depthTest=!1,e.blend=!0,e}};ZT.default2d=ZT.for2d();let sj=ZT;const q5=class JT extends aD{constructor(e){e={...JT.defaultOptions,...e},super(e),this.enabled=!0,this._state=sj.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,s,o){e.applyFilter(this,n,s,o)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:s,...o}=e;let l,u;return n&&(l=r_.from(n)),s&&(u=rj.from(s)),new JT({gpuProgram:l,glProgram:u,...o})}};q5.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let ob=q5;const eR=[];Zr.handleByNamedList(hn.Environment,eR);async function t9(t){if(!t)for(let e=0;e<eR.length;e++){const n=eR[e];if(n.value.test()){await n.value.load();return}}}let r1;function n9(){if(typeof r1=="boolean")return r1;try{r1=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{r1=!1}return r1}function JV(t,e,n=2){const s=e&&e.length,o=s?e[0]*n:t.length;let l=F5(t,0,o,n,!0);const u=[];if(!l||l.next===l.prev)return u;let f,h,p;if(s&&(l=a9(t,e,l,n)),t.length>80*n){f=t[0],h=t[1];let g=f,x=h;for(let v=n;v<o;v+=n){const E=t[v],S=t[v+1];E<f&&(f=E),S<h&&(h=S),E>g&&(g=E),S>x&&(x=S)}p=Math.max(g-f,x-h),p=p!==0?32767/p:0}return O1(l,u,n,f,h,p,0),u}function F5(t,e,n,s,o){let l;if(o===x9(t,e,n,s)>0)for(let u=e;u<n;u+=s)l=eU(u/s|0,t[u],t[u+1],l);else for(let u=n-s;u>=e;u-=s)l=eU(u/s|0,t[u],t[u+1],l);return l&&sv(l,l.next)&&(L1(l),l=l.next),l}function Jg(t,e){if(!t)return t;e||(e=t);let n=t,s;do if(s=!1,!n.steiner&&(sv(n,n.next)||Qr(n.prev,n,n.next)===0)){if(L1(n),n=e=n.prev,n===n.next)break;s=!0}else n=n.next;while(s||n!==e);return e}function O1(t,e,n,s,o,l,u){if(!t)return;!u&&l&&f9(t,s,o,l);let f=t;for(;t.prev!==t.next;){const h=t.prev,p=t.next;if(l?s9(t,s,o,l):r9(t)){e.push(h.i,t.i,p.i),L1(t),t=p.next,f=p.next;continue}if(t=p,t===f){u?u===1?(t=i9(Jg(t),e),O1(t,e,n,s,o,l,2)):u===2&&o9(t,e,n,s,o,l):O1(Jg(t),e,n,s,o,l,1);break}}}function r9(t){const e=t.prev,n=t,s=t.next;if(Qr(e,n,s)>=0)return!1;const o=e.x,l=n.x,u=s.x,f=e.y,h=n.y,p=s.y,g=Math.min(o,l,u),x=Math.min(f,h,p),v=Math.max(o,l,u),E=Math.max(f,h,p);let S=s.next;for(;S!==e;){if(S.x>=g&&S.x<=v&&S.y>=x&&S.y<=E&&v1(o,f,l,h,u,p,S.x,S.y)&&Qr(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function s9(t,e,n,s){const o=t.prev,l=t,u=t.next;if(Qr(o,l,u)>=0)return!1;const f=o.x,h=l.x,p=u.x,g=o.y,x=l.y,v=u.y,E=Math.min(f,h,p),S=Math.min(g,x,v),T=Math.max(f,h,p),D=Math.max(g,x,v),A=tR(E,S,e,n,s),M=tR(T,D,e,n,s);let j=t.prevZ,U=t.nextZ;for(;j&&j.z>=A&&U&&U.z<=M;){if(j.x>=E&&j.x<=T&&j.y>=S&&j.y<=D&&j!==o&&j!==u&&v1(f,g,h,x,p,v,j.x,j.y)&&Qr(j.prev,j,j.next)>=0||(j=j.prevZ,U.x>=E&&U.x<=T&&U.y>=S&&U.y<=D&&U!==o&&U!==u&&v1(f,g,h,x,p,v,U.x,U.y)&&Qr(U.prev,U,U.next)>=0))return!1;U=U.nextZ}for(;j&&j.z>=A;){if(j.x>=E&&j.x<=T&&j.y>=S&&j.y<=D&&j!==o&&j!==u&&v1(f,g,h,x,p,v,j.x,j.y)&&Qr(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;U&&U.z<=M;){if(U.x>=E&&U.x<=T&&U.y>=S&&U.y<=D&&U!==o&&U!==u&&v1(f,g,h,x,p,v,U.x,U.y)&&Qr(U.prev,U,U.next)>=0)return!1;U=U.nextZ}return!0}function i9(t,e){let n=t;do{const s=n.prev,o=n.next.next;!sv(s,o)&&Y5(s,n,n.next,o)&&z1(s,o)&&z1(o,s)&&(e.push(s.i,n.i,o.i),L1(n),L1(n.next),n=t=o),n=n.next}while(n!==t);return Jg(n)}function o9(t,e,n,s,o,l){let u=t;do{let f=u.next.next;for(;f!==u.prev;){if(u.i!==f.i&&p9(u,f)){let h=$5(u,f);u=Jg(u,u.next),h=Jg(h,h.next),O1(u,e,n,s,o,l,0),O1(h,e,n,s,o,l,0);return}f=f.next}u=u.next}while(u!==t)}function a9(t,e,n,s){const o=[];for(let l=0,u=e.length;l<u;l++){const f=e[l]*s,h=l<u-1?e[l+1]*s:t.length,p=F5(t,f,h,s,!1);p===p.next&&(p.steiner=!0),o.push(m9(p))}o.sort(l9);for(let l=0;l<o.length;l++)n=u9(o[l],n);return n}function l9(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const s=(t.next.y-t.y)/(t.next.x-t.x),o=(e.next.y-e.y)/(e.next.x-e.x);n=s-o}return n}function u9(t,e){const n=c9(t,e);if(!n)return e;const s=$5(n,t);return Jg(s,s.next),Jg(n,n.next)}function c9(t,e){let n=e;const s=t.x,o=t.y;let l=-1/0,u;if(sv(t,n))return n;do{if(sv(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){const x=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=s&&x>l&&(l=x,u=n.x<n.next.x?n:n.next,x===s))return u}n=n.next}while(n!==e);if(!u)return null;const f=u,h=u.x,p=u.y;let g=1/0;n=u;do{if(s>=n.x&&n.x>=h&&s!==n.x&&G5(o<p?s:l,o,h,p,o<p?l:s,o,n.x,n.y)){const x=Math.abs(o-n.y)/(s-n.x);z1(n,t)&&(x<g||x===g&&(n.x>u.x||n.x===u.x&&d9(u,n)))&&(u=n,g=x)}n=n.next}while(n!==f);return u}function d9(t,e){return Qr(t.prev,t,e.prev)<0&&Qr(e.next,t,t.next)<0}function f9(t,e,n,s){let o=t;do o.z===0&&(o.z=tR(o.x,o.y,e,n,s)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,h9(o)}function h9(t){let e,n=1;do{let s=t,o;t=null;let l=null;for(e=0;s;){e++;let u=s,f=0;for(let p=0;p<n&&(f++,u=u.nextZ,!!u);p++);let h=n;for(;f>0||h>0&&u;)f!==0&&(h===0||!u||s.z<=u.z)?(o=s,s=s.nextZ,f--):(o=u,u=u.nextZ,h--),l?l.nextZ=o:t=o,o.prevZ=l,l=o;s=u}l.nextZ=null,n*=2}while(e>1);return t}function tR(t,e,n,s,o){return t=(t-n)*o|0,e=(e-s)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function m9(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function G5(t,e,n,s,o,l,u,f){return(o-u)*(e-f)>=(t-u)*(l-f)&&(t-u)*(s-f)>=(n-u)*(e-f)&&(n-u)*(l-f)>=(o-u)*(s-f)}function v1(t,e,n,s,o,l,u,f){return!(t===u&&e===f)&&G5(t,e,n,s,o,l,u,f)}function p9(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!g9(t,e)&&(z1(t,e)&&z1(e,t)&&b9(t,e)&&(Qr(t.prev,t,e.prev)||Qr(t,e.prev,e))||sv(t,e)&&Qr(t.prev,t,t.next)>0&&Qr(e.prev,e,e.next)>0)}function Qr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function sv(t,e){return t.x===e.x&&t.y===e.y}function Y5(t,e,n,s){const o=HN(Qr(t,e,n)),l=HN(Qr(t,e,s)),u=HN(Qr(n,s,t)),f=HN(Qr(n,s,e));return!!(o!==l&&u!==f||o===0&&IN(t,n,e)||l===0&&IN(t,s,e)||u===0&&IN(n,t,s)||f===0&&IN(n,e,s))}function IN(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function HN(t){return t>0?1:t<0?-1:0}function g9(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Y5(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function z1(t,e){return Qr(t.prev,t,t.next)<0?Qr(t,e,t.next)>=0&&Qr(t,t.prev,e)>=0:Qr(t,e,t.prev)<0||Qr(t,t.next,e)<0}function b9(t,e){let n=t,s=!1;const o=(t.x+e.x)/2,l=(t.y+e.y)/2;do n.y>l!=n.next.y>l&&n.next.y!==n.y&&o<(n.next.x-n.x)*(l-n.y)/(n.next.y-n.y)+n.x&&(s=!s),n=n.next;while(n!==t);return s}function $5(t,e){const n=nR(t.i,t.x,t.y),s=nR(e.i,e.x,e.y),o=t.next,l=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,s.next=n,n.prev=s,l.next=s,s.prev=l,s}function eU(t,e,n,s){const o=nR(t,e,n);return s?(o.next=s.next,o.prev=s,s.next.prev=o,s.next=o):(o.prev=o,o.next=o),o}function L1(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function nR(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function x9(t,e,n,s){let o=0;for(let l=e,u=n-s;l<n;l+=s)o+=(t[u]-t[l])*(t[l+1]+t[u+1]),u=l;return o}const y9=JV.default||JV;var X5=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(X5||{});class v9{constructor(e){this.items=[],this._name=e}emit(e,n,s,o,l,u,f,h){const{name:p,items:g}=this;for(let x=0,v=g.length;x<v;x++)g[x][p](e,n,s,o,l,u,f,h);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const E9=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],K5=class W5 extends bd{constructor(e){super(),this.tick=0,this.uid=gs("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...E9,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await t9(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)e={...this._systemsHash[s].constructor.defaultOptions,...e};e={...W5.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(e);this._initOptions=e}render(e,n){this.tick++;let s=e;if(s instanceof Pi&&(s={container:s},n&&(Ln(ps,"passing a second argument is deprecated, please use render options instead"),s.target=n.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const o=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=o?s.clearColor:si.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(e,n,s){const o=this.view.resolution;this.view.resize(e,n,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==o&&this.runners.resolutionChange.emit(s)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=X5.ALL);const{clear:s,clearColor:o,target:l,mipLevel:u,layer:f}=e;si.shared.setValue(o??this.background.colorRgba),n.renderTarget.clear(l,s,si.shared.toArray(),u??0,f??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new v9(n)})}_addSystems(e){let n;for(n in e){const s=e[n];this._addSystem(s.value,s.name)}}_addSystem(e,n){const s=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=s,this._systemsHash[n]=s;for(const o in this.runners)this.runners[o].add(s);return this}_addPipes(e,n){const s=n.reduce((o,l)=>(o[l.name]=l.value,o),{});e.forEach(o=>{const l=o.value,u=o.name,f=s[u];this.renderPipes[u]=new l(this,f?new f:null),this.runners.destroy.add(this.renderPipes[u])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&n_.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!n9())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};K5.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Q5=K5,qN;function _9(t){return qN!==void 0||(qN=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??Q5.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ul.get().getWebGLRenderingContext())return!1;let o=ul.get().createCanvas().getContext("webgl",e);const l=!!((n=o==null?void 0:o.getContextAttributes())!=null&&n.stencil);if(o){const u=o.getExtension("WEBGL_lose_context");u&&u.loseContext()}return o=null,l}catch{return!1}})()),qN}let FN;async function w9(t={}){return FN!==void 0||(FN=await(async()=>{const e=ul.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),FN}const tU=["webgl","webgpu","canvas"];async function N9(t){let e=[];t.preference?(e.push(t.preference),tU.forEach(l=>{l!==t.preference&&e.push(l)})):e=tU.slice();let n,s={};for(let l=0;l<e.length;l++){const u=e[l];if(u==="webgpu"&&await w9()){const{WebGPURenderer:f}=await $f(async()=>{const{WebGPURenderer:h}=await import("./WebGPURenderer-Chgxd6GA.js");return{WebGPURenderer:h}},__vite__mapDeps([4,5,6]));n=f,s={...t,...t.webgpu};break}else if(u==="webgl"&&_9(t.failIfMajorPerformanceCaveat??Q5.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:f}=await $f(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-DAij1hcL.js");return{WebGLRenderer:h}},__vite__mapDeps([7,5,6]));n=f,s={...t,...t.webgl};break}else if(u==="canvas"){const{CanvasRenderer:f}=await $f(async()=>{const{CanvasRenderer:h}=await import("./CanvasRenderer-DTA7H2ex.js");return{CanvasRenderer:h}},__vite__mapDeps([8,6]));n=f,s={...t,...t.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!n)throw new Error("No available renderer for the current environment");const o=new n;return await o.init(s),o}const Z5="8.17.0";class J5{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,Z5)}static destroy(){}}J5.extension=hn.Application;class S9{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,Z5)}destroy(){this._renderer=null}}S9.extension={type:[hn.WebGLSystem,hn.WebGPUSystem],name:"initHook",priority:-10};class e2{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,s;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:o,clientHeight:l}=this._resizeTo;n=o,s=l}this.renderer.resize(n,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}e2.extension=hn.Application;class t2{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,MS.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Fy.shared:new Fy,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}t2.extension=hn.Application;Zr.add(e2);Zr.add(t2);const n2=class rR{constructor(...e){this.stage=new Pi,e[0]!==void 0&&Ln(ps,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new Pi),this.renderer=await N9(e),rR._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Ln(ps,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const s=rR._plugins.slice(0);s.reverse(),s.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};n2._plugins=[];let ij=n2;Zr.handleByList(hn.Application,ij._plugins);Zr.add(J5);var jC,nU;function D9(){if(nU)return jC;nU=1,jC=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(l){var u=[];return l.replace(e,function(f,h,p){var g=h.toLowerCase();for(p=o(p),g=="m"&&p.length>2&&(u.push([h].concat(p.splice(0,2))),g="l",h=h=="m"?"l":"L");;){if(p.length==t[g])return p.unshift(h),u.push(p);if(p.length<t[g])throw new Error("malformed path data");u.push([h].concat(p.splice(0,t[g])))}}),u}var s=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function o(l){var u=l.match(s);return u?u.map(Number):[]}return jC}var A9=D9();const C9=Jf(A9);function T9(t,e){const n=C9(t),s=[];let o=null,l=0,u=0;for(let f=0;f<n.length;f++){const h=n[f],p=h[0],g=h;switch(p){case"M":l=g[1],u=g[2],e.moveTo(l,u);break;case"m":l+=g[1],u+=g[2],e.moveTo(l,u);break;case"H":l=g[1],e.lineTo(l,u);break;case"h":l+=g[1],e.lineTo(l,u);break;case"V":u=g[1],e.lineTo(l,u);break;case"v":u+=g[1],e.lineTo(l,u);break;case"L":l=g[1],u=g[2],e.lineTo(l,u);break;case"l":l+=g[1],u+=g[2],e.lineTo(l,u);break;case"C":l=g[5],u=g[6],e.bezierCurveTo(g[1],g[2],g[3],g[4],l,u);break;case"c":e.bezierCurveTo(l+g[1],u+g[2],l+g[3],u+g[4],l+g[5],u+g[6]),l+=g[5],u+=g[6];break;case"S":l=g[3],u=g[4],e.bezierCurveToShort(g[1],g[2],l,u);break;case"s":e.bezierCurveToShort(l+g[1],u+g[2],l+g[3],u+g[4]),l+=g[3],u+=g[4];break;case"Q":l=g[3],u=g[4],e.quadraticCurveTo(g[1],g[2],l,u);break;case"q":e.quadraticCurveTo(l+g[1],u+g[2],l+g[3],u+g[4]),l+=g[3],u+=g[4];break;case"T":l=g[1],u=g[2],e.quadraticCurveToShort(l,u);break;case"t":l+=g[1],u+=g[2],e.quadraticCurveToShort(l,u);break;case"A":l=g[6],u=g[7],e.arcToSvg(g[1],g[2],g[3],g[4],g[5],l,u);break;case"a":l+=g[6],u+=g[7],e.arcToSvg(g[1],g[2],g[3],g[4],g[5],l,u);break;case"Z":case"z":e.closePath(),s.length>0&&(o=s.pop(),o?(l=o.startX,u=o.startY):(l=0,u=0)),o=null;break;default:qo(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&o===null&&(o={startX:l,startY:u},s.push(o))}return e}class oj{constructor(e=0,n=0,s=0){this.type="circle",this.x=e,this.y=n,this.radius=s}clone(){return new oj(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const s=this.radius*this.radius;let o=this.x-e,l=this.y-n;return o*=o,l*=l,o+l<=s}strokeContains(e,n,s,o=.5){if(this.radius===0)return!1;const l=this.x-e,u=this.y-n,f=this.radius,h=(1-o)*s,p=Math.sqrt(l*l+u*u);return p<=f+h&&p>f-(s-h)}getBounds(e){return e||(e=new ws),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class aj{constructor(e=0,n=0,s=0,o=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=s,this.halfHeight=o}clone(){return new aj(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(e-this.x)/this.halfWidth,o=(n-this.y)/this.halfHeight;return s*=s,o*=o,s+o<=1}strokeContains(e,n,s,o=.5){const{halfWidth:l,halfHeight:u}=this;if(l<=0||u<=0)return!1;const f=s*(1-o),h=s-f,p=l-h,g=u-h,x=l+f,v=u+f,E=e-this.x,S=n-this.y,T=E*E/(p*p)+S*S/(g*g),D=E*E/(x*x)+S*S/(v*v);return T>1&&D<=1}getBounds(e){return e||(e=new ws),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function R9(t,e,n,s,o,l){const u=t-n,f=e-s,h=o-n,p=l-s,g=u*h+f*p,x=h*h+p*p;let v=-1;x!==0&&(v=g/x);let E,S;v<0?(E=n,S=s):v>1?(E=o,S=l):(E=n+v*h,S=s+v*p);const T=t-E,D=e-S;return T*T+D*D}let j9,k9;class A1{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const s=[];for(let o=0,l=n.length;o<l;o++)s.push(n[o].x,n[o].y);n=s}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,s=n.length;for(let o=0;o<s;o+=2){const l=n[o],u=n[o+1],f=n[(o+2)%s],h=n[(o+3)%s];e+=(f-l)*(h+u)}return e<0}containsPolygon(e){const n=this.getBounds(j9),s=e.getBounds(k9);if(!n.containsRect(s))return!1;const o=e.points;for(let l=0;l<o.length;l+=2){const u=o[l],f=o[l+1];if(!this.contains(u,f))return!1}return!0}clone(){const e=this.points.slice(),n=new A1(e);return n.closePath=this.closePath,n}contains(e,n){let s=!1;const o=this.points.length/2;for(let l=0,u=o-1;l<o;u=l++){const f=this.points[l*2],h=this.points[l*2+1],p=this.points[u*2],g=this.points[u*2+1];h>n!=g>n&&e<(p-f)*((n-h)/(g-h))+f&&(s=!s)}return s}strokeContains(e,n,s,o=.5){const l=s*s,u=l*(1-o),f=l-u,{points:h}=this,p=h.length-(this.closePath?0:2);for(let g=0;g<p;g+=2){const x=h[g],v=h[g+1],E=h[(g+2)%h.length],S=h[(g+3)%h.length],T=R9(e,n,x,v,E,S),D=Math.sign((E-x)*(n-v)-(S-v)*(e-x));if(T<=(D<0?f:u))return!0}return!1}getBounds(e){e||(e=new ws);const n=this.points;let s=1/0,o=-1/0,l=1/0,u=-1/0;for(let f=0,h=n.length;f<h;f+=2){const p=n[f],g=n[f+1];s=p<s?p:s,o=p>o?p:o,l=g<l?g:l,u=g>u?g:u}return e.x=s,e.width=o-s,e.y=l,e.height=u-l,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return Ln("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return Ln("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const GN=(t,e,n,s,o,l,u)=>{const f=t-n,h=e-s,p=Math.sqrt(f*f+h*h);return p>=o-l&&p<=o+u};class lj{constructor(e=0,n=0,s=0,o=0,l=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=s,this.height=o,this.radius=l}getBounds(e){return e||(e=new ws),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new lj(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+s&&n<=this.y+this.height-s||e>=this.x+s&&e<=this.x+this.width-s)return!0;let o=e-(this.x+s),l=n-(this.y+s);const u=s*s;if(o*o+l*l<=u||(o=e-(this.x+this.width-s),o*o+l*l<=u)||(l=n-(this.y+this.height-s),o*o+l*l<=u)||(o=e-(this.x+s),o*o+l*l<=u))return!0}return!1}strokeContains(e,n,s,o=.5){const{x:l,y:u,width:f,height:h,radius:p}=this,g=s*(1-o),x=s-g,v=l+p,E=u+p,S=f-p*2,T=h-p*2,D=l+f,A=u+h;return(e>=l-g&&e<=l+x||e>=D-x&&e<=D+g)&&n>=E&&n<=E+T||(n>=u-g&&n<=u+x||n>=A-x&&n<=A+g)&&e>=v&&e<=v+S?!0:e<v&&n<E&&GN(e,n,v,E,p,x,g)||e>D-p&&n<E&&GN(e,n,D-p,E,p,x,g)||e>D-p&&n>A-p&&GN(e,n,D-p,A-p,p,x,g)||e<v&&n>A-p&&GN(e,n,v,A-p,p,x,g)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const r2={};function M9(t,e,n){let s=2166136261;for(let o=0;o<e;o++)s^=t[o].uid,s=Math.imul(s,16777619),s>>>=0;return r2[s]||V9(t,e,s,n)}function V9(t,e,n,s){const o={};let l=0;for(let f=0;f<s;f++){const h=f<e?t[f]:ur.EMPTY.source;o[l++]=h.source,o[l++]=h.style}const u=new _S(o);return r2[n]=u,u}class rU{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function sU(t,e,n,s){if(n??(n=0),s??(s=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(s&7)){const o=s/8;new Float64Array(e,0,o).set(new Float64Array(t,n,o))}else if(!(n&3)&&!(s&3)){const o=s/4;new Float32Array(e,0,o).set(new Float32Array(t,n,o))}else new Uint8Array(e).set(new Uint8Array(t,n,s))}const U9={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var P9=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(P9||{});function iU(t,e){return e.alphaMode==="no-premultiply-alpha"&&U9[t]||t}const O9=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
324
324
  `);function z9(t){let e="";for(let n=0;n<t;++n)n>0&&(e+=`
325
325
  else `),n<t-1&&(e+=`if(test == ${n}.0){}`);return e}function L9(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const s=O9.replace(/%forloop%/gi,z9(t));if(e.shaderSource(n,s),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))t=t/2|0;else break}}finally{e.deleteShader(n)}return t}let Ty=null;function B9(){var e;if(Ty)return Ty;const t=P5();return Ty=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Ty=L9(Ty,t),(e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Ty}class I9{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const n=this.textures[e];this.textures[e]=null,this.ids[n.uid]=null}this.count=0}}class H9{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new I9,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const C1=[];let VS=0;n_.register({clear:()=>{if(C1.length>0)for(const t of C1)t&&t.destroy();C1.length=0,VS=0}});function oU(){return VS>0?C1[--VS]:new H9}function aU(t){t.elements=null,C1[VS++]=t}let s1=0;const s2=class i2{constructor(e){this.uid=gs("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...i2.defaultOptions,...e},e.maxTextures||(Ln("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=B9());const{maxTextures:n,attributesInitialSize:s,indicesInitialSize:o}=e;this.attributeBuffer=new rU(s*4),this.indexBuffer=new Uint16Array(o),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)aU(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,n){const s=e._batch.textures.ids[n._source.uid];return!s&&s!==0?!1:(e._textureId=s,e.texture=n,!0)}updateElement(e){this.dirty=!0;const n=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId)}break(e){const n=this._elements;if(!n[this.elementStart])return;let s=oU(),o=s.textures;o.clear();const l=n[this.elementStart];let u=iU(l.blendMode,l.texture._source),f=l.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const h=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,g=this.indexBuffer;let x=this._batchIndexSize,v=this._batchIndexStart,E="startBatch",S=[];const T=this.maxTextures;for(let D=this.elementStart;D<this.elementSize;++D){const A=n[D];n[D]=null;const j=A.texture._source,U=iU(A.blendMode,j),P=u!==U||f!==A.topology;if(j._batchTick===s1&&!P){A._textureId=j._textureBindLocation,x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,h,p,A._attributeStart,A._textureId),this.packQuadIndex(g,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,h,p,A._attributeStart,A._textureId),this.packIndex(A,g,A._indexStart,A._attributeStart/this.vertexSize)),A._batch=s,S.push(A);continue}j._batchTick=s1,(o.count>=T||P)&&(this._finishBatch(s,v,x-v,o,u,f,e,E,S),E="renderBatch",v=x,u=U,f=A.topology,s=oU(),o=s.textures,o.clear(),S=[],++s1),A._textureId=j._textureBindLocation=o.count,o.ids[j.uid]=o.count,o.textures[o.count++]=j,A._batch=s,S.push(A),x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,h,p,A._attributeStart,A._textureId),this.packQuadIndex(g,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,h,p,A._attributeStart,A._textureId),this.packIndex(A,g,A._indexStart,A._attributeStart/this.vertexSize))}o.count>0&&(this._finishBatch(s,v,x-v,o,u,f,e,E,S),v=x,++s1),this.elementStart=this.elementSize,this._batchIndexStart=v,this._batchIndexSize=x}_finishBatch(e,n,s,o,l,u,f,h,p){e.gpuBindGroup=null,e.bindGroup=null,e.action=h,e.batcher=this,e.textures=o,e.blendMode=l,e.topology=u,e.start=n,e.size=s,e.elements=p,++s1,this.batches[this.batchIndex++]=e,f.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const n=Math.max(e,this.attributeBuffer.size*2),s=new rU(n);sU(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(e){const n=this.indexBuffer;let s=Math.max(e,n.length*1.5);s+=s%2;const o=s>65535?new Uint32Array(s):new Uint16Array(s);if(o.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let l=0;l<n.length;l++)o[l]=n[l];else sU(n.buffer,o.buffer);this.indexBuffer=o}packQuadIndex(e,n,s){e[n]=s+0,e[n+1]=s+1,e[n+2]=s+2,e[n+3]=s+0,e[n+4]=s+2,e[n+5]=s+3}packIndex(e,n,s,o){const l=e.indices,u=e.indexSize,f=e.indexOffset,h=e.attributeOffset;for(let p=0;p<u;p++)n[s++]=o+l[p+f]-h}destroy(e={}){var n;if(this.batches!==null){for(let s=0;s<this.batchIndex;s++)aU(this.batches[s]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,e.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let s=0;s<this._elements.length;s++)this._elements[s]&&(this._elements[s]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};s2.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let q9=s2;var fa=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(fa||{});class B1 extends bd{constructor(e){let{data:n,size:s}=e;const{usage:o,label:l,shrinkToFit:u}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=gs("buffer"),this._resourceType="buffer",this._resourceId=gs("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,s??(s=n==null?void 0:n.byteLength);const f=!!n;this.descriptor={size:s,usage:o,mappedAtCreation:f,label:l},this.shrinkToFit=u??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&fa.STATIC)}set static(e){e?this.descriptor.usage|=fa.STATIC:this.descriptor.usage&=~fa.STATIC}setDataWithSize(e,n,s){if(this._updateID++,this._updateSize=n*e.BYTES_PER_ELEMENT,this._data===e){s&&this.emit("update",this);return}const o=this._data;if(this._data=e,this._dataInt32=null,!o||o.length!==e.length){!this.shrinkToFit&&o&&e.byteLength<o.byteLength?s&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=gs("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function o2(t,e){if(!(t instanceof B1)){let n=e?fa.INDEX:fa.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),n=fa.INDEX|fa.COPY_DST):(t=new Float32Array(t),n=fa.VERTEX|fa.COPY_DST)),t=new B1({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return t}function F9(t,e,n){const s=t.getAttribute(e);if(!s)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const o=s.buffer.data;let l=1/0,u=1/0,f=-1/0,h=-1/0;const p=o.BYTES_PER_ELEMENT,g=(s.offset||0)/p,x=(s.stride||8)/p;for(let v=g;v<o.length;v+=x){const E=o[v],S=o[v+1];E>f&&(f=E),S>h&&(h=S),E<l&&(l=E),S<u&&(u=S)}return n.minX=l,n.minY=u,n.maxX=f,n.maxY=h,n}function G9(t){return(t instanceof B1||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=o2(t.buffer,!1),t}class Y9 extends bd{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=gs("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new cu,this._boundsDirty=!0;const{attributes:n,indexBuffer:s,topology:o}=e;if(this.buffers=[],this.attributes={},n)for(const l in n)this.addAttribute(l,n[l]);this.instanceCount=e.instanceCount??1,s&&this.addIndex(s),this.topology=o||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const n=this.attributes[e];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(e,n){const s=G9(n);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=s}addIndex(e){this.indexBuffer=o2(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,F9(this,"aPosition",this._bounds)):this._bounds}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){var n;this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(s=>s.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const $9=new Float32Array(1),X9=new Uint32Array(1);class K9 extends Y9{constructor(){const n=new B1({data:$9,label:"attribute-batch-buffer",usage:fa.VERTEX|fa.COPY_DST,shrinkToFit:!1}),s=new B1({data:X9,label:"index-batch-buffer",usage:fa.INDEX|fa.COPY_DST,shrinkToFit:!1}),o=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:o,offset:0},aUV:{buffer:n,format:"float32x2",stride:o,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:o,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:o,offset:20}},indexBuffer:s})}}function lU(t,e,n){if(t)for(const s in t){const o=s.toLocaleLowerCase(),l=e[o];if(l){let u=t[s];s==="header"&&(u=u.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&l.push(`//----${n}----//`),l.push(u)}else qo(`${s} placement hook does not exist in shader`)}}const W9=/\{\{(.*?)\}\}/g;function uU(t){var s;const e={};return(((s=t.match(W9))==null?void 0:s.map(o=>o.replace(/[{()}]/g,"")))??[]).forEach(o=>{e[o]=[]}),e}function cU(t,e){let n;const s=/@in\s+([^;]+);/g;for(;(n=s.exec(t))!==null;)e.push(n[1])}function dU(t,e,n=!1){const s=[];cU(e,s),t.forEach(f=>{f.header&&cU(f.header,s)});const o=s;n&&o.sort();const l=o.map((f,h)=>` @location(${h}) ${f},`).join(`
326
326
  `);let u=e.replace(/@in\s+[^;]+;\s*/g,"");return u=u.replace("{{in}}",`
@@ -789,9 +789,9 @@ No matching component was found for:
789
789
  `},p]}}const mJ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),pJ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gJ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],bJ=[...pJ,...gJ],xJ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),n6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),r6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yJ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),vJ=n6.concat(r6).sort().reverse();function EJ(t){const e=mJ(t),n=vJ,s="and or not only",o="[\\w-]+",l="("+o+"|@\\{"+o+"\\})",u=[],f=[],h=function(j){return{className:"string",begin:"~?"+j+".*?"+j}},p=function(j,U,P){return{className:j,begin:U,relevance:P}},g={$pattern:/[a-z-]+/,keyword:s,attribute:xJ.join(" ")},x={begin:"\\(",end:"\\)",contains:f,keywords:g,relevance:0};f.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h("'"),h('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,x,p("variable","@@?"+o,10),p("variable","@\\{"+o+"\\}"),p("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const v=f.concat({begin:/\{/,end:/\}/,contains:u}),E={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},S={begin:l+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yJ.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},T={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:f,relevance:0}},D={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:v}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:l,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,p("keyword","all\\b"),p("variable","@\\{"+o+"\\}"),{begin:"\\b("+bJ.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,p("selector-tag",l,0),p("selector-id","#"+l),p("selector-class","\\."+l,0),p("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+n6.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r6.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},e.FUNCTION_DISPATCH]},M={begin:o+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[A]};return u.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,T,D,M,S,A,E,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function _J(t){const e="\\[=*\\[",n="\\]=*\\]",s={begin:e,end:n,contains:["self"]},o=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[s],relevance:5}])}}function wJ(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},l={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},u={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,s,o,l,u]}}function NJ(t){const e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},l={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),v=t.inherit(g,{contains:[]});p.contains.push(v),g.contains.push(x);let E=[n,h];return[p,g,x,v].forEach(A=>{A.contains=A.contains.concat(E)}),E=E.concat(p,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},n,l,p,g,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},o,s,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function SJ(t){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function DJ(t){const e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:n.join(" ")},l={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},u={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[t.BACKSLASH_ESCAPE,l,h],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(T,D,A="\\1")=>{const M=A==="\\1"?A:e.concat(A,D);return e.concat(e.concat("(?:",T,")"),D,/(?:\\.|[^\\\/])*?/,M,/(?:\\.|[^\\\/])*?/,A,s)},E=(T,D,A)=>e.concat(e.concat("(?:",T,")"),D,/(?:\\.|[^\\\/])*?/,A,s),S=[h,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),u,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:v("s|tr|y",e.either(...x,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:E("(?:m|qr)?",/\//,/\//)},{begin:E("m|qr",e.either(...x,{capture:!0}),/\1/)},{begin:E("m|qr",/\(/,/\)/)},{begin:E("m|qr",/\[/,/\]/)},{begin:E("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,f,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return l.contains=S,u.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:S}}function AJ(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,s=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),l=e.concat(/[A-Z]+/,n),u={scope:"variable",match:"\\$+"+s},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),g=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(h)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(X,Q)=>{Q.data._beginMatch=X[1]||X[2]},"on:end":(X,Q)=>{Q.data._beginMatch!==X[1]&&Q.ignoreMatch()}},v=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),E=`[
790
790
  ]`,S={scope:"string",variants:[g,p,x,v]},T={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},D=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],M=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],U={keyword:A,literal:(X=>{const Q=[];return X.forEach(L=>{Q.push(L),L.toLowerCase()===L?Q.push(L.toUpperCase()):Q.push(L.toLowerCase())}),Q})(D),built_in:M},P=X=>X.map(Q=>Q.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,e.concat(E,"+"),e.concat("(?!",P(M).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},K=e.concat(s,"\\b(?!\\()"),te={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),K],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),K],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},H={scope:"attr",match:e.concat(s,e.lookahead(":"),e.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:U,contains:[H,u,te,t.C_BLOCK_COMMENT_MODE,S,T,z]},F={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",P(A).join("\\b|"),"|",P(M).join("\\b|"),"\\b)"),s,e.concat(E,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(F);const $=[H,te,t.C_BLOCK_COMMENT_MODE,S,T,z],J={begin:e.concat(/#\[\s*\\?/,e.either(o,l)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:D,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:D,keyword:["new","array"]},contains:["self",...$]},...$,{scope:"meta",variants:[{match:o},{match:l}]}]};return{case_insensitive:!1,keywords:U,contains:[J,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},u,F,te,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},z,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:U,contains:["self",J,u,te,t.C_BLOCK_COMMENT_MODE,S,T]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},S,T]}}function CJ(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function TJ(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function RJ(t){const e=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},g={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h,g,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,g,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,g,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",E=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,S=`\\b|${s.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${E}))[eE][+-]?(${v})[jJ]?(?=${S})`},{begin:`(${E})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${v})[jJ](?=${S})`}]},D={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",h,T,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,T,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[h,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,D,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[T,A,x]}]}}function jJ(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kJ(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,l=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[l,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:l},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function MJ(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=e.concat(s,/(::\w+)*/),u={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[f]}),t.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:u},x={className:"string",contains:[t.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,g]})]}]},v="[1-9](_?[0-9])*|0",E="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${E}))?([eE][+-]?(${E})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},T={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},z=[x,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:u},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{begin:n}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,p),relevance:0}].concat(h,p);g.contains=z,T.contains=z;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:z}}];return p.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(I).concat(p).concat(z)}}function VJ(t){const e=t.regex,n=/(r#)?/,s=e.concat(n,t.UNDERSCORE_IDENT_RE),o=e.concat(n,t.IDENT_RE),l={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,e.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:g,keyword:f,literal:h,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:g}},{className:"punctuation",begin:"->"},l]}}const UJ=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),PJ=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],OJ=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],zJ=[...PJ,...OJ],LJ=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),BJ=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),IJ=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),HJ=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function qJ(t){const e=UJ(t),n=IJ,s=BJ,o="@[a-z-]+",l="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zJ.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+HJ.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,f,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:LJ.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function FJ(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function GJ(t){const e=t.regex,n=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},l=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],v=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],E=g,S=[...p,...h].filter(P=>!g.includes(P)),T={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},D={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:e.concat(/\b/,e.either(...E),/\s*\(/),relevance:0,keywords:{built_in:E}};function M(P){return e.concat(/\b/,e.either(...P.map(z=>z.replace(/\s+/,"\\s+"))),/\b/)}const j={scope:"keyword",match:M(v),relevance:0};function U(P,{exceptions:z,when:K}={}){const te=K;return z=z||[],P.map(H=>H.match(/\|\d+$/)||z.includes(H)?H:te(H)?`${H}|0`:H)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:U(S,{when:P=>P.length<3}),literal:l,type:f,built_in:x},contains:[{scope:"type",match:M(u)},j,A,T,s,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,D]}}function s6(t){return t?typeof t=="string"?t:t.source:null}function h1(t){return lr("(?=",t,")")}function lr(...t){return t.map(n=>s6(n)).join("")}function YJ(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Lo(...t){return"("+(YJ(t).capture?"":"?:")+t.map(s=>s6(s)).join("|")+")"}const Pj=t=>lr(/\b/,t,/\w$/.test(t)?/\b/:/\B/),$J=["Protocol","Type"].map(Pj),u3=["init","self"].map(Pj),XJ=["Any","Self"],dT=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],c3=["false","nil","true"],KJ=["assignment","associativity","higherThan","left","lowerThan","none","right"],WJ=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],d3=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],i6=Lo(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),o6=Lo(i6,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),fT=lr(i6,o6,"*"),a6=Lo(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),qS=Lo(a6,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),cd=lr(a6,qS,"*"),aS=lr(/[A-Z]/,qS,"*"),QJ=["attached","autoclosure",lr(/convention\(/,Lo("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",lr(/objc\(/,cd,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],ZJ=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function JJ(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[t.C_LINE_COMMENT_MODE,n],o={match:[/\./,Lo(...$J,...u3)],className:{2:"keyword"}},l={match:lr(/\./,Lo(...dT)),relevance:0},u=dT.filter(Fe=>typeof Fe=="string").concat(["_|0"]),f=dT.filter(Fe=>typeof Fe!="string").concat(XJ).map(Pj),h={variants:[{className:"keyword",match:Lo(...f,...u3)}]},p={$pattern:Lo(/\b\w+/,/#\w+/),keyword:u.concat(WJ),literal:c3},g=[o,l,h],x={match:lr(/\./,Lo(...d3)),relevance:0},v={className:"built_in",match:lr(/\b/,Lo(...d3),/(?=\()/)},E=[x,v],S={match:/->/,relevance:0},T={className:"operator",relevance:0,variants:[{match:fT},{match:`\\.(\\.|${o6})+`}]},D=[S,T],A="([0-9]_*)+",M="([0-9a-fA-F]_*)+",j={className:"number",relevance:0,variants:[{match:`\\b(${A})(\\.(${A}))?([eE][+-]?(${A}))?\\b`},{match:`\\b0x(${M})(\\.(${M}))?([pP][+-]?(${A}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},U=(Fe="")=>({className:"subst",variants:[{match:lr(/\\/,Fe,/[0\\tnr"']/)},{match:lr(/\\/,Fe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Fe="")=>({className:"subst",match:lr(/\\/,Fe,/[\t ]*(?:[\r\n]|\r\n)/)}),z=(Fe="")=>({className:"subst",label:"interpol",begin:lr(/\\/,Fe,/\(/),end:/\)/}),K=(Fe="")=>({begin:lr(Fe,/"""/),end:lr(/"""/,Fe),contains:[U(Fe),P(Fe),z(Fe)]}),te=(Fe="")=>({begin:lr(Fe,/"/),end:lr(/"/,Fe),contains:[U(Fe),z(Fe)]}),H={className:"string",variants:[K(),K("#"),K("##"),K("###"),te(),te("#"),te("##"),te("###")]},I=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],F={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},$=Fe=>{const Ut=lr(Fe,/\//),Bn=lr(/\//,Fe);return{begin:Ut,end:Bn,contains:[...I,{scope:"comment",begin:`#(?!.*${Bn})`,end:/$/}]}},J={scope:"regexp",variants:[$("###"),$("##"),$("#"),F]},X={match:lr(/`/,cd,/`/)},Q={className:"variable",match:/\$\d+/},L={className:"variable",match:`\\$${qS}+`},ee=[X,Q,L],ne={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:ZJ,contains:[...D,j,H]}]}},oe={scope:"keyword",match:lr(/@/,Lo(...QJ),h1(Lo(/\(/,/\s+/)))},G={scope:"meta",match:lr(/@/,cd)},B=[ne,oe,G],ae={match:h1(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:lr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,qS,"+")},{className:"type",match:aS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:lr(/\s+&\s+/,h1(aS)),relevance:0}]},Z={begin:/</,end:/>/,keywords:p,contains:[...s,...g,...B,S,ae]};ae.contains.push(Z);const be={match:lr(cd,/\s*:/),keywords:"_|0",relevance:0},Ve={begin:/\(/,end:/\)/,relevance:0,keywords:p,contains:["self",be,...s,J,...g,...E,...D,j,H,...ee,...B,ae]},he={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,ae]},Ne={begin:Lo(h1(lr(cd,/\s*:/)),h1(lr(cd,/\s+/,cd,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:cd}]},De={begin:/\(/,end:/\)/,keywords:p,contains:[Ne,...s,...g,...D,j,H,...B,ae,Ve],endsParent:!0,illegal:/["']/},me={match:[/(func|macro)/,/\s+/,Lo(X.match,cd,fT)],className:{1:"keyword",3:"title.function"},contains:[he,De,e],illegal:[/\[/,/%/]},qe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[he,De,e],illegal:/\[|%/},Te={match:[/operator/,/\s+/,fT],className:{1:"keyword",3:"title"}},Ke={begin:[/precedencegroup/,/\s+/,aS],className:{1:"keyword",3:"title"},contains:[ae],keywords:[...KJ,...c3],end:/}/},et={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ct={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},kt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,cd,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:p,contains:[he,...g,{begin:/:/,end:/\{/,keywords:p,contains:[{scope:"title.class.inherited",match:aS},...g],relevance:0}]};for(const Fe of H.variants){const Ut=Fe.contains.find(wr=>wr.label==="interpol");Ut.keywords=p;const Bn=[...g,...E,...D,j,H,...ee];Ut.contains=[...Bn,{begin:/\(/,end:/\)/,contains:["self",...Bn]}]}return{name:"Swift",keywords:p,contains:[...s,me,qe,et,Ct,kt,Te,Ke,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},J,...g,...E,...D,j,H,...ee,...B,ae,Ve]}}const FS="[A-Za-z$_][0-9A-Za-z$_]*",l6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],u6=["true","false","null","undefined","NaN","Infinity"],c6=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],d6=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f6=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],h6=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],m6=[].concat(f6,c6,d6);function eee(t){const e=t.regex,n=(ne,{after:oe})=>{const G="</"+ne[0].slice(1);return ne.input.indexOf(G,oe)!==-1},s=FS,o={begin:"<>",end:"</>"},l=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,oe)=>{const G=ne[0].length+ne.index,B=ne.input[G];if(B==="<"||B===","){oe.ignoreMatch();return}B===">"&&(n(ne,{after:G})||oe.ignoreMatch());let ae;const Z=ne.input.substring(G);if(ae=Z.match(/^\s*=/)){oe.ignoreMatch();return}if((ae=Z.match(/^\s+extends\s+/))&&ae.index===0){oe.ignoreMatch();return}}},f={$pattern:FS,keyword:l6,literal:u6,built_in:m6,"variable.language":h6},h="[0-9](_?[0-9])*",p=`\\.(${h})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${g})((${p})|\\.)?|(${p}))[eE][+-]?(${h})\\b`},{begin:`\\b(${g})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,v],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,v]},M={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},j=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,S,T,D,{match:/\$\d+/},x];v.contains=j.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(j)});const U=[].concat(M,v.contains),P=U.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(U)}]),z={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:P},K={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,e.concat(s,"(",e.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...c6,...d6]}},H={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[z],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(ne){return e.concat("(?!",ne.join("|"),")")}const J={match:e.concat(/\b/,$([...f6,"super","import"].map(ne=>`${ne}\\s*\\(`)),s,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:e.concat(/\./,e.lookahead(e.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Q={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},z]},L="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",ee={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(L)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[z]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),H,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,E,S,T,D,M,{match:/\$\d+/},x,te,{scope:"attr",match:s+e.lookahead(":"),relevance:0},ee,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:L,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:l},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[z,t.inherit(t.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[z]},J,F,K,Q,{match:/\$[(.]/}]}}function tee(t){const e=t.regex,n=eee(t),s=FS,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:FS,keyword:l6.concat(h),literal:u6,built_in:m6.concat(o),"variable.language":h6},g={className:"meta",begin:"@"+s},x=(T,D,A)=>{const M=T.contains.findIndex(j=>j.label===D);if(M===-1)throw new Error("can not find mode to replace");T.contains.splice(M,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(g);const v=n.contains.find(T=>T.scope==="attr"),E=Object.assign({},v,{match:e.concat(s,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,v,E]),n.contains=n.contains.concat([g,l,u,E]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",f);const S=n.contains.find(T=>T.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function nee(t){const e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,l=/\d{4}-\d{1,2}-\d{1,2}/,u=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:e.concat(/# */,e.either(l,o),/ *#/)},{begin:e.concat(/# */,f,/ *#/)},{begin:e.concat(/# */,u,/ *#/)},{begin:e.concat(/# */,e.either(l,o),/ +/,e.either(u,f),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},x=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,s,h,p,g,x,v,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[v]}]}}function ree(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");const n=t.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},l={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},l,u,o,t.QUOTE_STRING_MODE,h,p,f]}}function see(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},l={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=t.inherit(l,{begin:/\(/,end:/\)/}),f=t.inherit(t.APOS_STRING_MODE,{className:"string"}),h=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[l,h,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[l,u,h,f]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function iee(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},l={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},f=t.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},E={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},S={begin:/\{/,end:/\}/,contains:[E],illegal:"\\n",relevance:0},T={begin:"\\[",end:"\\]",contains:[E],illegal:"\\n",relevance:0},D=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},v,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},S,T,l,u],A=[...D];return A.pop(),A.push(f),E.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:D}}const oee={arduino:IZ,bash:HZ,c:qZ,cpp:FZ,csharp:GZ,css:eJ,diff:tJ,go:nJ,graphql:rJ,ini:sJ,java:iJ,javascript:cJ,json:dJ,kotlin:hJ,less:EJ,lua:_J,makefile:wJ,markdown:NJ,objectivec:SJ,perl:DJ,php:AJ,"php-template":CJ,plaintext:TJ,python:RJ,"python-repl":jJ,r:kJ,ruby:MJ,rust:VJ,scss:qJ,shell:FJ,sql:GJ,swift:JJ,typescript:tee,vbnet:nee,wasm:ree,xml:see,yaml:iee};var hT,f3;function aee(){if(f3)return hT;f3=1;function t(ue){return ue instanceof Map?ue.clear=ue.delete=ue.set=function(){throw new Error("map is read-only")}:ue instanceof Set&&(ue.add=ue.clear=ue.delete=function(){throw new Error("set is read-only")}),Object.freeze(ue),Object.getOwnPropertyNames(ue).forEach(Ce=>{const Ie=ue[Ce],xt=typeof Ie;(xt==="object"||xt==="function")&&!Object.isFrozen(Ie)&&t(Ie)}),ue}class e{constructor(Ce){Ce.data===void 0&&(Ce.data={}),this.data=Ce.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ue){return ue.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(ue,...Ce){const Ie=Object.create(null);for(const xt in ue)Ie[xt]=ue[xt];return Ce.forEach(function(xt){for(const mn in xt)Ie[mn]=xt[mn]}),Ie}const o="</span>",l=ue=>!!ue.scope,u=(ue,{prefix:Ce})=>{if(ue.startsWith("language:"))return ue.replace("language:","language-");if(ue.includes(".")){const Ie=ue.split(".");return[`${Ce}${Ie.shift()}`,...Ie.map((xt,mn)=>`${xt}${"_".repeat(mn+1)}`)].join(" ")}return`${Ce}${ue}`};class f{constructor(Ce,Ie){this.buffer="",this.classPrefix=Ie.classPrefix,Ce.walk(this)}addText(Ce){this.buffer+=n(Ce)}openNode(Ce){if(!l(Ce))return;const Ie=u(Ce.scope,{prefix:this.classPrefix});this.span(Ie)}closeNode(Ce){l(Ce)&&(this.buffer+=o)}value(){return this.buffer}span(Ce){this.buffer+=`<span class="${Ce}">`}}const h=(ue={})=>{const Ce={children:[]};return Object.assign(Ce,ue),Ce};class p{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Ce){this.top.children.push(Ce)}openNode(Ce){const Ie=h({scope:Ce});this.add(Ie),this.stack.push(Ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Ce){return this.constructor._walk(Ce,this.rootNode)}static _walk(Ce,Ie){return typeof Ie=="string"?Ce.addText(Ie):Ie.children&&(Ce.openNode(Ie),Ie.children.forEach(xt=>this._walk(Ce,xt)),Ce.closeNode(Ie)),Ce}static _collapse(Ce){typeof Ce!="string"&&Ce.children&&(Ce.children.every(Ie=>typeof Ie=="string")?Ce.children=[Ce.children.join("")]:Ce.children.forEach(Ie=>{p._collapse(Ie)}))}}class g extends p{constructor(Ce){super(),this.options=Ce}addText(Ce){Ce!==""&&this.add(Ce)}startScope(Ce){this.openNode(Ce)}endScope(){this.closeNode()}__addSublanguage(Ce,Ie){const xt=Ce.root;Ie&&(xt.scope=`language:${Ie}`),this.add(xt)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x(ue){return ue?typeof ue=="string"?ue:ue.source:null}function v(ue){return T("(?=",ue,")")}function E(ue){return T("(?:",ue,")*")}function S(ue){return T("(?:",ue,")?")}function T(...ue){return ue.map(Ie=>x(Ie)).join("")}function D(ue){const Ce=ue[ue.length-1];return typeof Ce=="object"&&Ce.constructor===Object?(ue.splice(ue.length-1,1),Ce):{}}function A(...ue){return"("+(D(ue).capture?"":"?:")+ue.map(xt=>x(xt)).join("|")+")"}function M(ue){return new RegExp(ue.toString()+"|").exec("").length-1}function j(ue,Ce){const Ie=ue&&ue.exec(Ce);return Ie&&Ie.index===0}const U=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(ue,{joinWith:Ce}){let Ie=0;return ue.map(xt=>{Ie+=1;const mn=Ie;let In=x(xt),ft="";for(;In.length>0;){const ot=U.exec(In);if(!ot){ft+=In;break}ft+=In.substring(0,ot.index),In=In.substring(ot.index+ot[0].length),ot[0][0]==="\\"&&ot[1]?ft+="\\"+String(Number(ot[1])+mn):(ft+=ot[0],ot[0]==="("&&Ie++)}return ft}).map(xt=>`(${xt})`).join(Ce)}const z=/\b\B/,K="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",H="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",J=(ue={})=>{const Ce=/^#![ ]*\//;return ue.binary&&(ue.begin=T(Ce,/.*\b/,ue.binary,/\b.*/)),s({scope:"meta",begin:Ce,end:/$/,relevance:0,"on:begin":(Ie,xt)=>{Ie.index!==0&&xt.ignoreMatch()}},ue)},X={begin:"\\\\[\\s\\S]",relevance:0},Q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[X]},L={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[X]},ee={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ne=function(ue,Ce,Ie={}){const xt=s({scope:"comment",begin:ue,end:Ce,contains:[]},Ie);xt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const mn=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return xt.contains.push({begin:T(/[ ]+/,"(",mn,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),xt},oe=ne("//","$"),G=ne("/\\*","\\*/"),B=ne("#","$"),ae={scope:"number",begin:H,relevance:0},Z={scope:"number",begin:I,relevance:0},be={scope:"number",begin:F,relevance:0},Ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[X,{begin:/\[/,end:/\]/,relevance:0,contains:[X]}]},he={scope:"title",begin:K,relevance:0},Ne={scope:"title",begin:te,relevance:0},De={begin:"\\.\\s*"+te,relevance:0};var qe=Object.freeze({__proto__:null,APOS_STRING_MODE:Q,BACKSLASH_ESCAPE:X,BINARY_NUMBER_MODE:be,BINARY_NUMBER_RE:F,COMMENT:ne,C_BLOCK_COMMENT_MODE:G,C_LINE_COMMENT_MODE:oe,C_NUMBER_MODE:Z,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(ue){return Object.assign(ue,{"on:begin":(Ce,Ie)=>{Ie.data._beginMatch=Ce[1]},"on:end":(Ce,Ie)=>{Ie.data._beginMatch!==Ce[1]&&Ie.ignoreMatch()}})},HASH_COMMENT_MODE:B,IDENT_RE:K,MATCH_NOTHING_RE:z,METHOD_GUARD:De,NUMBER_MODE:ae,NUMBER_RE:H,PHRASAL_WORDS_MODE:ee,QUOTE_STRING_MODE:L,REGEXP_MODE:Ve,RE_STARTERS_RE:$,SHEBANG:J,TITLE_MODE:he,UNDERSCORE_IDENT_RE:te,UNDERSCORE_TITLE_MODE:Ne});function Te(ue,Ce){ue.input[ue.index-1]==="."&&Ce.ignoreMatch()}function Ke(ue,Ce){ue.className!==void 0&&(ue.scope=ue.className,delete ue.className)}function et(ue,Ce){Ce&&ue.beginKeywords&&(ue.begin="\\b("+ue.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ue.__beforeBegin=Te,ue.keywords=ue.keywords||ue.beginKeywords,delete ue.beginKeywords,ue.relevance===void 0&&(ue.relevance=0))}function Ct(ue,Ce){Array.isArray(ue.illegal)&&(ue.illegal=A(...ue.illegal))}function kt(ue,Ce){if(ue.match){if(ue.begin||ue.end)throw new Error("begin & end are not supported with match");ue.begin=ue.match,delete ue.match}}function Fe(ue,Ce){ue.relevance===void 0&&(ue.relevance=1)}const Ut=(ue,Ce)=>{if(!ue.beforeMatch)return;if(ue.starts)throw new Error("beforeMatch cannot be used with starts");const Ie=Object.assign({},ue);Object.keys(ue).forEach(xt=>{delete ue[xt]}),ue.keywords=Ie.keywords,ue.begin=T(Ie.beforeMatch,v(Ie.begin)),ue.starts={relevance:0,contains:[Object.assign(Ie,{endsParent:!0})]},ue.relevance=0,delete Ie.beforeMatch},Bn=["of","and","for","in","not","or","if","then","parent","list","value"],wr="keyword";function rt(ue,Ce,Ie=wr){const xt=Object.create(null);return typeof ue=="string"?mn(Ie,ue.split(" ")):Array.isArray(ue)?mn(Ie,ue):Object.keys(ue).forEach(function(In){Object.assign(xt,rt(ue[In],Ce,In))}),xt;function mn(In,ft){Ce&&(ft=ft.map(ot=>ot.toLowerCase())),ft.forEach(function(ot){const wt=ot.split("|");xt[wt[0]]=[In,Jt(wt[0],wt[1])]})}}function Jt(ue,Ce){return Ce?Number(Ce):Cr(ue)?0:1}function Cr(ue){return Bn.includes(ue.toLowerCase())}const br={},qn=ue=>{console.error(ue)},Tr=(ue,...Ce)=>{console.log(`WARN: ${ue}`,...Ce)},ke=(ue,Ce)=>{br[`${ue}/${Ce}`]||(console.log(`Deprecated as of ${ue}. ${Ce}`),br[`${ue}/${Ce}`]=!0)},Oe=new Error;function ce(ue,Ce,{key:Ie}){let xt=0;const mn=ue[Ie],In={},ft={};for(let ot=1;ot<=Ce.length;ot++)ft[ot+xt]=mn[ot],In[ot+xt]=!0,xt+=M(Ce[ot-1]);ue[Ie]=ft,ue[Ie]._emit=In,ue[Ie]._multi=!0}function tt(ue){if(Array.isArray(ue.begin)){if(ue.skip||ue.excludeBegin||ue.returnBegin)throw qn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Oe;if(typeof ue.beginScope!="object"||ue.beginScope===null)throw qn("beginScope must be object"),Oe;ce(ue,ue.begin,{key:"beginScope"}),ue.begin=P(ue.begin,{joinWith:""})}}function bt(ue){if(Array.isArray(ue.end)){if(ue.skip||ue.excludeEnd||ue.returnEnd)throw qn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Oe;if(typeof ue.endScope!="object"||ue.endScope===null)throw qn("endScope must be object"),Oe;ce(ue,ue.end,{key:"endScope"}),ue.end=P(ue.end,{joinWith:""})}}function en(ue){ue.scope&&typeof ue.scope=="object"&&ue.scope!==null&&(ue.beginScope=ue.scope,delete ue.scope)}function cr(ue){en(ue),typeof ue.beginScope=="string"&&(ue.beginScope={_wrap:ue.beginScope}),typeof ue.endScope=="string"&&(ue.endScope={_wrap:ue.endScope}),tt(ue),bt(ue)}function Fn(ue){function Ce(ft,ot){return new RegExp(x(ft),"m"+(ue.case_insensitive?"i":"")+(ue.unicodeRegex?"u":"")+(ot?"g":""))}class Ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ot,wt){wt.position=this.position++,this.matchIndexes[this.matchAt]=wt,this.regexes.push([wt,ot]),this.matchAt+=M(ot)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ot=this.regexes.map(wt=>wt[1]);this.matcherRe=Ce(P(ot,{joinWith:"|"}),!0),this.lastIndex=0}exec(ot){this.matcherRe.lastIndex=this.lastIndex;const wt=this.matcherRe.exec(ot);if(!wt)return null;const Dn=wt.findIndex((ml,ba)=>ba>0&&ml!==void 0),dr=this.matchIndexes[Dn];return wt.splice(0,Dn),Object.assign(wt,dr)}}class xt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ot){if(this.multiRegexes[ot])return this.multiRegexes[ot];const wt=new Ie;return this.rules.slice(ot).forEach(([Dn,dr])=>wt.addRule(Dn,dr)),wt.compile(),this.multiRegexes[ot]=wt,wt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ot,wt){this.rules.push([ot,wt]),wt.type==="begin"&&this.count++}exec(ot){const wt=this.getMatcher(this.regexIndex);wt.lastIndex=this.lastIndex;let Dn=wt.exec(ot);if(this.resumingScanAtSamePosition()&&!(Dn&&Dn.index===this.lastIndex)){const dr=this.getMatcher(0);dr.lastIndex=this.lastIndex+1,Dn=dr.exec(ot)}return Dn&&(this.regexIndex+=Dn.position+1,this.regexIndex===this.count&&this.considerAll()),Dn}}function mn(ft){const ot=new xt;return ft.contains.forEach(wt=>ot.addRule(wt.begin,{rule:wt,type:"begin"})),ft.terminatorEnd&&ot.addRule(ft.terminatorEnd,{type:"end"}),ft.illegal&&ot.addRule(ft.illegal,{type:"illegal"}),ot}function In(ft,ot){const wt=ft;if(ft.isCompiled)return wt;[Ke,kt,cr,Ut].forEach(dr=>dr(ft,ot)),ue.compilerExtensions.forEach(dr=>dr(ft,ot)),ft.__beforeBegin=null,[et,Ct,Fe].forEach(dr=>dr(ft,ot)),ft.isCompiled=!0;let Dn=null;return typeof ft.keywords=="object"&&ft.keywords.$pattern&&(ft.keywords=Object.assign({},ft.keywords),Dn=ft.keywords.$pattern,delete ft.keywords.$pattern),Dn=Dn||/\w+/,ft.keywords&&(ft.keywords=rt(ft.keywords,ue.case_insensitive)),wt.keywordPatternRe=Ce(Dn,!0),ot&&(ft.begin||(ft.begin=/\B|\b/),wt.beginRe=Ce(wt.begin),!ft.end&&!ft.endsWithParent&&(ft.end=/\B|\b/),ft.end&&(wt.endRe=Ce(wt.end)),wt.terminatorEnd=x(wt.end)||"",ft.endsWithParent&&ot.terminatorEnd&&(wt.terminatorEnd+=(ft.end?"|":"")+ot.terminatorEnd)),ft.illegal&&(wt.illegalRe=Ce(ft.illegal)),ft.contains||(ft.contains=[]),ft.contains=[].concat(...ft.contains.map(function(dr){return Rr(dr==="self"?ft:dr)})),ft.contains.forEach(function(dr){In(dr,wt)}),ft.starts&&In(ft.starts,ot),wt.matcher=mn(wt),wt}if(ue.compilerExtensions||(ue.compilerExtensions=[]),ue.contains&&ue.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ue.classNameAliases=s(ue.classNameAliases||{}),In(ue)}function Jr(ue){return ue?ue.endsWithParent||Jr(ue.starts):!1}function Rr(ue){return ue.variants&&!ue.cachedVariants&&(ue.cachedVariants=ue.variants.map(function(Ce){return s(ue,{variants:null},Ce)})),ue.cachedVariants?ue.cachedVariants:Jr(ue)?s(ue,{starts:ue.starts?s(ue.starts):null}):Object.isFrozen(ue)?s(ue):ue}var Un="11.11.1";class jr extends Error{constructor(Ce,Ie){super(Ce),this.name="HTMLInjectionError",this.html=Ie}}const ie=n,Se=s,Ge=Symbol("nomatch"),Qe=7,gt=function(ue){const Ce=Object.create(null),Ie=Object.create(null),xt=[];let mn=!0;const In="Could not find the language '{}', did you forget to load/include a language module?",ft={disableAutodetect:!0,name:"Plain text",contains:[]};let ot={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function wt($e){return ot.noHighlightRe.test($e)}function Dn($e){let Et=$e.className+" ";Et+=$e.parentNode?$e.parentNode.className:"";const $t=ot.languageDetectRe.exec(Et);if($t){const Xt=ii($t[1]);return Xt||(Tr(In.replace("{}",$t[1])),Tr("Falling back to no-highlight mode for this block.",$e)),Xt?$t[1]:"no-highlight"}return Et.split(/\s+/).find(Xt=>wt(Xt)||ii(Xt))}function dr($e,Et,$t){let Xt="",pn="";typeof Et=="object"?(Xt=$e,$t=Et.ignoreIllegals,pn=Et.language):(ke("10.7.0","highlight(lang, code, ...args) has been deprecated."),ke("10.7.0",`Please use highlight(code, options) instead.
791
791
  https://github.com/highlightjs/highlight.js/issues/2277`),pn=$e,Xt=Et),$t===void 0&&($t=!0);const ns={code:Xt,language:pn};zs("before:highlight",ns);const Ir=ns.result?ns.result:ml(ns.language,ns.code,$t);return Ir.code=ns.code,zs("after:highlight",Ir),Ir}function ml($e,Et,$t,Xt){const pn=Object.create(null);function ns(it,_t){return it.keywords[_t]}function Ir(){if(!jt.keywords){Sr.addText(Rn);return}let it=0;jt.keywordPatternRe.lastIndex=0;let _t=jt.keywordPatternRe.exec(Rn),Ft="";for(;_t;){Ft+=Rn.substring(it,_t.index);const xn=Bs.case_insensitive?_t[0].toLowerCase():_t[0],rs=ns(jt,xn);if(rs){const[wi,kr]=rs;if(Sr.addText(Ft),Ft="",pn[xn]=(pn[xn]||0)+1,pn[xn]<=Qe&&(_d+=kr),wi.startsWith("_"))Ft+=_t[0];else{const wd=Bs.classNameAliases[wi]||wi;Ls(_t[0],wd)}}else Ft+=_t[0];it=jt.keywordPatternRe.lastIndex,_t=jt.keywordPatternRe.exec(Rn)}Ft+=Rn.substring(it),Sr.addText(Ft)}function ho(){if(Rn==="")return;let it=null;if(typeof jt.subLanguage=="string"){if(!Ce[jt.subLanguage]){Sr.addText(Rn);return}it=ml(jt.subLanguage,Rn,!0,Cc[jt.subLanguage]),Cc[jt.subLanguage]=it._top}else it=fu(Rn,jt.subLanguage.length?jt.subLanguage:null);jt.relevance>0&&(_d+=it.relevance),Sr.__addSublanguage(it._emitter,it.language)}function bs(){jt.subLanguage!=null?ho():Ir(),Rn=""}function Ls(it,_t){it!==""&&(Sr.startScope(_t),Sr.addText(it),Sr.endScope())}function gu(it,_t){let Ft=1;const xn=_t.length-1;for(;Ft<=xn;){if(!it._emit[Ft]){Ft++;continue}const rs=Bs.classNameAliases[it[Ft]]||it[Ft],wi=_t[Ft];rs?Ls(wi,rs):(Rn=wi,Ir(),Rn=""),Ft++}}function ya(it,_t){return it.scope&&typeof it.scope=="string"&&Sr.openNode(Bs.classNameAliases[it.scope]||it.scope),it.beginScope&&(it.beginScope._wrap?(Ls(Rn,Bs.classNameAliases[it.beginScope._wrap]||it.beginScope._wrap),Rn=""):it.beginScope._multi&&(gu(it.beginScope,_t),Rn="")),jt=Object.create(it,{parent:{value:jt}}),jt}function bu(it,_t,Ft){let xn=j(it.endRe,Ft);if(xn){if(it["on:end"]){const rs=new e(it);it["on:end"](_t,rs),rs.isMatchIgnored&&(xn=!1)}if(xn){for(;it.endsParent&&it.parent;)it=it.parent;return it}}if(it.endsWithParent)return bu(it.parent,_t,Ft)}function Ac(it){return jt.matcher.regexIndex===0?(Rn+=it[0],1):(oi=!0,0)}function Ed(it){const _t=it[0],Ft=it.rule,xn=new e(Ft),rs=[Ft.__beforeBegin,Ft["on:begin"]];for(const wi of rs)if(wi&&(wi(it,xn),xn.isMatchIgnored))return Ac(_t);return Ft.skip?Rn+=_t:(Ft.excludeBegin&&(Rn+=_t),bs(),!Ft.returnBegin&&!Ft.excludeBegin&&(Rn=_t)),ya(Ft,it),Ft.returnBegin?0:_t.length}function rh(it){const _t=it[0],Ft=Et.substring(it.index),xn=bu(jt,it,Ft);if(!xn)return Ge;const rs=jt;jt.endScope&&jt.endScope._wrap?(bs(),Ls(_t,jt.endScope._wrap)):jt.endScope&&jt.endScope._multi?(bs(),gu(jt.endScope,it)):rs.skip?Rn+=_t:(rs.returnEnd||rs.excludeEnd||(Rn+=_t),bs(),rs.excludeEnd&&(Rn=_t));do jt.scope&&Sr.closeNode(),!jt.skip&&!jt.subLanguage&&(_d+=jt.relevance),jt=jt.parent;while(jt!==xn.parent);return xn.starts&&ya(xn.starts,it),rs.returnEnd?0:_t.length}function bl(){const it=[];for(let _t=jt;_t!==Bs;_t=_t.parent)_t.scope&&it.unshift(_t.scope);it.forEach(_t=>Sr.openNode(_t))}let va={};function Go(it,_t){const Ft=_t&&_t[0];if(Rn+=it,Ft==null)return bs(),0;if(va.type==="begin"&&_t.type==="end"&&va.index===_t.index&&Ft===""){if(Rn+=Et.slice(_t.index,_t.index+1),!mn){const xn=new Error(`0 width match regex (${$e})`);throw xn.languageName=$e,xn.badRule=va.rule,xn}return 1}if(va=_t,_t.type==="begin")return Ed(_t);if(_t.type==="illegal"&&!$t){const xn=new Error('Illegal lexeme "'+Ft+'" for mode "'+(jt.scope||"<unnamed>")+'"');throw xn.mode=jt,xn}else if(_t.type==="end"){const xn=rh(_t);if(xn!==Ge)return xn}if(_t.type==="illegal"&&Ft==="")return Rn+=`
792
- `,1;if(xl>1e5&&xl>_t.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rn+=Ft,Ft.length}const Bs=ii($e);if(!Bs)throw qn(In.replace("{}",$e)),new Error('Unknown language: "'+$e+'"');const Ea=Fn(Bs);let mo="",jt=Xt||Ea;const Cc={},Sr=new ot.__emitter(ot);bl();let Rn="",_d=0,xu=0,xl=0,oi=!1;try{if(Bs.__emitTokens)Bs.__emitTokens(Et,Sr);else{for(jt.matcher.considerAll();;){xl++,oi?oi=!1:jt.matcher.considerAll(),jt.matcher.lastIndex=xu;const it=jt.matcher.exec(Et);if(!it)break;const _t=Et.substring(xu,it.index),Ft=Go(_t,it);xu=it.index+Ft}Go(Et.substring(xu))}return Sr.finalize(),mo=Sr.toHTML(),{language:$e,value:mo,relevance:_d,illegal:!1,_emitter:Sr,_top:jt}}catch(it){if(it.message&&it.message.includes("Illegal"))return{language:$e,value:ie(Et),illegal:!0,relevance:0,_illegalBy:{message:it.message,index:xu,context:Et.slice(xu-100,xu+100),mode:it.mode,resultSoFar:mo},_emitter:Sr};if(mn)return{language:$e,value:ie(Et),illegal:!1,relevance:0,errorRaised:it,_emitter:Sr,_top:jt};throw it}}function ba($e){const Et={value:ie($e),illegal:!1,relevance:0,_top:ft,_emitter:new ot.__emitter(ot)};return Et._emitter.addText($e),Et}function fu($e,Et){Et=Et||ot.languages||Object.keys(Ce);const $t=ba($e),Xt=Et.filter(ii).filter(Nr).map(bs=>ml(bs,$e,!1));Xt.unshift($t);const pn=Xt.sort((bs,Ls)=>{if(bs.relevance!==Ls.relevance)return Ls.relevance-bs.relevance;if(bs.language&&Ls.language){if(ii(bs.language).supersetOf===Ls.language)return 1;if(ii(Ls.language).supersetOf===bs.language)return-1}return 0}),[ns,Ir]=pn,ho=ns;return ho.secondBest=Ir,ho}function Oi($e,Et,$t){const Xt=Et&&Ie[Et]||$t;$e.classList.add("hljs"),$e.classList.add(`language-${Xt}`)}function es($e){let Et=null;const $t=Dn($e);if(wt($t))return;if(zs("before:highlightElement",{el:$e,language:$t}),$e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$e);return}if($e.children.length>0&&(ot.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($e)),ot.throwUnescapedHTML))throw new jr("One of your code blocks includes unescaped HTML.",$e.innerHTML);Et=$e;const Xt=Et.textContent,pn=$t?dr(Xt,{language:$t,ignoreIllegals:!0}):fu(Xt);$e.innerHTML=pn.value,$e.dataset.highlighted="yes",Oi($e,$t,pn.language),$e.result={language:pn.language,re:pn.relevance,relevance:pn.relevance},pn.secondBest&&($e.secondBest={language:pn.secondBest.language,relevance:pn.secondBest.relevance}),zs("after:highlightElement",{el:$e,result:pn,text:Xt})}function Fo($e){ot=Se(ot,$e)}const hu=()=>{fo(),ke("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Dc(){fo(),ke("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let co=!1;function fo(){function $e(){fo()}if(document.readyState==="loading"){co||window.addEventListener("DOMContentLoaded",$e,!1),co=!0;return}document.querySelectorAll(ot.cssSelector).forEach(es)}function pl($e,Et){let $t=null;try{$t=Et(ue)}catch(Xt){if(qn("Language definition for '{}' could not be registered.".replace("{}",$e)),mn)qn(Xt);else throw Xt;$t=ft}$t.name||($t.name=$e),Ce[$e]=$t,$t.rawDefinition=Et.bind(null,ue),$t.aliases&&pu($t.aliases,{languageName:$e})}function xa($e){delete Ce[$e];for(const Et of Object.keys(Ie))Ie[Et]===$e&&delete Ie[Et]}function mu(){return Object.keys(Ce)}function ii($e){return $e=($e||"").toLowerCase(),Ce[$e]||Ce[Ie[$e]]}function pu($e,{languageName:Et}){typeof $e=="string"&&($e=[$e]),$e.forEach($t=>{Ie[$t.toLowerCase()]=Et})}function Nr($e){const Et=ii($e);return Et&&!Et.disableAutodetect}function vd($e){$e["before:highlightBlock"]&&!$e["before:highlightElement"]&&($e["before:highlightElement"]=Et=>{$e["before:highlightBlock"](Object.assign({block:Et.el},Et))}),$e["after:highlightBlock"]&&!$e["after:highlightElement"]&&($e["after:highlightElement"]=Et=>{$e["after:highlightBlock"](Object.assign({block:Et.el},Et))})}function ts($e){vd($e),xt.push($e)}function Ns($e){const Et=xt.indexOf($e);Et!==-1&&xt.splice(Et,1)}function zs($e,Et){const $t=$e;xt.forEach(function(Xt){Xt[$t]&&Xt[$t](Et)})}function gl($e){return ke("10.7.0","highlightBlock will be removed entirely in v12.0"),ke("10.7.0","Please use highlightElement now."),es($e)}Object.assign(ue,{highlight:dr,highlightAuto:fu,highlightAll:fo,highlightElement:es,highlightBlock:gl,configure:Fo,initHighlighting:hu,initHighlightingOnLoad:Dc,registerLanguage:pl,unregisterLanguage:xa,listLanguages:mu,getLanguage:ii,registerAliases:pu,autoDetection:Nr,inherit:Se,addPlugin:ts,removePlugin:Ns}),ue.debugMode=function(){mn=!1},ue.safeMode=function(){mn=!0},ue.versionString=Un,ue.regex={concat:T,lookahead:v,either:A,optional:S,anyNumberOfTimes:E};for(const $e in qe)typeof qe[$e]=="object"&&t(qe[$e]);return Object.assign(ue,qe),ue},yt=gt({});return yt.newInstance=()=>gt({}),hT=yt,yt.HighlightJS=yt,yt.default=yt,hT}var lee=aee();const uee=Jf(lee),h3={},cee="hljs-";function dee(t){const e=uee.newInstance();return t&&l(t),{highlight:n,highlightAuto:s,listLanguages:o,register:l,registerAlias:u,registered:f};function n(h,p,g){ge(typeof h=="string","expected `string` as `name`"),ge(typeof p=="string","expected `string` as `value`");const x=g||h3,v=typeof x.prefix=="string"?x.prefix:cee;if(!e.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");e.configure({__emitter:fee,classPrefix:v});const E=e.highlight(p,{ignoreIllegals:!0,language:h});if(E.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:E.errorRaised});const S=E._emitter.root,T=S.data;return T.language=E.language,T.relevance=E.relevance,S}function s(h,p){ge(typeof h=="string","expected `string` as `value`");const x=(p||h3).subset||o();let v=-1,E=0,S;for(;++v<x.length;){const T=x[v];if(!e.getLanguage(T))continue;const D=n(T,h,p);D.data&&D.data.relevance!==void 0&&D.data.relevance>E&&(E=D.data.relevance,S=D)}return S||{type:"root",children:[],data:{language:void 0,relevance:E}}}function o(){return e.listLanguages()}function l(h,p){if(typeof h=="string")ge(p!==void 0,"expected `grammar`"),e.registerLanguage(h,p);else{let g;for(g in h)Object.hasOwn(h,g)&&e.registerLanguage(g,h[g])}}function u(h,p){if(typeof h=="string")ge(p!==void 0),e.registerAliases(typeof p=="string"?p:[...p],{languageName:h});else{let g;for(g in h)if(Object.hasOwn(h,g)){const x=h[g];e.registerAliases(typeof x=="string"?x:[...x],{languageName:g})}}}function f(h){return!!e.getLanguage(h)}}class fee{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const s=this.stack[this.stack.length-1],o=e.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):s.children.push(...o)}openNode(e){const n=this,s=e.split(".").map(function(u,f){return f?u+"_".repeat(f):n.options.classPrefix+u}),o=this.stack[this.stack.length-1],l={type:"element",tagName:"span",properties:{className:s},children:[]};o.children.push(l),this.stack.push(l)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const hee={};function mee(t){const e=t||hee,n=e.aliases,s=e.detect||!1,o=e.languages||oee,l=e.plainText,u=e.prefix,f=e.subset;let h="hljs";const p=dee(o);if(n&&p.registerAlias(n),u){const g=u.indexOf("-");h=g===-1?u:u.slice(0,g)}return function(g,x){gD(g,"element",function(v,E,S){if(v.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const T=pee(v);if(T===!1||!T&&!s||T&&l&&l.includes(T))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const D=MZ(v,{whitespace:"pre"});let A;try{A=T?p.highlight(T,D,{prefix:u}):p.highlightAuto(D,{prefix:u,subset:f})}catch(M){const j=M;if(T&&/Unknown language/.test(j.message)){x.message("Cannot highlight as `"+T+"`, it’s not registered",{ancestors:[S,v],cause:j,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw j}!T&&A.data&&A.data.language&&v.properties.className.push("language-"+A.data.language),A.children.length>0&&(v.children=A.children)})}}function pee(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let s;for(;++n<e.length;){const o=String(e[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!s&&o.slice(0,5)==="lang-"&&(s=o.slice(5)),!s&&o.slice(0,9)==="language-"&&(s=o.slice(9))}return s}function gee({text:t}){const[e,n]=O.useState(!1),s=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return y.jsxDEV("button",{onClick:s,style:{position:"absolute",top:6,right:6,background:"var(--surface-4)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:e?"var(--status-active)":"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)",padding:"2px 8px",cursor:"pointer",transition:"color var(--duration-fast) var(--ease-out)"},children:e?"Copied!":"Copy"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:21,columnNumber:5},this)}function AR({content:t}){return y.jsxDEV("div",{className:"markdown-message",children:y.jsxDEV(hW,{remarkPlugins:[DZ],rehypePlugins:[mee],components:{pre({children:e,...n}){const s=Array.isArray(e)?e.find(l=>{var u,f;return(l==null?void 0:l.type)==="code"||((f=(u=l==null?void 0:l.props)==null?void 0:u.node)==null?void 0:f.tagName)==="code"}):e,o=typeof s=="object"&&s!==null&&"props"in s?CR(s.props.children):"";return y.jsxDEV("div",{style:{position:"relative"},children:[y.jsxDEV(gee,{text:o},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:64,columnNumber:17},this),y.jsxDEV("pre",{...n,style:{background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"12px 14px",paddingTop:28,margin:"8px 0",overflowX:"auto",fontSize:"0.78rem",lineHeight:1.6,fontFamily:"var(--font-mono)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:65,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:63,columnNumber:15},this)},code({className:e,children:n,...s}){return e?y.jsxDEV("code",{className:e,...s,children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:106,columnNumber:15},this):y.jsxDEV("code",{...s,style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"1px 5px",fontSize:"0.82em",fontFamily:"var(--font-mono)",color:"var(--accent)"},children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:89,columnNumber:17},this)},a({href:e,children:n,...s}){return y.jsxDEV("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...s,children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:113,columnNumber:15},this)},table({children:e,...n}){return y.jsxDEV("div",{style:{overflowX:"auto",margin:"8px 0"},children:y.jsxDEV("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:127,columnNumber:17},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:126,columnNumber:15},this)},th({children:e,...n}){return y.jsxDEV("th",{...n,style:{borderBottom:"2px solid var(--border-default)",padding:"6px 10px",textAlign:"left",fontWeight:600,color:"var(--text-primary)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:142,columnNumber:15},this)},td({children:e,...n}){return y.jsxDEV("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:158,columnNumber:15},this)},blockquote({children:e,...n}){return y.jsxDEV("blockquote",{...n,style:{borderLeft:"3px solid var(--accent-dim)",margin:"8px 0",padding:"4px 12px",color:"var(--text-secondary)",background:"rgba(0, 200, 255, 0.04)",borderRadius:"0 var(--radius-xs) var(--radius-xs) 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:172,columnNumber:15},this)},hr(){return y.jsxDEV("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:189,columnNumber:15},this)},ul({children:e,...n}){return y.jsxDEV("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:200,columnNumber:15},this)},ol({children:e,...n}){return y.jsxDEV("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:207,columnNumber:15},this)},li({children:e,...n}){return y.jsxDEV("li",{...n,style:{marginBottom:2},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:214,columnNumber:15},this)},h1({children:e,...n}){return y.jsxDEV("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:221,columnNumber:15},this)},h2({children:e,...n}){return y.jsxDEV("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:228,columnNumber:15},this)},h3({children:e,...n}){return y.jsxDEV("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:235,columnNumber:15},this)},p({children:e,...n}){return y.jsxDEV("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:242,columnNumber:15},this)}},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:46,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:45,columnNumber:5},this)}function CR(t){var e;return typeof t=="string"?t:Array.isArray(t)?t.map(CR).join(""):(e=t==null?void 0:t.props)!=null&&e.children?CR(t.props.children):""}function bee({commands:t,filter:e,selectedIndex:n,onSelect:s,visible:o}){const l=O.useRef(null),u=O.useRef(null),f=t.filter(h=>h.command.toLowerCase().includes(e.toLowerCase())||h.description.toLowerCase().includes(e.toLowerCase()));return O.useEffect(()=>{var h;(h=u.current)==null||h.scrollIntoView({block:"nearest"})},[n]),!o||f.length===0?null:y.jsxDEV("div",{ref:l,style:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",maxHeight:280,overflowY:"auto",zIndex:100,animation:"fadeInUp 0.15s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{padding:"8px 12px 4px",fontSize:"0.65rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Commands"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:58,columnNumber:7},this),f.map((h,p)=>{const g=p===n;return y.jsxDEV("div",{ref:g?u:void 0,onClick:()=>s(h),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",cursor:"pointer",background:g?"var(--accent-glow)":"transparent",borderLeft:g?"2px solid var(--accent)":"2px solid transparent",transition:"background var(--duration-fast) var(--ease-out)"},onMouseEnter:x=>{g||(x.currentTarget.style.background="var(--surface-3)")},onMouseLeave:x=>{g||(x.currentTarget.style.background="transparent")},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:600,color:g?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap"},children:["/",h.command,h.args&&y.jsxDEV("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",h.args]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:109,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:98,columnNumber:13},this),y.jsxDEV("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:112,columnNumber:13},this)]},h.command,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:73,columnNumber:11},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:40,columnNumber:5},this)}const m3=[{command:"expxagents",description:"Show main menu"},{command:"expxagents create",args:"[description]",description:"Design a new squad"},{command:"expxagents run",args:"<name>",description:"Execute a squad pipeline"},{command:"expxagents list",description:"List all squads"},{command:"expxagents edit",args:"<name>",description:"Modify a squad"},{command:"expxagents delete",args:"<name>",description:"Delete a squad"},{command:"expxagents skills",description:"Browse skills"},{command:"expxagents install",args:"<name>",description:"Install a skill"},{command:"expxagents uninstall",args:"<name>",description:"Remove a skill"},{command:"expxagents dashboard",description:"Open virtual office"},{command:"expxagents virtual-office",description:"Open virtual office in browser"},{command:"expxagents jarvis",description:"Open Jarvis voice assistant"},{command:"expxagents help",description:"Show help text"}];function xee({c:t}){return y.jsxDEV("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px",minWidth:"120px"},children:[y.jsxDEV("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#cdd6f4"},children:[t.value,t.unit?` ${t.unit}`:""]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:10,columnNumber:7},this),y.jsxDEV("div",{style:{fontSize:"12px",color:"#a6adc8",marginTop:"4px"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:13,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:9,columnNumber:5},this)}function yee({c:t}){const e=Math.round(t.value*100);return y.jsxDEV("div",{style:{width:"100%"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[y.jsxDEV("span",{style:{fontSize:"12px",color:"#a6adc8"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:23,columnNumber:9},this),y.jsxDEV("span",{style:{fontSize:"12px",color:"#cdd6f4"},children:[e,"%"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:24,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:22,columnNumber:7},this),y.jsxDEV("div",{style:{height:"6px",background:"#313244",borderRadius:"3px"},children:y.jsxDEV("div",{style:{height:"100%",width:`${e}%`,background:"#89b4fa",borderRadius:"3px",transition:"width 0.3s"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:27,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:26,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:21,columnNumber:5},this)}function vee({c:t}){return y.jsxDEV("div",{children:[t.title&&y.jsxDEV("div",{style:{fontSize:"13px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:45,columnNumber:9},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{children:t.columns.map((e,n)=>y.jsxDEV("th",{style:{textAlign:"left",padding:"4px 8px",color:"#a6adc8",borderBottom:"1px solid #313244"},children:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:53,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:51,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:50,columnNumber:9},this),y.jsxDEV("tbody",{children:t.rows.map((e,n)=>y.jsxDEV("tr",{children:e.map((s,o)=>y.jsxDEV("td",{style:{padding:"4px 8px",color:"#cdd6f4",borderBottom:"1px solid #1e1e2e"},children:s},o,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:71,columnNumber:17},this))},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:69,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:67,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:43,columnNumber:5},this)}function Eee({c:t}){return y.jsxDEV("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px"},children:[y.jsxDEV("div",{style:{fontWeight:600,color:"#cdd6f4",marginBottom:"6px"},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:89,columnNumber:7},this),y.jsxDEV("div",{style:{fontSize:"13px",color:"#a6adc8"},children:t.body},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:90,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:88,columnNumber:5},this)}const _ee={green:"#a6e3a1",yellow:"#f9e2af",red:"#f38ba8",blue:"#89b4fa"};function wee({c:t}){return y.jsxDEV("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:600,color:"#1e1e2e",background:_ee[t.color]??"#a6adc8"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:104,columnNumber:5},this)}function Nee({components:t}){return t.length===0?null:y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"12px"},children:t.map((e,n)=>{switch(e.type){case"metric":return y.jsxDEV(xee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:127,columnNumber:35},this);case"progress":return y.jsxDEV(yee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:128,columnNumber:35},this);case"table":return y.jsxDEV(vee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:129,columnNumber:35},this);case"card":return y.jsxDEV(Eee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:130,columnNumber:35},this);case"badge":return y.jsxDEV(wee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:131,columnNumber:35},this)}})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:124,columnNumber:5},this)}const lS="_expxagents",Sm=[.72,.78,.85,.95,1.08,1.2],See=2;function Dee({file:t,onRemove:e}){return y.jsxDEV("div",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"2px 8px",fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:"var(--accent)",maxWidth:180},children:[y.jsxDEV("span",{style:{opacity:.6},children:"📎"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:31,columnNumber:7},this),y.jsxDEV("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:32,columnNumber:7},this),y.jsxDEV("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:0,fontSize:"0.8rem",lineHeight:1},"aria-label":`Remove ${t.name}`,children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:41,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:16,columnNumber:5},this)}function Aee({message:t,fontSize:e}){if(t.role==="agent_dm")return y.jsxDEV("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:t.agentName},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:77,columnNumber:9},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:y.jsxDEV(AR,{content:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:96,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:89,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:64,columnNumber:7},this);const n=t.role==="user";return y.jsxDEV("div",{"data-role":t.role,style:{alignSelf:n?"flex-end":"flex-start",background:n?"var(--user-bubble)":"var(--agent-bubble)",border:n?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:n?"75%":"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:n?y.jsxDEV("span",{style:{whiteSpace:"pre-wrap"},children:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:127,columnNumber:11},this):y.jsxDEV(AR,{content:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:129,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:119,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:104,columnNumber:5},this)}function Cee({conv:t,isActive:e,onSelect:n,onDelete:s}){const[o,l]=O.useState(!1),u=new Date(t.createdAt),f=u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),h=u.toLocaleDateString([],{day:"2-digit",month:"2-digit"});return y.jsxDEV("div",{onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{padding:"8px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:e?"var(--accent-glow)":o?"var(--surface-3)":"transparent",border:e?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:8},children:[y.jsxDEV("div",{style:{flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:e?"var(--accent)":"var(--text-secondary)",fontWeight:e?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.preview||"New conversation"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:171,columnNumber:9},this),y.jsxDEV("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[h," ",f]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:184,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:170,columnNumber:7},this),o&&y.jsxDEV("button",{onClick:p=>{p.stopPropagation(),s()},title:"Delete conversation","aria-label":"Delete conversation",style:{background:"none",border:"none",color:"var(--status-error)",cursor:"pointer",padding:"2px 4px",fontSize:"0.75rem",lineHeight:1,opacity:.7,flexShrink:0},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:196,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:154,columnNumber:5},this)}function Tee(){const[t,e]=O.useState(""),[n,s]=O.useState([]),[o,l]=O.useState(See),[u,f]=O.useState(!1),[h,p]=O.useState(""),[g,x]=O.useState(0),v=O.useRef(null),E=O.useRef(null),S=O.useRef(null),T=O.useRef(null),D=Ps(me=>me.selectedSquad),A=Ps(me=>me.uiComponents[D??""]),M=Ei(me=>me.conversations),j=Ei(me=>me.conversationId),U=Ei(me=>me.messages),P=Ei(me=>me.streaming),z=Ei(me=>me.streamingText),K=Ei(me=>me.activity),te=Ei(me=>me.error),H=Ei(me=>me.addUserMessage),I=Ei(me=>me.startStreaming),F=Ei(me=>me.loadHistory),$=Ei(me=>me.selectConversation),J=Ei(me=>me.deleteConversation);O.useEffect(()=>{F(lS)},[F]),O.useEffect(()=>{var me,qe;(qe=(me=v.current)==null?void 0:me.scrollIntoView)==null||qe.call(me,{behavior:"smooth"})},[U,z]);const X=O.useCallback(()=>{const me=E.current;me&&(me.style.height="auto",me.style.height=Math.min(me.scrollHeight,200)+"px")},[]);O.useEffect(()=>{X()},[t,X]);const Q=O.useCallback(me=>{if(me.startsWith("/")){const qe=me.slice(1);p(qe),f(!0),x(0)}else f(!1)},[]),L=O.useCallback(()=>m3.filter(me=>me.command.toLowerCase().includes(h.toLowerCase())||me.description.toLowerCase().includes(h.toLowerCase())),[h]),ee=O.useCallback(me=>{var qe;e("/"+me.command+(me.args?" ":"")),f(!1),(qe=E.current)==null||qe.focus()},[]),ne=O.useCallback(()=>{P||YB(lS)},[P]),oe=O.useCallback(me=>{P||J(me,lS)},[P,J]),G=O.useCallback(me=>{P||me===j||$(me)},[P,j,$]),B=O.useCallback(()=>{const me=t.trim();!me||P||(H(me),I(),QO(lS,me,n.length>0?n:void 0),e(""),s([]),f(!1),E.current&&(E.current.style.height="auto"))},[t,P,n,H,I]),ae=O.useCallback(me=>{if(u){const qe=L();if(me.key==="ArrowDown"){me.preventDefault(),x(Te=>Math.min(Te+1,qe.length-1));return}if(me.key==="ArrowUp"){me.preventDefault(),x(Te=>Math.max(Te-1,0));return}if(me.key==="Enter"&&!me.shiftKey){me.preventDefault(),qe[g]&&ee(qe[g]);return}if(me.key==="Escape"){me.preventDefault(),f(!1);return}if(me.key==="Tab"){me.preventDefault(),qe[g]&&ee(qe[g]);return}}me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),B())},[u,L,g,ee,B]),Z=O.useCallback(me=>{const qe=me.target.value;e(qe),Q(qe)},[Q]),be=O.useCallback(async me=>{var Te;if(!me)return;const qe=[];for(const Ke of Array.from(me))if(!(Ke.size>512e3))try{const et=await Ke.text();qe.push({name:Ke.name,content:et})}catch{}s(Ke=>[...Ke,...qe]),(Te=E.current)==null||Te.focus()},[]),Ve=O.useCallback(me=>{me.preventDefault(),me.stopPropagation(),be(me.dataTransfer.files)},[be]),he=O.useCallback(me=>{me.preventDefault(),me.stopPropagation()},[]),Ne=O.useCallback(me=>{s(qe=>qe.filter((Te,Ke)=>Ke!==me))},[]),De=t.trim()&&!P;return y.jsxDEV("div",{style:{display:"flex",height:"100%"},onDrop:Ve,onDragOver:he,children:[y.jsxDEV("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[y.jsxDEV("div",{style:{padding:"var(--sp-2)"},children:y.jsxDEV("button",{onClick:ne,disabled:P,"aria-label":"New conversation",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.15)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:P?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:P?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:452,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:451,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"0 var(--sp-2) var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:[M.length===0&&y.jsxDEV("div",{style:{padding:"var(--sp-4) var(--sp-2)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"No conversations yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:492,columnNumber:13},this),M.map(me=>y.jsxDEV(Cee,{conv:me,isActive:me.id===j,onSelect:()=>G(me.id),onDelete:()=>oe(me.id)},me.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:505,columnNumber:13},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:481,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:440,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"4px var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",gap:2},children:[y.jsxDEV("button",{onClick:()=>l(me=>Math.max(me-1,0)),disabled:o===0,title:"Decrease font size","aria-label":"Decrease font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:o===0?"var(--text-muted)":"var(--text-secondary)",cursor:o===0?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,lineHeight:1.4,opacity:o===0?.35:.7},children:"A-"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:537,columnNumber:11},this),y.jsxDEV("button",{onClick:()=>l(me=>Math.min(me+1,Sm.length-1)),disabled:o===Sm.length-1,title:"Increase font size","aria-label":"Increase font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:o===Sm.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:o===Sm.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:o===Sm.length-1?.35:.7},children:"A+"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:558,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:526,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[U.length===0&&!P&&y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[y.jsxDEV("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--accent)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:603,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:619,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:628,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:592,columnNumber:13},this),U.map(me=>y.jsxDEV(Aee,{message:me,fontSize:Sm[o]},me.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:641,columnNumber:13},this)),P&&z&&y.jsxDEV("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)"},children:y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${Sm[o]}rem`,lineHeight:1.55},children:[y.jsxDEV(AR,{content:z},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:664,columnNumber:17},this),y.jsxDEV("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:665,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:657,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:645,columnNumber:13},this),P&&!z&&y.jsxDEV("div",{style:{alignSelf:"flex-start",display:"flex",flexDirection:"column",gap:4,padding:"10px 14px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:695,columnNumber:17},this),K||"Thinking..."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:694,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:682,columnNumber:13},this),te&&y.jsxDEV("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:te},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:711,columnNumber:13},this),y.jsxDEV("div",{ref:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:728,columnNumber:11},this),A&&A.length>0&&y.jsxDEV("div",{style:{borderTop:"1px solid #313244",marginTop:"8px"},children:y.jsxDEV(Nee,{components:A},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:732,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:731,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:582,columnNumber:9},this),y.jsxDEV("div",{ref:T,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[y.jsxDEV("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:y.jsxDEV(bee,{commands:m3,filter:h,selectedIndex:g,onSelect:ee,visible:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:748,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:747,columnNumber:11},this),n.length>0&&y.jsxDEV("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((me,qe)=>y.jsxDEV(Dee,{file:me,onRemove:()=>Ne(qe)},`${me.name}-${qe}`,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:768,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:759,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[y.jsxDEV("button",{onClick:()=>{var me;return(me=S.current)==null?void 0:me.click()},disabled:P,title:"Attach files (text only, max 500KB)",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",cursor:P?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:P?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:783,columnNumber:13},this),y.jsxDEV("input",{ref:S,type:"file",multiple:!0,style:{display:"none"},onChange:me=>be(me.target.files)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:804,columnNumber:13},this),y.jsxDEV("textarea",{ref:E,className:"input",value:t,onChange:Z,onKeyDown:ae,placeholder:"Type a message... (/ for commands)",disabled:P,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${Sm[o]}rem`}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:813,columnNumber:13},this),y.jsxDEV("button",{onClick:B,disabled:!De,"aria-label":"Send",className:De?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:De?"pointer":"not-allowed",opacity:De?1:.4,flexShrink:0,height:36},children:"Send"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:835,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:774,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:738,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:517,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:431,columnNumber:5},this)}const Ree={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)",failed:"var(--status-error)"},jee={planned:"planejado",executing:"executando",done:"finalizado",failed:"falhou"};function kee({task:t,selected:e,onClick:n,onDelete:s}){const o=Ree[t.status],l=t.status==="executing",u=h=>{h.dataTransfer.setData("text/plain",`task:${t.id}`),h.dataTransfer.effectAllowed="move",h.currentTarget.style.opacity="0.5"},f=h=>{h.currentTarget.style.opacity="1"};return y.jsxDEV("div",{draggable:!t.activity_id,onDragStart:u,onDragEnd:f,onClick:()=>n==null?void 0:n(t),"data-testid":`task-card-${t.id}`,style:{background:e?"var(--surface-4)":"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"12px 14px",marginBottom:"var(--sp-2)",border:"1px solid",borderColor:e?"var(--accent)":l?o:"var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out), opacity 0.15s ease",cursor:"pointer"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:o,padding:"2px 8px",borderRadius:"var(--radius-full)",border:`1px solid ${o}`,letterSpacing:"0.02em"},children:jee[t.status]},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:88,columnNumber:9},this),s&&y.jsxDEV("button",{onClick:h=>{h.stopPropagation(),s(t.id)},style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.7rem",padding:"0 2px",lineHeight:1,opacity:.5,transition:"opacity 0.15s, color 0.15s"},onMouseEnter:h=>{h.currentTarget.style.opacity="1",h.currentTarget.style.color="var(--status-error)"},onMouseLeave:h=>{h.currentTarget.style.opacity="0.5",h.currentTarget.style.color="var(--text-muted)"},title:"Delete task",children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:101,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:82,columnNumber:7},this),y.jsxDEV("div",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",marginBottom:t.description?6:0,lineHeight:1.4},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:124,columnNumber:7},this),t.description&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:136,columnNumber:9},this),t.agent_name&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{children:"🤖"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:160,columnNumber:11},this),t.agent_name]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:151,columnNumber:9},this),t.step_id&&!t.agent_name&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--accent-dim)",marginTop:2},children:["◆"," checkpoint"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:167,columnNumber:9},this),t.triggered_by&&t.triggered_by!=="dashboard"&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:4,opacity:.7},children:[t.triggered_by==="chat"?"💬":t.triggered_by==="schedule"?"⏰":t.triggered_by==="chain"?"🔗":""," ",t.triggered_by]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:179,columnNumber:9},this),t.activity_id&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--accent-dim)",marginTop:4,padding:"1px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-full)",display:"inline-block"},children:t.squad_code},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:192,columnNumber:9},this),t.result&&y.jsxDEV("div",{style:{marginTop:6,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-active)",display:"flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--status-active)",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:217,columnNumber:11},this),"has output"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:208,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:60,columnNumber:5},this)}function Mee({activityId:t,squadCode:e,taskStatus:n}){const[s,o]=O.useState(""),[l,u]=O.useState(!1),[f,h]=O.useState(!1),p=O.useRef(null),g=n==="executing";O.useEffect(()=>{t&&(g||(u(!0),fetch(`/api/activities/${t}/logs?format=text`,{credentials:"include"}).then(E=>E.json()).then(E=>{o(E.text??""),u(!1)}).catch(()=>{o(""),u(!1)})))},[t,g]),O.useEffect(()=>{if(!g||!e)return;o("");const E=S=>{const T=S.detail;T&&((T.type==="schedule:chunk"||T.type==="chat:chunk")&&T.squadName===e&&o(D=>D+(T.delta??"")),T.type==="chat:activity"&&T.squadName===e&&o(D=>D+`
792
+ `,1;if(xl>1e5&&xl>_t.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rn+=Ft,Ft.length}const Bs=ii($e);if(!Bs)throw qn(In.replace("{}",$e)),new Error('Unknown language: "'+$e+'"');const Ea=Fn(Bs);let mo="",jt=Xt||Ea;const Cc={},Sr=new ot.__emitter(ot);bl();let Rn="",_d=0,xu=0,xl=0,oi=!1;try{if(Bs.__emitTokens)Bs.__emitTokens(Et,Sr);else{for(jt.matcher.considerAll();;){xl++,oi?oi=!1:jt.matcher.considerAll(),jt.matcher.lastIndex=xu;const it=jt.matcher.exec(Et);if(!it)break;const _t=Et.substring(xu,it.index),Ft=Go(_t,it);xu=it.index+Ft}Go(Et.substring(xu))}return Sr.finalize(),mo=Sr.toHTML(),{language:$e,value:mo,relevance:_d,illegal:!1,_emitter:Sr,_top:jt}}catch(it){if(it.message&&it.message.includes("Illegal"))return{language:$e,value:ie(Et),illegal:!0,relevance:0,_illegalBy:{message:it.message,index:xu,context:Et.slice(xu-100,xu+100),mode:it.mode,resultSoFar:mo},_emitter:Sr};if(mn)return{language:$e,value:ie(Et),illegal:!1,relevance:0,errorRaised:it,_emitter:Sr,_top:jt};throw it}}function ba($e){const Et={value:ie($e),illegal:!1,relevance:0,_top:ft,_emitter:new ot.__emitter(ot)};return Et._emitter.addText($e),Et}function fu($e,Et){Et=Et||ot.languages||Object.keys(Ce);const $t=ba($e),Xt=Et.filter(ii).filter(Nr).map(bs=>ml(bs,$e,!1));Xt.unshift($t);const pn=Xt.sort((bs,Ls)=>{if(bs.relevance!==Ls.relevance)return Ls.relevance-bs.relevance;if(bs.language&&Ls.language){if(ii(bs.language).supersetOf===Ls.language)return 1;if(ii(Ls.language).supersetOf===bs.language)return-1}return 0}),[ns,Ir]=pn,ho=ns;return ho.secondBest=Ir,ho}function Oi($e,Et,$t){const Xt=Et&&Ie[Et]||$t;$e.classList.add("hljs"),$e.classList.add(`language-${Xt}`)}function es($e){let Et=null;const $t=Dn($e);if(wt($t))return;if(zs("before:highlightElement",{el:$e,language:$t}),$e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$e);return}if($e.children.length>0&&(ot.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($e)),ot.throwUnescapedHTML))throw new jr("One of your code blocks includes unescaped HTML.",$e.innerHTML);Et=$e;const Xt=Et.textContent,pn=$t?dr(Xt,{language:$t,ignoreIllegals:!0}):fu(Xt);$e.innerHTML=pn.value,$e.dataset.highlighted="yes",Oi($e,$t,pn.language),$e.result={language:pn.language,re:pn.relevance,relevance:pn.relevance},pn.secondBest&&($e.secondBest={language:pn.secondBest.language,relevance:pn.secondBest.relevance}),zs("after:highlightElement",{el:$e,result:pn,text:Xt})}function Fo($e){ot=Se(ot,$e)}const hu=()=>{fo(),ke("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Dc(){fo(),ke("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let co=!1;function fo(){function $e(){fo()}if(document.readyState==="loading"){co||window.addEventListener("DOMContentLoaded",$e,!1),co=!0;return}document.querySelectorAll(ot.cssSelector).forEach(es)}function pl($e,Et){let $t=null;try{$t=Et(ue)}catch(Xt){if(qn("Language definition for '{}' could not be registered.".replace("{}",$e)),mn)qn(Xt);else throw Xt;$t=ft}$t.name||($t.name=$e),Ce[$e]=$t,$t.rawDefinition=Et.bind(null,ue),$t.aliases&&pu($t.aliases,{languageName:$e})}function xa($e){delete Ce[$e];for(const Et of Object.keys(Ie))Ie[Et]===$e&&delete Ie[Et]}function mu(){return Object.keys(Ce)}function ii($e){return $e=($e||"").toLowerCase(),Ce[$e]||Ce[Ie[$e]]}function pu($e,{languageName:Et}){typeof $e=="string"&&($e=[$e]),$e.forEach($t=>{Ie[$t.toLowerCase()]=Et})}function Nr($e){const Et=ii($e);return Et&&!Et.disableAutodetect}function vd($e){$e["before:highlightBlock"]&&!$e["before:highlightElement"]&&($e["before:highlightElement"]=Et=>{$e["before:highlightBlock"](Object.assign({block:Et.el},Et))}),$e["after:highlightBlock"]&&!$e["after:highlightElement"]&&($e["after:highlightElement"]=Et=>{$e["after:highlightBlock"](Object.assign({block:Et.el},Et))})}function ts($e){vd($e),xt.push($e)}function Ns($e){const Et=xt.indexOf($e);Et!==-1&&xt.splice(Et,1)}function zs($e,Et){const $t=$e;xt.forEach(function(Xt){Xt[$t]&&Xt[$t](Et)})}function gl($e){return ke("10.7.0","highlightBlock will be removed entirely in v12.0"),ke("10.7.0","Please use highlightElement now."),es($e)}Object.assign(ue,{highlight:dr,highlightAuto:fu,highlightAll:fo,highlightElement:es,highlightBlock:gl,configure:Fo,initHighlighting:hu,initHighlightingOnLoad:Dc,registerLanguage:pl,unregisterLanguage:xa,listLanguages:mu,getLanguage:ii,registerAliases:pu,autoDetection:Nr,inherit:Se,addPlugin:ts,removePlugin:Ns}),ue.debugMode=function(){mn=!1},ue.safeMode=function(){mn=!0},ue.versionString=Un,ue.regex={concat:T,lookahead:v,either:A,optional:S,anyNumberOfTimes:E};for(const $e in qe)typeof qe[$e]=="object"&&t(qe[$e]);return Object.assign(ue,qe),ue},yt=gt({});return yt.newInstance=()=>gt({}),hT=yt,yt.HighlightJS=yt,yt.default=yt,hT}var lee=aee();const uee=Jf(lee),h3={},cee="hljs-";function dee(t){const e=uee.newInstance();return t&&l(t),{highlight:n,highlightAuto:s,listLanguages:o,register:l,registerAlias:u,registered:f};function n(h,p,g){ge(typeof h=="string","expected `string` as `name`"),ge(typeof p=="string","expected `string` as `value`");const x=g||h3,v=typeof x.prefix=="string"?x.prefix:cee;if(!e.getLanguage(h))throw new Error("Unknown language: `"+h+"` is not registered");e.configure({__emitter:fee,classPrefix:v});const E=e.highlight(p,{ignoreIllegals:!0,language:h});if(E.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:E.errorRaised});const S=E._emitter.root,T=S.data;return T.language=E.language,T.relevance=E.relevance,S}function s(h,p){ge(typeof h=="string","expected `string` as `value`");const x=(p||h3).subset||o();let v=-1,E=0,S;for(;++v<x.length;){const T=x[v];if(!e.getLanguage(T))continue;const D=n(T,h,p);D.data&&D.data.relevance!==void 0&&D.data.relevance>E&&(E=D.data.relevance,S=D)}return S||{type:"root",children:[],data:{language:void 0,relevance:E}}}function o(){return e.listLanguages()}function l(h,p){if(typeof h=="string")ge(p!==void 0,"expected `grammar`"),e.registerLanguage(h,p);else{let g;for(g in h)Object.hasOwn(h,g)&&e.registerLanguage(g,h[g])}}function u(h,p){if(typeof h=="string")ge(p!==void 0),e.registerAliases(typeof p=="string"?p:[...p],{languageName:h});else{let g;for(g in h)if(Object.hasOwn(h,g)){const x=h[g];e.registerAliases(typeof x=="string"?x:[...x],{languageName:g})}}}function f(h){return!!e.getLanguage(h)}}class fee{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){const s=this.stack[this.stack.length-1],o=e.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):s.children.push(...o)}openNode(e){const n=this,s=e.split(".").map(function(u,f){return f?u+"_".repeat(f):n.options.classPrefix+u}),o=this.stack[this.stack.length-1],l={type:"element",tagName:"span",properties:{className:s},children:[]};o.children.push(l),this.stack.push(l)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const hee={};function mee(t){const e=t||hee,n=e.aliases,s=e.detect||!1,o=e.languages||oee,l=e.plainText,u=e.prefix,f=e.subset;let h="hljs";const p=dee(o);if(n&&p.registerAlias(n),u){const g=u.indexOf("-");h=g===-1?u:u.slice(0,g)}return function(g,x){gD(g,"element",function(v,E,S){if(v.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const T=pee(v);if(T===!1||!T&&!s||T&&l&&l.includes(T))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(h)||v.properties.className.unshift(h);const D=MZ(v,{whitespace:"pre"});let A;try{A=T?p.highlight(T,D,{prefix:u}):p.highlightAuto(D,{prefix:u,subset:f})}catch(M){const j=M;if(T&&/Unknown language/.test(j.message)){x.message("Cannot highlight as `"+T+"`, it’s not registered",{ancestors:[S,v],cause:j,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw j}!T&&A.data&&A.data.language&&v.properties.className.push("language-"+A.data.language),A.children.length>0&&(v.children=A.children)})}}function pee(t){const e=t.properties.className;let n=-1;if(!Array.isArray(e))return;let s;for(;++n<e.length;){const o=String(e[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!s&&o.slice(0,5)==="lang-"&&(s=o.slice(5)),!s&&o.slice(0,9)==="language-"&&(s=o.slice(9))}return s}function gee({text:t}){const[e,n]=O.useState(!1),s=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return y.jsxDEV("button",{onClick:s,style:{position:"absolute",top:6,right:6,background:"var(--surface-4)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:e?"var(--status-active)":"var(--text-muted)",fontSize:"0.65rem",fontFamily:"var(--font-mono)",padding:"2px 8px",cursor:"pointer",transition:"color var(--duration-fast) var(--ease-out)"},children:e?"Copied!":"Copy"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:21,columnNumber:5},this)}function AR({content:t}){return y.jsxDEV("div",{className:"markdown-message",children:y.jsxDEV(hW,{remarkPlugins:[DZ],rehypePlugins:[mee],components:{pre({children:e,...n}){const s=Array.isArray(e)?e.find(l=>{var u,f;return(l==null?void 0:l.type)==="code"||((f=(u=l==null?void 0:l.props)==null?void 0:u.node)==null?void 0:f.tagName)==="code"}):e,o=typeof s=="object"&&s!==null&&"props"in s?CR(s.props.children):"";return y.jsxDEV("div",{style:{position:"relative"},children:[y.jsxDEV(gee,{text:o},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:64,columnNumber:17},this),y.jsxDEV("pre",{...n,style:{background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"12px 14px",paddingTop:28,margin:"8px 0",overflowX:"auto",fontSize:"0.78rem",lineHeight:1.6,fontFamily:"var(--font-mono)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:65,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:63,columnNumber:15},this)},code({className:e,children:n,...s}){return e?y.jsxDEV("code",{className:e,...s,children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:106,columnNumber:15},this):y.jsxDEV("code",{...s,style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"1px 5px",fontSize:"0.82em",fontFamily:"var(--font-mono)",color:"var(--accent)"},children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:89,columnNumber:17},this)},a({href:e,children:n,...s}){return y.jsxDEV("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",textDecoration:"none"},...s,children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:113,columnNumber:15},this)},table({children:e,...n}){return y.jsxDEV("div",{style:{overflowX:"auto",margin:"8px 0"},children:y.jsxDEV("table",{...n,style:{borderCollapse:"collapse",width:"100%",fontSize:"0.82rem"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:127,columnNumber:17},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:126,columnNumber:15},this)},th({children:e,...n}){return y.jsxDEV("th",{...n,style:{borderBottom:"2px solid var(--border-default)",padding:"6px 10px",textAlign:"left",fontWeight:600,color:"var(--text-primary)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:142,columnNumber:15},this)},td({children:e,...n}){return y.jsxDEV("td",{...n,style:{borderBottom:"1px solid var(--border-subtle)",padding:"5px 10px",color:"var(--text-secondary)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:158,columnNumber:15},this)},blockquote({children:e,...n}){return y.jsxDEV("blockquote",{...n,style:{borderLeft:"3px solid var(--accent-dim)",margin:"8px 0",padding:"4px 12px",color:"var(--text-secondary)",background:"rgba(0, 200, 255, 0.04)",borderRadius:"0 var(--radius-xs) var(--radius-xs) 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:172,columnNumber:15},this)},hr(){return y.jsxDEV("hr",{style:{border:"none",borderTop:"1px solid var(--border-default)",margin:"12px 0"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:189,columnNumber:15},this)},ul({children:e,...n}){return y.jsxDEV("ul",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:200,columnNumber:15},this)},ol({children:e,...n}){return y.jsxDEV("ol",{...n,style:{paddingLeft:20,margin:"4px 0"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:207,columnNumber:15},this)},li({children:e,...n}){return y.jsxDEV("li",{...n,style:{marginBottom:2},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:214,columnNumber:15},this)},h1({children:e,...n}){return y.jsxDEV("h1",{...n,style:{fontSize:"1.3em",fontWeight:700,margin:"12px 0 6px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:221,columnNumber:15},this)},h2({children:e,...n}){return y.jsxDEV("h2",{...n,style:{fontSize:"1.15em",fontWeight:600,margin:"10px 0 4px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:228,columnNumber:15},this)},h3({children:e,...n}){return y.jsxDEV("h3",{...n,style:{fontSize:"1.05em",fontWeight:600,margin:"8px 0 4px"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:235,columnNumber:15},this)},p({children:e,...n}){return y.jsxDEV("p",{...n,style:{margin:"4px 0",lineHeight:1.6},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:242,columnNumber:15},this)}},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:46,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/MarkdownMessage.tsx",lineNumber:45,columnNumber:5},this)}function CR(t){var e;return typeof t=="string"?t:Array.isArray(t)?t.map(CR).join(""):(e=t==null?void 0:t.props)!=null&&e.children?CR(t.props.children):""}function bee({commands:t,filter:e,selectedIndex:n,onSelect:s,visible:o}){const l=O.useRef(null),u=O.useRef(null),f=t.filter(h=>h.command.toLowerCase().includes(e.toLowerCase())||h.description.toLowerCase().includes(e.toLowerCase()));return O.useEffect(()=>{var h;(h=u.current)==null||h.scrollIntoView({block:"nearest"})},[n]),!o||f.length===0?null:y.jsxDEV("div",{ref:l,style:{position:"absolute",bottom:"100%",left:0,right:0,marginBottom:4,background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",boxShadow:"var(--shadow-lg)",maxHeight:280,overflowY:"auto",zIndex:100,animation:"fadeInUp 0.15s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{padding:"8px 12px 4px",fontSize:"0.65rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Commands"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:58,columnNumber:7},this),f.map((h,p)=>{const g=p===n;return y.jsxDEV("div",{ref:g?u:void 0,onClick:()=>s(h),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",cursor:"pointer",background:g?"var(--accent-glow)":"transparent",borderLeft:g?"2px solid var(--accent)":"2px solid transparent",transition:"background var(--duration-fast) var(--ease-out)"},onMouseEnter:x=>{g||(x.currentTarget.style.background="var(--surface-3)")},onMouseLeave:x=>{g||(x.currentTarget.style.background="transparent")},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:600,color:g?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap"},children:["/",h.command,h.args&&y.jsxDEV("span",{style:{color:"var(--text-muted)",fontWeight:400},children:[" ",h.args]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:109,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:98,columnNumber:13},this),y.jsxDEV("span",{style:{fontSize:"0.75rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:112,columnNumber:13},this)]},h.command,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:73,columnNumber:11},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/SlashCommandMenu.tsx",lineNumber:40,columnNumber:5},this)}const m3=[{command:"expxagents",description:"Show main menu"},{command:"expxagents create",args:"[description]",description:"Design a new squad"},{command:"expxagents run",args:"<name>",description:"Execute a squad pipeline"},{command:"expxagents list",description:"List all squads"},{command:"expxagents edit",args:"<name>",description:"Modify a squad"},{command:"expxagents delete",args:"<name>",description:"Delete a squad"},{command:"expxagents skills",description:"Browse skills"},{command:"expxagents install",args:"<name>",description:"Install a skill"},{command:"expxagents uninstall",args:"<name>",description:"Remove a skill"},{command:"expxagents dashboard",description:"Open virtual office"},{command:"expxagents virtual-office",description:"Open virtual office in browser"},{command:"expxagents jarvis",description:"Open Jarvis voice assistant"},{command:"expxagents help",description:"Show help text"}];function xee({c:t}){return y.jsxDEV("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px",minWidth:"120px"},children:[y.jsxDEV("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#cdd6f4"},children:[t.value,t.unit?` ${t.unit}`:""]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:10,columnNumber:7},this),y.jsxDEV("div",{style:{fontSize:"12px",color:"#a6adc8",marginTop:"4px"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:13,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:9,columnNumber:5},this)}function yee({c:t}){const e=Math.round(t.value*100);return y.jsxDEV("div",{style:{width:"100%"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"4px"},children:[y.jsxDEV("span",{style:{fontSize:"12px",color:"#a6adc8"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:23,columnNumber:9},this),y.jsxDEV("span",{style:{fontSize:"12px",color:"#cdd6f4"},children:[e,"%"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:24,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:22,columnNumber:7},this),y.jsxDEV("div",{style:{height:"6px",background:"#313244",borderRadius:"3px"},children:y.jsxDEV("div",{style:{height:"100%",width:`${e}%`,background:"#89b4fa",borderRadius:"3px",transition:"width 0.3s"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:27,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:26,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:21,columnNumber:5},this)}function vee({c:t}){return y.jsxDEV("div",{children:[t.title&&y.jsxDEV("div",{style:{fontSize:"13px",fontWeight:600,color:"#cdd6f4",marginBottom:"8px"},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:45,columnNumber:9},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{children:t.columns.map((e,n)=>y.jsxDEV("th",{style:{textAlign:"left",padding:"4px 8px",color:"#a6adc8",borderBottom:"1px solid #313244"},children:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:53,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:51,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:50,columnNumber:9},this),y.jsxDEV("tbody",{children:t.rows.map((e,n)=>y.jsxDEV("tr",{children:e.map((s,o)=>y.jsxDEV("td",{style:{padding:"4px 8px",color:"#cdd6f4",borderBottom:"1px solid #1e1e2e"},children:s},o,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:71,columnNumber:17},this))},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:69,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:67,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:43,columnNumber:5},this)}function Eee({c:t}){return y.jsxDEV("div",{style:{padding:"12px",background:"#1e1e2e",borderRadius:"8px"},children:[y.jsxDEV("div",{style:{fontWeight:600,color:"#cdd6f4",marginBottom:"6px"},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:89,columnNumber:7},this),y.jsxDEV("div",{style:{fontSize:"13px",color:"#a6adc8"},children:t.body},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:90,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:88,columnNumber:5},this)}const _ee={green:"#a6e3a1",yellow:"#f9e2af",red:"#f38ba8",blue:"#89b4fa"};function wee({c:t}){return y.jsxDEV("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"12px",fontSize:"11px",fontWeight:600,color:"#1e1e2e",background:_ee[t.color]??"#a6adc8"},children:t.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:104,columnNumber:5},this)}function Nee({components:t}){return t.length===0?null:y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"12px",padding:"12px"},children:t.map((e,n)=>{switch(e.type){case"metric":return y.jsxDEV(xee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:127,columnNumber:35},this);case"progress":return y.jsxDEV(yee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:128,columnNumber:35},this);case"table":return y.jsxDEV(vee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:129,columnNumber:35},this);case"card":return y.jsxDEV(Eee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:130,columnNumber:35},this);case"badge":return y.jsxDEV(wee,{c:e},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:131,columnNumber:35},this)}})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/UICanvas.tsx",lineNumber:124,columnNumber:5},this)}const lS="_expxagents",Sm=[.72,.78,.85,.95,1.08,1.2],See=2;function Dee({file:t,onRemove:e}){return y.jsxDEV("div",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"2px 8px",fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:"var(--accent)",maxWidth:180},children:[y.jsxDEV("span",{style:{opacity:.6},children:"📎"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:31,columnNumber:7},this),y.jsxDEV("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:32,columnNumber:7},this),y.jsxDEV("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",padding:0,fontSize:"0.8rem",lineHeight:1},"aria-label":`Remove ${t.name}`,children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:41,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:16,columnNumber:5},this)}function Aee({message:t,fontSize:e}){if(t.role==="agent_dm")return y.jsxDEV("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:t.agentName},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:77,columnNumber:9},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:y.jsxDEV(AR,{content:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:96,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:89,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:64,columnNumber:7},this);const n=t.role==="user";return y.jsxDEV("div",{"data-role":t.role,style:{alignSelf:n?"flex-end":"flex-start",background:n?"var(--user-bubble)":"var(--agent-bubble)",border:n?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:n?"75%":"85%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${e}rem`,lineHeight:1.55},children:n?y.jsxDEV("span",{style:{whiteSpace:"pre-wrap"},children:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:127,columnNumber:11},this):y.jsxDEV(AR,{content:t.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:129,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:119,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:104,columnNumber:5},this)}function Cee({conv:t,isActive:e,onSelect:n,onDelete:s}){const[o,l]=O.useState(!1),u=new Date(t.createdAt),f=u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),h=u.toLocaleDateString([],{day:"2-digit",month:"2-digit"});return y.jsxDEV("div",{onClick:n,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{padding:"8px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:e?"var(--accent-glow)":o?"var(--surface-3)":"transparent",border:e?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:8},children:[y.jsxDEV("div",{style:{flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{fontSize:"0.72rem",fontFamily:"var(--font-mono)",color:e?"var(--accent)":"var(--text-secondary)",fontWeight:e?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.preview||"New conversation"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:171,columnNumber:9},this),y.jsxDEV("div",{style:{fontSize:"0.6rem",fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2},children:[h," ",f]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:184,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:170,columnNumber:7},this),o&&y.jsxDEV("button",{onClick:p=>{p.stopPropagation(),s()},title:"Delete conversation","aria-label":"Delete conversation",style:{background:"none",border:"none",color:"var(--status-error)",cursor:"pointer",padding:"2px 4px",fontSize:"0.75rem",lineHeight:1,opacity:.7,flexShrink:0},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:196,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:154,columnNumber:5},this)}function Tee(){const[t,e]=O.useState(""),[n,s]=O.useState([]),[o,l]=O.useState(See),[u,f]=O.useState(!1),[h,p]=O.useState(""),[g,x]=O.useState(0),v=O.useRef(null),E=O.useRef(null),S=O.useRef(null),T=O.useRef(null),D=Ps(me=>me.selectedSquad),A=Ps(me=>me.uiComponents[D??""]),M=Ei(me=>me.conversations),j=Ei(me=>me.conversationId),U=Ei(me=>me.messages),P=Ei(me=>me.streaming),z=Ei(me=>me.streamingText),K=Ei(me=>me.activity),te=Ei(me=>me.error),H=Ei(me=>me.addUserMessage),I=Ei(me=>me.startStreaming),F=Ei(me=>me.loadHistory),$=Ei(me=>me.selectConversation),J=Ei(me=>me.deleteConversation);O.useEffect(()=>{F(lS)},[F]),O.useEffect(()=>{var me,qe;(qe=(me=v.current)==null?void 0:me.scrollIntoView)==null||qe.call(me,{behavior:"smooth"})},[U,z]);const X=O.useCallback(()=>{const me=E.current;me&&(me.style.height="auto",me.style.height=Math.min(me.scrollHeight,200)+"px")},[]);O.useEffect(()=>{X()},[t,X]);const Q=O.useCallback(me=>{if(me.startsWith("/")){const qe=me.slice(1);p(qe),f(!0),x(0)}else f(!1)},[]),L=O.useCallback(()=>m3.filter(me=>me.command.toLowerCase().includes(h.toLowerCase())||me.description.toLowerCase().includes(h.toLowerCase())),[h]),ee=O.useCallback(me=>{var qe;e("/"+me.command+(me.args?" ":"")),f(!1),(qe=E.current)==null||qe.focus()},[]),ne=O.useCallback(()=>{P||YB(lS)},[P]),oe=O.useCallback(me=>{P||J(me,lS)},[P,J]),G=O.useCallback(me=>{P||me===j||$(me)},[P,j,$]),B=O.useCallback(()=>{const me=t.trim();!me||P||(H(me),I(),QO(lS,me,n.length>0?n:void 0),e(""),s([]),f(!1),E.current&&(E.current.style.height="auto"))},[t,P,n,H,I]),ae=O.useCallback(me=>{if(u){const qe=L();if(me.key==="ArrowDown"){me.preventDefault(),x(Te=>Math.min(Te+1,qe.length-1));return}if(me.key==="ArrowUp"){me.preventDefault(),x(Te=>Math.max(Te-1,0));return}if(me.key==="Enter"&&!me.shiftKey){me.preventDefault(),qe[g]&&ee(qe[g]);return}if(me.key==="Escape"){me.preventDefault(),f(!1);return}if(me.key==="Tab"){me.preventDefault(),qe[g]&&ee(qe[g]);return}}me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),B())},[u,L,g,ee,B]),Z=O.useCallback(me=>{const qe=me.target.value;e(qe),Q(qe)},[Q]),be=O.useCallback(async me=>{var Te;if(!me)return;const qe=[];for(const Ke of Array.from(me))if(!(Ke.size>512e3))try{const et=await Ke.text();qe.push({name:Ke.name,content:et})}catch{}s(Ke=>[...Ke,...qe]),(Te=E.current)==null||Te.focus()},[]),Ve=O.useCallback(me=>{me.preventDefault(),me.stopPropagation(),be(me.dataTransfer.files)},[be]),he=O.useCallback(me=>{me.preventDefault(),me.stopPropagation()},[]),Ne=O.useCallback(me=>{s(qe=>qe.filter((Te,Ke)=>Ke!==me))},[]),De=t.trim()&&!P;return y.jsxDEV("div",{style:{display:"flex",height:"100%"},onDrop:Ve,onDragOver:he,children:[y.jsxDEV("div",{style:{width:220,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",flexShrink:0},children:[y.jsxDEV("div",{style:{padding:"var(--sp-2)"},children:y.jsxDEV("button",{onClick:ne,disabled:P,"aria-label":"New conversation",style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.15)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:P?"not-allowed":"pointer",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,letterSpacing:"0.02em",opacity:P?.5:1,transition:"all var(--duration-fast) var(--ease-out)"},children:"+ New Chat"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:452,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:451,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"0 var(--sp-2) var(--sp-2)",display:"flex",flexDirection:"column",gap:2},children:[M.length===0&&y.jsxDEV("div",{style:{padding:"var(--sp-4) var(--sp-2)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:"No conversations yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:492,columnNumber:13},this),M.map(me=>y.jsxDEV(Cee,{conv:me,isActive:me.id===j,onSelect:()=>G(me.id),onDelete:()=>oe(me.id)},me.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:505,columnNumber:13},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:481,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:440,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:"4px var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)",gap:2},children:[y.jsxDEV("button",{onClick:()=>l(me=>Math.max(me-1,0)),disabled:o===0,title:"Decrease font size","aria-label":"Decrease font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:o===0?"var(--text-muted)":"var(--text-secondary)",cursor:o===0?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,lineHeight:1.4,opacity:o===0?.35:.7},children:"A-"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:537,columnNumber:11},this),y.jsxDEV("button",{onClick:()=>l(me=>Math.min(me+1,Sm.length-1)),disabled:o===Sm.length-1,title:"Increase font size","aria-label":"Increase font size",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",color:o===Sm.length-1?"var(--text-muted)":"var(--text-secondary)",cursor:o===Sm.length-1?"not-allowed":"pointer",padding:"2px 7px",fontFamily:"var(--font-mono)",fontSize:"0.8rem",fontWeight:700,lineHeight:1.4,opacity:o===Sm.length-1?.35:.7},children:"A+"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:558,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:526,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[U.length===0&&!P&&y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:"var(--sp-3)",opacity:.6},children:[y.jsxDEV("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--accent)"},children:"EX"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:603,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.82rem",fontFamily:"var(--font-display)"},children:"ExpxAgents Terminal"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:619,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem",fontFamily:"var(--font-mono)"},children:"Type / to see available commands"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:628,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:592,columnNumber:13},this),U.map(me=>y.jsxDEV(Aee,{message:me,fontSize:Sm[o]},me.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:641,columnNumber:13},this)),P&&z&&y.jsxDEV("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"85%",marginBottom:"var(--sp-2)"},children:y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:`${Sm[o]}rem`,lineHeight:1.55},children:[y.jsxDEV(AR,{content:z},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:664,columnNumber:17},this),y.jsxDEV("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:665,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:657,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:645,columnNumber:13},this),P&&!z&&y.jsxDEV("div",{style:{alignSelf:"flex-start",display:"flex",flexDirection:"column",gap:4,padding:"10px 14px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[y.jsxDEV("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"pulse 1s ease-in-out infinite"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:695,columnNumber:17},this),K||"Thinking..."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:694,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:682,columnNumber:13},this),te&&y.jsxDEV("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:te},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:711,columnNumber:13},this),y.jsxDEV("div",{ref:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:728,columnNumber:11},this),A&&A.length>0&&y.jsxDEV("div",{style:{borderTop:"1px solid #313244",marginTop:"8px"},children:y.jsxDEV(Nee,{components:A},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:732,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:731,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:582,columnNumber:9},this),y.jsxDEV("div",{ref:T,style:{borderTop:"1px solid var(--border-subtle)",background:"var(--surface-1)",position:"relative"},children:[y.jsxDEV("div",{style:{position:"relative",padding:"0 var(--sp-4)"},children:y.jsxDEV(bee,{commands:m3,filter:h,selectedIndex:g,onSelect:ee,visible:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:748,columnNumber:13},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:747,columnNumber:11},this),n.length>0&&y.jsxDEV("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"var(--sp-2) var(--sp-4) 0"},children:n.map((me,qe)=>y.jsxDEV(Dee,{file:me,onRemove:()=>Ne(qe)},`${me.name}-${qe}`,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:768,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:759,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",gap:"var(--sp-2)",alignItems:"flex-end"},children:[y.jsxDEV("button",{onClick:()=>{var me;return(me=S.current)==null?void 0:me.click()},disabled:P,title:"Attach files (text only, max 500KB)",style:{background:"none",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",cursor:P?"not-allowed":"pointer",padding:"6px 8px",fontSize:"1rem",lineHeight:1,opacity:P?.4:.7,transition:"opacity var(--duration-fast) var(--ease-out)",flexShrink:0},"aria-label":"Attach file",children:"📎"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:783,columnNumber:13},this),y.jsxDEV("input",{ref:S,type:"file",multiple:!0,style:{display:"none"},onChange:me=>be(me.target.files)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:804,columnNumber:13},this),y.jsxDEV("textarea",{ref:E,className:"input",value:t,onChange:Z,onKeyDown:ae,placeholder:"Type a message... (/ for commands)",disabled:P,rows:1,style:{flex:1,resize:"none",overflow:"hidden",minHeight:36,maxHeight:200,lineHeight:1.5,fontFamily:"var(--font-mono)",fontSize:`${Sm[o]}rem`}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:813,columnNumber:13},this),y.jsxDEV("button",{onClick:B,disabled:!De,"aria-label":"Send",className:De?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:De?"pointer":"not-allowed",opacity:De?1:.4,flexShrink:0,height:36},children:"Send"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:835,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:774,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:738,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:517,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/ChatView.tsx",lineNumber:431,columnNumber:5},this)}const Ree={planned:"var(--status-idle)",executing:"var(--accent)",done:"var(--status-active)",failed:"var(--status-error)"},jee={planned:"planejado",executing:"executando",done:"finalizado",failed:"falhou"};function kee({task:t,selected:e,onClick:n,onDelete:s}){const o=Ree[t.status],l=t.status==="executing",u=h=>{h.dataTransfer.setData("text/plain",`task:${t.id}`),h.dataTransfer.effectAllowed="move",h.currentTarget.style.opacity="0.5"},f=h=>{h.currentTarget.style.opacity="1"};return y.jsxDEV("div",{draggable:!t.activity_id,onDragStart:u,onDragEnd:f,onClick:()=>n==null?void 0:n(t),"data-testid":`task-card-${t.id}`,style:{background:e?"var(--surface-4)":"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"12px 14px",marginBottom:"var(--sp-2)",border:"1px solid",borderColor:e?"var(--accent)":l?o:"var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out), opacity 0.15s ease",cursor:"pointer"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",fontWeight:600,color:o,padding:"2px 8px",borderRadius:"var(--radius-full)",border:`1px solid ${o}`,letterSpacing:"0.02em"},children:jee[t.status]},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:88,columnNumber:9},this),s&&y.jsxDEV("button",{onClick:h=>{h.stopPropagation(),s(t.id)},style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"0.7rem",padding:"0 2px",lineHeight:1,opacity:.5,transition:"opacity 0.15s, color 0.15s"},onMouseEnter:h=>{h.currentTarget.style.opacity="1",h.currentTarget.style.color="var(--status-error)"},onMouseLeave:h=>{h.currentTarget.style.opacity="0.5",h.currentTarget.style.color="var(--text-muted)"},title:"Delete task",children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:101,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:82,columnNumber:7},this),y.jsxDEV("div",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",marginBottom:t.description?6:0,lineHeight:1.4},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:124,columnNumber:7},this),t.description&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:136,columnNumber:9},this),t.agent_name&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",marginTop:2,display:"flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{children:"🤖"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:160,columnNumber:11},this),t.agent_name]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:151,columnNumber:9},this),t.step_id&&!t.agent_name&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--accent-dim)",marginTop:2},children:["◆"," checkpoint"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:167,columnNumber:9},this),t.triggered_by&&t.triggered_by!=="dashboard"&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--text-muted)",marginTop:4,opacity:.7},children:[t.triggered_by==="chat"?"💬":t.triggered_by==="schedule"?"⏰":t.triggered_by==="chain"?"🔗":""," ",t.triggered_by]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:179,columnNumber:9},this),t.activity_id&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--accent-dim)",marginTop:4,padding:"1px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-full)",display:"inline-block"},children:t.squad_code},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:192,columnNumber:9},this),t.result&&y.jsxDEV("div",{style:{marginTop:6,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--status-active)",display:"flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{style:{width:5,height:5,borderRadius:"50%",background:"var(--status-active)",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:217,columnNumber:11},this),"has output"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:208,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/KanbanCard.tsx",lineNumber:60,columnNumber:5},this)}function Mee({activityId:t,squadCode:e,taskStatus:n}){const[s,o]=O.useState(""),[l,u]=O.useState(!1),[f,h]=O.useState(!1),p=O.useRef(null),g=n==="executing";O.useEffect(()=>{t&&(u(!0),fetch(`/api/activities/${t}/logs?format=text`,{credentials:"include"}).then(E=>E.json()).then(E=>{o(E.text??""),u(!1)}).catch(()=>{o(""),u(!1)}))},[t]),O.useEffect(()=>{if(!g||!e)return;const E=S=>{const T=S.detail;T&&((T.type==="schedule:chunk"||T.type==="chat:chunk")&&T.squadName===e&&o(D=>D+(T.delta??"")),T.type==="chat:activity"&&T.squadName===e&&o(D=>D+`
793
793
  [${T.tool}] ${T.summary}
794
- `))};return window.addEventListener("execution:chunk",E),()=>window.removeEventListener("execution:chunk",E)},[g,e]),O.useEffect(()=>{g&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[s,g]);const x=O.useCallback(()=>{navigator.clipboard.writeText(s).catch(()=>{})},[s]);if(!t)return y.jsxDEV("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No execution linked to this task"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:79,columnNumber:7},this);if(l)return y.jsxDEV("div",{style:{padding:"20px",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"Loading logs..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:91,columnNumber:7},this);const v=f?"none":300;return y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[g&&y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"#f59e0b",animation:"pulse 1.5s infinite",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:108,columnNumber:13},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:g?"Live Output":"Execution Log"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:113,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:106,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[s&&y.jsxDEV("button",{onClick:x,style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--accent-dim)",cursor:"pointer"},children:"copy"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:122,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>h(E=>!E),style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--accent-dim)",cursor:"pointer"},children:f?"collapse":"expand"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:127,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:120,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:103,columnNumber:7},this),y.jsxDEV("div",{ref:p,style:{padding:"10px 12px",background:"#0d1117",borderRadius:"var(--radius-sm)",border:g?"1px solid #f59e0b44":"1px solid var(--border-subtle)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.7rem",color:"#c9d1d9",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:v,overflowY:"auto",minHeight:60},children:s||(g?"Waiting for output...":"No output recorded")},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:135,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:101,columnNumber:5},this)}let mT=0;const p6=[{key:"planned",label:"Planejado",color:"var(--status-idle)",glow:"none"},{key:"executing",label:"Executando",color:"var(--accent)",glow:"var(--accent-glow)"},{key:"done",label:"Finalizado",color:"var(--status-active)",glow:"var(--status-active-glow)"},{key:"failed",label:"Falhou",color:"var(--status-error)",glow:"none"}];function pT(t){if(!t)return"—";const e=new Date(t);return e.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit"})+" "+e.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function gT(t,e){if(!t||!e)return null;const n=new Date(e).getTime()-new Date(t).getTime();if(n<0)return null;if(n<1e3)return`${n}ms`;const s=Math.floor(n/1e3);if(s<60)return`${s}s`;const o=Math.floor(s/60),l=s%60;if(o<60)return`${o}m ${l}s`;const u=Math.floor(o/60),f=o%60;return`${u}h ${f}m`}function Vee(){const t=Ps(Q=>Q.squads),e=Ps(Q=>Q.activeStates),[n,s]=O.useState(null),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(null),[g,x]=O.useState(""),[v,E]=O.useState(""),[S,T]=O.useState(null),[D,A]=O.useState(null),[M,j]=O.useState(!1),U=O.useRef(null);O.useEffect(()=>{var Q;if(M){const L=document.createElement("style");L.textContent='[data-layout="header"],[data-layout="sidebar"],[data-layout="statusbar"]{display:none!important}',document.head.appendChild(L),U.current=L}else(Q=U.current)==null||Q.remove(),U.current=null;return()=>{var L;(L=U.current)==null||L.remove(),U.current=null}},[M]);const P=n;O.useEffect(()=>{if(!P){f([]),A(null);return}const Q=P==="__all__"?"/api/kanban/tasks":`/api/kanban/${P}/tasks`;fetch(Q,{credentials:"include"}).then(L=>L.json()).then(L=>f(Array.isArray(L)?L:[])).catch(()=>f([]))},[P]),O.useEffect(()=>{const Q=L=>{const ee=L.detail;if(!(ee!=null&&ee.activityId)&&!(ee!=null&&ee.squadName)||!P||mT>0)return;const ne=P==="__all__"?"/api/kanban/tasks":`/api/kanban/${P}/tasks`;fetch(ne,{credentials:"include"}).then(oe=>oe.json()).then(oe=>{const G=Array.isArray(oe)?oe:[];f(G),A(B=>B?G.find(Z=>Z.id===B.id)??null:null)}).catch(()=>{})};return window.addEventListener("kanban:task_updated",Q),()=>window.removeEventListener("kanban:task_updated",Q)},[P]);const z=O.useMemo(()=>p6.map(Q=>({...Q,tasks:u.filter(L=>L.status===Q.key).sort((L,ee)=>L.position-ee.position)})),[u]),K=t.filter(Q=>{if(!o)return!0;const L=o.toLowerCase();return Q.name.toLowerCase().includes(L)||Q.code.toLowerCase().includes(L)}),te=O.useCallback(async Q=>{if(!P||!g.trim())return;const L=await fetch(`/api/kanban/${P}/tasks`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:g.trim(),description:v.trim()||void 0,status:Q})});if(L.ok){const ee=await L.json();f(ne=>[...ne,ee]),x(""),E(""),p(null)}},[P,g,v]),H=O.useCallback(async Q=>{if(!P)return;(await fetch(`/api/kanban/${P}/tasks/${Q}`,{method:"DELETE",credentials:"include"})).ok&&(f(ee=>ee.filter(ne=>ne.id!==Q)),(D==null?void 0:D.id)===Q&&A(null))},[P,D]),I=O.useCallback(async(Q,L)=>{if(!P)return;const ee=u.find(oe=>oe.id===Q);if(!ee||ee.status===L)return;const ne=ee.squad_code||P;f(oe=>oe.map(G=>G.id===Q?{...G,status:L}:G)),mT++;try{const oe=await fetch(`/api/kanban/${ne}/tasks/${Q}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:L})});if(oe.ok){const G=await oe.json();f(B=>B.map(ae=>ae.id===Q?G:ae)),(D==null?void 0:D.id)===Q&&A(G),L==="executing"&&QO(ne,`Execute a seguinte tarefa do kanban: ${ee.title}${ee.description?" — "+ee.description:""}`)}else f(G=>G.map(B=>B.id===Q?ee:B))}finally{setTimeout(()=>{mT--},500)}},[P,u,D]),F=O.useCallback(async(Q,L)=>{if(!P)return;const ee=await fetch(`/api/kanban/${P}/tasks/${Q}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({result:L})});if(ee.ok){const ne=await ee.json();f(oe=>oe.map(G=>G.id===Q?ne:G)),A(ne)}},[P]),$=O.useCallback((Q,L)=>{Q.preventDefault(),Q.dataTransfer.dropEffect="move",T(L)},[]),J=O.useCallback(()=>{T(null)},[]),X=O.useCallback((Q,L)=>{Q.preventDefault(),T(null);const ee=Q.dataTransfer.getData("text/plain");if(!ee.startsWith("task:"))return;const ne=ee.replace("task:","");I(ne,L)},[I]);return y.jsxDEV("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[y.jsxDEV("div",{style:{width:240,minWidth:240,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[y.jsxDEV("div",{style:{padding:"8px 14px",borderBottom:"1px solid var(--border-subtle)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:"Squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:253,columnNumber:11},this),y.jsxDEV("button",{onClick:()=>j(Q=>!Q),title:M?"Voltar ao modo normal":"Modo foco — tela cheia",style:{background:M?"rgba(0,200,255,0.1)":"transparent",border:`1px solid ${M?"var(--accent)":"var(--border-subtle)"}`,color:M?"var(--accent)":"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.58rem",padding:"2px 7px",borderRadius:3},children:M?"← Normal":"⛶ Foco"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:257,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:248,columnNumber:9},this),y.jsxDEV("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("input",{type:"text",placeholder:"Search squads...",value:o,onChange:Q=>l(Q.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",outline:"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:273,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:272,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"6px 8px"},children:[y.jsxDEV("button",{onClick:()=>{s("__all__"),A(null)},style:{width:"100%",background:P==="__all__"?"var(--accent-glow)":"none",border:P==="__all__"?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:6},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",flexShrink:0}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:298,columnNumber:13},this),y.jsxDEV("div",{style:{overflow:"hidden"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:P==="__all__"?600:400,color:P==="__all__"?"var(--accent)":"var(--text-primary)"},children:"Todos"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:304,columnNumber:15},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"all squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:311,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:303,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:287,columnNumber:11},this),y.jsxDEV("div",{style:{borderBottom:"1px solid var(--border-subtle)",margin:"4px 0 6px"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:317,columnNumber:11},this),K.map(Q=>{var ne;const L=Q.code===P,ee=!!e[Q.code];return y.jsxDEV("button",{onClick:()=>{s(Q.code),A(null)},style:{width:"100%",background:L?"var(--accent-glow)":"none",border:L?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:2},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:ee?"var(--status-active)":"var(--status-idle)",flexShrink:0}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:335,columnNumber:17},this),y.jsxDEV("div",{style:{overflow:"hidden"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:L?600:400,color:L?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Q.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:341,columnNumber:19},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:[((ne=Q.agents)==null?void 0:ne.length)||0," agents"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:349,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:340,columnNumber:17},this)]},Q.code,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:323,columnNumber:15},this)}),K.length===0&&y.jsxDEV("div",{style:{padding:"16px 10px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:357,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:285,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:242,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:P?y.jsxDEV("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",flex:1,overflow:"auto"},children:z.map((Q,L)=>{const ee=S===Q.key;return y.jsxDEV("div",{"data-testid":`column-${Q.key}`,onDragOver:ne=>$(ne,Q.key),onDragLeave:J,onDrop:ne=>X(ne,Q.key),style:{flex:1,background:ee?"rgba(0, 200, 255, 0.04)":"var(--surface-2)",border:ee?"1px dashed var(--accent)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${L*80}ms both`,transition:"background 0.15s ease, border-color 0.15s ease"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${Q.color}`},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:Q.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:408,columnNumber:23},this),y.jsxDEV("span",{"data-testid":`count-${Q.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:Q.color,background:Q.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${Q.color}`},children:Q.tasks.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:411,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:403,columnNumber:21},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto"},children:Q.tasks.map(ne=>y.jsxDEV(kee,{task:ne,selected:(D==null?void 0:D.id)===ne.id,onClick:A,onDelete:ne.activity_id?void 0:H},ne.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:424,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:422,columnNumber:21},this),h===Q.key?y.jsxDEV("div",{style:{marginTop:"var(--sp-3)",background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"10px 12px",border:"1px solid var(--border-default)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Title",value:g,onChange:ne=>x(ne.target.value),autoFocus:!0,onKeyDown:ne=>{ne.key==="Enter"&&g.trim()&&te(Q.key),ne.key==="Escape"&&(p(null),x(""),E(""))},style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,outline:"none",marginBottom:6}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:441,columnNumber:25},this),y.jsxDEV("textarea",{placeholder:"Description (optional)",value:v,onChange:ne=>E(ne.target.value),onKeyDown:ne=>{ne.key==="Escape"&&(p(null),x(""),E(""))},rows:2,style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none",resize:"none",marginBottom:8}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:455,columnNumber:25},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[y.jsxDEV("button",{onClick:()=>te(Q.key),disabled:!g.trim(),style:{background:g.trim()?"var(--accent)":"var(--surface-4)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:g.trim()?"var(--text-inverse)":"var(--text-muted)",cursor:g.trim()?"pointer":"default"},children:"Add"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:468,columnNumber:27},this),y.jsxDEV("button",{onClick:()=>{p(null),x(""),E("")},style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:477,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:467,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:436,columnNumber:23},this):y.jsxDEV("button",{"data-testid":`add-task-${Q.key}`,onClick:()=>{p(Q.key),x(""),E("")},style:{marginTop:"var(--sp-3)",width:"100%",background:"none",border:"1px dashed var(--border-default)",borderRadius:"var(--radius-sm)",padding:"8px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:ne=>{ne.currentTarget.style.borderColor="var(--accent-dim)",ne.currentTarget.style.color="var(--accent)"},onMouseLeave:ne=>{ne.currentTarget.style.borderColor="var(--border-default)",ne.currentTarget.style.color="var(--text-muted)"},children:"+ New Task"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:488,columnNumber:23},this)]},Q.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:386,columnNumber:19},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:379,columnNumber:13},this),D&&y.jsxDEV(Uee,{task:D,onClose:()=>A(null),onMove:I,onUpdateResult:F},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:510,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:377,columnNumber:11},this):y.jsxDEV("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[y.jsxDEV("span",{style:{fontSize:"1.5rem",color:"var(--text-muted)",opacity:.4},children:"▦"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:371,columnNumber:13},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:372,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:367,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:365,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:240,columnNumber:5},this)}function Uee({task:t,onClose:e,onMove:n,onUpdateResult:s}){const[o,l]=O.useState(!1),[u,f]=O.useState(t.result||"");O.useEffect(()=>{f(t.result||""),l(!1)},[t.id,t.result]);const h=()=>{s(t.id,u),l(!1)},p=t.status==="planned"?"var(--status-idle)":t.status==="executing"?"var(--accent)":t.status==="failed"?"var(--status-error)":"var(--status-active)";return y.jsxDEV("div",{"data-testid":"task-detail-panel",style:{width:360,minWidth:360,borderLeft:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"slideInRight 0.2s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,color:p,padding:"2px 10px",borderRadius:"var(--radius-full)",border:`1px solid ${p}`,textTransform:"uppercase"},children:t.status==="planned"?"planejado":t.status==="executing"?"executando":t.status==="failed"?"falhou":"finalizado"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:572,columnNumber:9},this),y.jsxDEV("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"0 4px"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:579,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:568,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"16px"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:8,lineHeight:1.3},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:589,columnNumber:9},this),t.description&&y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.5,marginBottom:16},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:598,columnNumber:11},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:20,padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)"},children:[y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Created"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:612,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.created_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:615,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:611,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Started"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:620,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.started_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:623,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:619,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Finished"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:628,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.finished_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:631,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:627,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Duration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:636,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:gT(t.started_at,t.finished_at)?"var(--accent)":"var(--text-secondary)",fontWeight:gT(t.started_at,t.finished_at)?600:400},children:gT(t.started_at,t.finished_at)??"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:639,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:635,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:607,columnNumber:9},this),y.jsxDEV("div",{style:{marginBottom:20},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:"Move to"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:647,columnNumber:11},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:p6.filter(g=>g.key!==t.status).map(g=>y.jsxDEV("button",{"data-testid":`move-to-${g.key}`,onClick:()=>n(t.id,g.key),style:{flex:1,background:"var(--surface-3)",border:`1px solid ${g.color}`,borderRadius:"var(--radius-xs)",padding:"6px 10px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:g.color,cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:x=>{x.currentTarget.style.background=g.glow!=="none"?g.glow:"var(--surface-4)"},onMouseLeave:x=>{x.currentTarget.style.background="var(--surface-3)"},children:g.label},g.key,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:652,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:650,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:646,columnNumber:9},this),t.activity_id?y.jsxDEV(Mee,{activityId:t.activity_id,squadCode:t.squad_code,taskStatus:t.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:673,columnNumber:11},this):y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Output / Result"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:683,columnNumber:15},this),!o&&y.jsxDEV("button",{onClick:()=>{l(!0),f(t.result||"")},style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent-dim)",cursor:"pointer"},children:t.result?"edit":"+ add"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:687,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:680,columnNumber:13},this),o?y.jsxDEV("div",{children:[y.jsxDEV("textarea",{value:u,onChange:g=>f(g.target.value),autoFocus:!0,rows:8,style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",lineHeight:1.6,outline:"none",resize:"vertical",marginBottom:8}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:701,columnNumber:17},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[y.jsxDEV("button",{onClick:h,style:{background:"var(--accent)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-inverse)",cursor:"pointer"},children:"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:715,columnNumber:19},this),y.jsxDEV("button",{onClick:()=>l(!1),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:722,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:714,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:700,columnNumber:15},this):t.result?y.jsxDEV("div",{style:{padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-primary)",lineHeight:1.6,whiteSpace:"pre-wrap",maxHeight:300,overflowY:"auto"},children:t.result},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:733,columnNumber:15},this):y.jsxDEV("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No output yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:742,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:679,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:587,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:557,columnNumber:5},this)}function Pee(){const t=au(te=>te.user),[e,n]=O.useState([]),[s,o]=O.useState(!0),[l,u]=O.useState(""),[f,h]=O.useState(""),[p,g]=O.useState("viewer"),[x,v]=O.useState(null),[E,S]=O.useState(null),[T,D]=O.useState(null),[A,M]=O.useState(""),j=O.useCallback(async()=>{try{const te=await fetch("/api/users",{credentials:"include"});if(te.ok){const H=await te.json();n(H.users)}}catch{v("Failed to load users")}finally{o(!1)}},[]);O.useEffect(()=>{j()},[j]);const U=async()=>{if(!(!l.trim()||!f.trim())){v(null);try{const te=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:f,role:p}),credentials:"include"});if(!te.ok){const H=await te.json();v(H.error||"Failed to create user");return}u(""),h(""),g("viewer"),await j()}catch{v("Network error")}}},P=async(te,H)=>{try{(await fetch(`/api/users/${te}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:H}),credentials:"include"})).ok&&await j()}catch{v("Failed to update role")}},z=async te=>{if(!A||A.length<6){v("Password must be at least 6 characters");return}try{const H=await fetch(`/api/users/${te}/password`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:A}),credentials:"include"});if(H.ok)D(null),M(""),v(null);else{const I=await H.json();v(I.error||"Failed to change password")}}catch{v("Network error")}},K=async te=>{try{(await fetch(`/api/users/${te}`,{method:"DELETE",credentials:"include"})).ok&&(S(null),await j())}catch{v("Failed to delete user")}};return s?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:125,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:139,columnNumber:7},this),x&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:x},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:150,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[y.jsxDEV("input",{className:"input",placeholder:"Username",value:l,onChange:te=>u(te.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:172,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Password",type:"password",value:f,onChange:te=>h(te.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:179,columnNumber:9},this),y.jsxDEV("select",{className:"input",value:p,onChange:te=>g(te.target.value),style:{minWidth:100},children:[y.jsxDEV("option",{value:"viewer",children:"viewer"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:193,columnNumber:11},this),y.jsxDEV("option",{value:"operator",children:"operator"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:194,columnNumber:11},this),y.jsxDEV("option",{value:"admin",children:"admin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:195,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:187,columnNumber:9},this),y.jsxDEV("button",{onClick:U,className:"btn btn-accent",children:"Create User"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:197,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:165,columnNumber:7},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((te,H)=>y.jsxDEV("th",{style:{textAlign:H===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:te},te,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:207,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:205,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:204,columnNumber:9},this),y.jsxDEV("tbody",{children:e.map(te=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:te.username},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:228,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:te.email||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:231,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px"},children:te.id===(t==null?void 0:t.id)?y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:te.role},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:236,columnNumber:19},this):y.jsxDEV("select",{className:"input",value:te.role,onChange:H=>P(te.id,H.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"viewer",children:"viewer"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:250,columnNumber:21},this),y.jsxDEV("option",{value:"operator",children:"operator"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:251,columnNumber:21},this),y.jsxDEV("option",{value:"admin",children:"admin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:252,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:244,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:234,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:te.last_login?new Date(te.last_login).toLocaleDateString():"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:256,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",textAlign:"right"},children:y.jsxDEV("span",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[T===te.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:4,alignItems:"center"},children:[y.jsxDEV("input",{type:"password",placeholder:"New password",value:A,onChange:H=>M(H.target.value),autoFocus:!0,onKeyDown:H=>{H.key==="Enter"&&z(te.id),H.key==="Escape"&&(D(null),M(""))},style:{padding:"3px 8px",border:"1px solid var(--border-subtle)",borderRadius:3,background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",width:130}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:268,columnNumber:21},this),y.jsxDEV("button",{onClick:()=>z(te.id),className:"btn btn-sm btn-accent",children:"Set"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:281,columnNumber:21},this),y.jsxDEV("button",{onClick:()=>{D(null),M("")},className:"btn btn-sm",children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:282,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:267,columnNumber:19},this):y.jsxDEV("button",{onClick:()=>{D(te.id),M("")},className:"btn btn-sm",title:"Change password",children:"🔑"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:285,columnNumber:19},this),te.id!==(t==null?void 0:t.id)&&(E===te.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:294,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>K(te.id),className:"btn btn-sm btn-danger",children:"Yes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:301,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>S(null),className:"btn btn-sm",children:"No"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:307,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:293,columnNumber:21},this):y.jsxDEV("button",{onClick:()=>S(te.id),className:"btn btn-sm btn-danger",children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:315,columnNumber:21},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:265,columnNumber:17},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:264,columnNumber:15},this)]},te.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:227,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:225,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:203,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:138,columnNumber:5},this)}function Oee(){const t=Ps(h=>h.selectedSquad),e=Ps(h=>h.activeStates),[n,s]=O.useState(null),[o,l]=O.useState(!1),u=t?e[t]:null;if(O.useEffect(()=>{if(!t){s(null);return}l(!0),fetch(`/api/squads/${t}`,{credentials:"include"}).then(h=>h.ok?h.json():null).then(h=>{h&&s(h.data)}).finally(()=>l(!1))},[t]),!t)return y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:38,columnNumber:7},this);if(o)return y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:50,columnNumber:7},this);const f={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:74,columnNumber:7},this),n&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Name"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:87,columnNumber:13},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:88,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:86,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Description"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:98,columnNumber:13},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:99,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:97,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Agents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:109,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(h=>y.jsxDEV("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:h.name},h.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:112,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:110,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:108,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Pipeline Steps"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:131,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((h,p)=>y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[y.jsxDEV("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:p+1},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:147,columnNumber:19},this),y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:h.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:163,columnNumber:19},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:h.agent},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:164,columnNumber:19},this)]},h.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:134,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:132,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:130,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:85,columnNumber:9},this),u&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Current State"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:181,columnNumber:11},this),y.jsxDEV("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(u,null,2)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:182,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:180,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:73,columnNumber:5},this)}function zee(){const[t,e]=O.useState(null),[n,s]=O.useState(null),[o,l]=O.useState(!0),[u,f]=O.useState(null),h=O.useCallback(async()=>{l(!0);try{const x=await fetch("/api/health",{credentials:"include"});if(x.ok){const v=await x.json();e(v),s(v.status==="ok")}else s(!1)}catch{s(!1)}finally{l(!1),f(new Date().toLocaleTimeString())}},[]);O.useEffect(()=>{h()},[h]);const p={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},g={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:66,columnNumber:9},this),y.jsxDEV("button",{onClick:h,className:"btn btn-sm",children:"Refresh"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:74,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:60,columnNumber:7},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:p,children:"Health Status"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:80,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"API Server"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:82,columnNumber:11},this),o?y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:84,columnNumber:13},this):y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:n?"var(--status-active)":"var(--status-error)"},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:n?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:n?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:102,columnNumber:15},this),n?"Healthy":"Unhealthy"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:93,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:81,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:79,columnNumber:7},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:p,children:"Environment"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:119,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"API Port"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:121,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:122,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:120,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:131,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:132,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:130,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:118,columnNumber:7},this),u&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",u]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:143,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:59,columnNumber:5},this)}function Lee(){const[t,e]=O.useState([]),[n,s]=O.useState(!0),[o,l]=O.useState(!1),[u,f]=O.useState(null),[h,p]=O.useState(!1);O.useEffect(()=>{fetch("/api/settings/env/all",{credentials:"include"}).then(S=>S.json()).then(S=>{e(S.vars??[]),s(!1)}).catch(()=>s(!1))},[]);const g=O.useCallback((S,T,D)=>{e(A=>A.map((M,j)=>j===S?{...M,[T]:D,masked:T==="value"?!1:M.masked}:M)),p(!0),f(null)},[]),x=O.useCallback(()=>{e(S=>[...S,{key:"",value:"",masked:!1}]),p(!0),f(null)},[]),v=O.useCallback(S=>{e(T=>T.filter((D,A)=>A!==S)),p(!0),f(null)},[]),E=O.useCallback(async()=>{l(!0),f(null);try{const S=t.filter(D=>D.key.trim()).map(D=>({key:D.key.trim(),value:D.value})),T=await fetch("/api/settings/env/all",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:S})});if(T.ok){const D=await T.json();e(D.vars??[]),p(!1),f({type:"success",text:"Environment saved. Some changes may require a server restart."})}else{const D=await T.json();f({type:"error",text:D.error||"Failed to save"})}}catch{f({type:"error",text:"Network error"})}l(!1)},[t]);return n?y.jsxDEV("div",{style:{textAlign:"center",padding:40,color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:72,columnNumber:7},this):y.jsxDEV("div",{style:{maxWidth:800},children:[y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6,marginBottom:16},children:"Edit environment variables (.env). Secret values are masked. Changes to PORT, NODE_ENV or BRIDGE_TIMEOUT_MS may require a restart."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:80,columnNumber:7},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr 36px",gap:8,padding:"6px 0",borderBottom:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[y.jsxDEV("span",{children:"Key"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:94,columnNumber:9},this),y.jsxDEV("span",{children:"Value"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:95,columnNumber:9},this),y.jsxDEV("span",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:96,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:88,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:4,marginTop:4},children:t.map((S,T)=>y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr 36px",gap:8,alignItems:"center"},children:[y.jsxDEV("input",{type:"text",value:S.key,onChange:D=>g(T,"key",D.target.value),placeholder:"VARIABLE_NAME",spellCheck:!1,style:{padding:"6px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:105,columnNumber:13},this),y.jsxDEV("input",{type:S.masked?"password":"text",value:S.value,onChange:D=>g(T,"value",D.target.value),onFocus:()=>{S.masked&&(e(D=>D.map((A,M)=>M===T?{...A,value:"",masked:!1}:A)),p(!0))},placeholder:"value",spellCheck:!1,style:{padding:"6px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:118,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>v(T),title:"Remove variable",style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:4,width:32,height:32,cursor:"pointer",color:"var(--text-muted)",fontSize:"0.9rem",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:D=>{D.currentTarget.style.color="#ef4444",D.currentTarget.style.borderColor="#ef444466"},onMouseLeave:D=>{D.currentTarget.style.color="var(--text-muted)",D.currentTarget.style.borderColor="var(--border-subtle)"},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:137,columnNumber:13},this)]},T,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:102,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:100,columnNumber:7},this),y.jsxDEV("div",{style:{marginTop:16,display:"flex",alignItems:"center",gap:12},children:[y.jsxDEV("button",{onClick:x,style:{padding:"6px 16px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",cursor:"pointer"},children:"+ Add Variable"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:155,columnNumber:9},this),y.jsxDEV("button",{onClick:E,disabled:!h||o,style:{padding:"6px 20px",background:h?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:4,color:h?"var(--text-inverse)":"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,cursor:h?"pointer":"default",opacity:o?.6:1},children:o?"Saving...":"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:165,columnNumber:9},this),u&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:u.type==="success"?"#4ade80":"#ef4444"},children:u.text},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:180,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:154,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:79,columnNumber:5},this)}function Bee(){const[t,e]=O.useState([]),[n,s]=O.useState(!0),[o,l]=O.useState(null),[u,f]=O.useState(null),[h,p]=O.useState(""),[g,x]=O.useState(""),[v,E]=O.useState(""),[S,T]=O.useState(""),[D,A]=O.useState(null),[M,j]=O.useState(""),[U,P]=O.useState(""),[z,K]=O.useState(""),[te,H]=O.useState(""),I=O.useCallback(async()=>{try{const L=await fetch("/api/team",{credentials:"include"});if(L.ok){const ee=await L.json();e(ee.members)}}catch{l("Failed to load team members")}finally{s(!1)}},[]);O.useEffect(()=>{I()},[I]);const F=async()=>{if(!(!h.trim()||!g.trim())){l(null);try{const L=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h.trim(),role:g.trim(),email:v.trim()||void 0,phone:S.trim()||void 0}),credentials:"include"});if(!L.ok){const ee=await L.json();l(ee.error||"Failed to create team member");return}p(""),x(""),E(""),T(""),await I()}catch{l("Network error")}}},$=L=>{A(L.id),j(L.name),P(L.role),K(L.email||""),H(L.phone||"")},J=()=>{A(null)},X=async()=>{if(!(!D||!M.trim()||!U.trim())){l(null);try{(await fetch(`/api/team/${D}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:M.trim(),role:U.trim(),email:z.trim()||void 0,phone:te.trim()||void 0}),credentials:"include"})).ok&&(A(null),await I())}catch{l("Failed to update member")}}},Q=async L=>{try{(await fetch(`/api/team/${L}`,{method:"DELETE",credentials:"include"})).ok&&(f(null),await I())}catch{l("Failed to delete member")}};return n?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading team..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:133,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:147,columnNumber:7},this),o&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:o},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:158,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[y.jsxDEV("input",{className:"input",placeholder:"Name *",value:h,onChange:L=>p(L.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:180,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Role *",value:g,onChange:L=>x(L.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:187,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Email",type:"email",value:v,onChange:L=>E(L.target.value),style:{flex:1,minWidth:150}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:194,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Phone",type:"tel",value:S,onChange:L=>T(L.target.value),style:{flex:1,minWidth:130}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:202,columnNumber:9},this),y.jsxDEV("button",{onClick:F,className:"btn btn-accent",children:"Add Member"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:210,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:173,columnNumber:7},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((L,ee)=>y.jsxDEV("th",{style:{textAlign:ee===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:L},L,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:220,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:218,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:217,columnNumber:9},this),y.jsxDEV("tbody",{children:[t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:5,style:{padding:"var(--sp-5)",textAlign:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:"No team members yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:241,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:240,columnNumber:13},this),t.map(L=>D===L.id?y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:M,onChange:ee=>j(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:259,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:258,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:U,onChange:ee=>P(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:262,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:261,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:z,onChange:ee=>K(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:265,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:264,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:te,onChange:ee=>H(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:268,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:267,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px",textAlign:"right"},children:y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{onClick:X,className:"btn btn-sm btn-accent",children:"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:272,columnNumber:21},this),y.jsxDEV("button",{onClick:J,className:"btn btn-sm",children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:273,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:271,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:270,columnNumber:17},this)]},L.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:257,columnNumber:15},this):y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:L.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:279,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:L.role},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:282,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:L.email||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:285,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:L.phone||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:288,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",textAlign:"right"},children:u===L.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:299,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>Q(L.id),className:"btn btn-sm btn-danger",children:"Yes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:306,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>f(null),className:"btn btn-sm",children:"No"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:307,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:298,columnNumber:21},this):y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{onClick:()=>$(L),className:"btn btn-sm",children:"Edit"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:311,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>f(L.id),className:"btn btn-sm btn-danger",children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:312,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:310,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:296,columnNumber:17},this)]},L.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:278,columnNumber:15},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:238,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:216,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:146,columnNumber:5},this)}const Iee={dev:"Development",messaging:"Messaging",ads:"Advertising",crm:"CRM",support:"Support",email:"Email Marketing",sales:"Sales & Payments",pm:"Project Management",monitoring:"Monitoring",cloud:"Cloud & Deploy",design:"Design"},Hee={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function qee(){const[t,e]=O.useState([]),[n,s]=O.useState([]),[o,l]=O.useState(!0),[u,f]=O.useState(null),[h,p]=O.useState(null),[g,x]=O.useState(!1),[v,E]=O.useState({}),[S,T]=O.useState(!1),[D,A]=O.useState(null),[M,j]=O.useState(""),U=O.useCallback(async()=>{try{const[$,J]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if($.ok){const X=await $.json();e(X.providers)}if(J.ok){const X=await J.json();s(X.integrations)}}catch{f("Failed to load integrations")}finally{l(!1)}},[]);O.useEffect(()=>{U()},[U]);const P=$=>n.find(J=>J.provider===$),z=$=>{const J=P($.key),X={};for(const Q of $.fields)X[Q.key]=(J==null?void 0:J.config[Q.key])||"";E(X),T((J==null?void 0:J.enabled)??!1),p($.key),f(null)},K=async()=>{if(h){x(!0),f(null);try{const $=await fetch(`/api/integrations/${h}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:S,config:v}),credentials:"include"});if(!$.ok){const J=await $.json();f(J.error||"Failed to save");return}await U(),p(null)}catch{f("Network error")}finally{x(!1)}}},te=async $=>{try{(await fetch(`/api/integrations/${$}`,{method:"DELETE",credentials:"include"})).ok&&(await U(),h===$&&p(null))}catch{f("Failed to disconnect")}},H=Array.from(new Set(t.map($=>$.category))),I=M.toLowerCase(),F=t.filter($=>!(D&&$.category!==D||M&&!$.name.toLowerCase().includes(I)&&!$.description.toLowerCase().includes(I)));return o?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading integrations..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:156,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:170,columnNumber:7},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",marginBottom:"var(--sp-4)"},children:"Configure third-party services for your squads and agents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:179,columnNumber:7},this),y.jsxDEV("input",{className:"input",type:"text",placeholder:"Search integrations...",value:M,onChange:$=>j($.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:189,columnNumber:7},this),u&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:203,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("button",{onClick:()=>A(null),style:{padding:"4px 12px",border:"1px solid",borderColor:D?"var(--border-subtle)":"var(--accent)",borderRadius:"var(--radius-sm)",background:D?"transparent":"var(--accent)",color:D?"var(--text-secondary)":"#fff",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"All"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:224,columnNumber:9},this),H.map($=>y.jsxDEV("button",{onClick:()=>A($),style:{padding:"4px 12px",border:"1px solid",borderColor:D===$?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:D===$?"var(--accent)":"transparent",color:D===$?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[Hee[$]||""," ",Iee[$]||$]},$,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:241,columnNumber:11},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:218,columnNumber:7},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:F.map($=>{const J=P($.key),X=h===$.key;return y.jsxDEV("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:J!=null&&J.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:X?"1 / -1":void 0},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:X?"var(--sp-3)":0},children:[y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:$.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:297,columnNumber:21},this),(J==null?void 0:J.enabled)&&y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:306,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:292,columnNumber:19},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:$.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:316,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:291,columnNumber:17},this),y.jsxDEV("button",{onClick:()=>X?p(null):z($),className:"btn btn-sm",style:{flexShrink:0},children:X?"Close":J?"Edit":"Configure"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:324,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:285,columnNumber:15},this),X&&y.jsxDEV("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[y.jsxDEV("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",cursor:"pointer"},children:[y.jsxDEV("input",{type:"checkbox",checked:S,onChange:Q=>T(Q.target.checked)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:347,columnNumber:21},this),"Enabled"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:337,columnNumber:19},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:$.fields.map(Q=>y.jsxDEV("div",{children:[y.jsxDEV("label",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:2,display:"block"},children:[Q.label," ",Q.required&&"*"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:359,columnNumber:25},this),y.jsxDEV("input",{className:"input",type:Q.type==="password"?"password":"text",placeholder:Q.placeholder||"",value:v[Q.key]||"",onChange:L=>E(ee=>({...ee,[Q.key]:L.target.value})),style:{width:"100%",fontSize:"0.8rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:370,columnNumber:25},this)]},Q.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:358,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:356,columnNumber:19},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[J&&y.jsxDEV("button",{onClick:()=>te($.key),className:"btn btn-sm btn-danger",children:"Disconnect"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:390,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:397,columnNumber:21},this),y.jsxDEV("button",{onClick:K,className:"btn btn-sm btn-accent",disabled:g,children:g?"Saving...":"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:403,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:383,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:335,columnNumber:17},this)]},$.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:272,columnNumber:13},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:262,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:169,columnNumber:5},this)}function Fee(){const t=au(u=>u.user),e=(t==null?void 0:t.role)==="admin",[n,s]=O.useState(e?"users":"squad"),l=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"team",label:"Team",icon:"◎"},{key:"integrations",label:"Integrations",icon:"⬡"},{key:"squad",label:"Squad",icon:"⬢"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(u=>!u.adminOnly||e);return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:39,columnNumber:9},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:48,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:38,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:l.map(u=>y.jsxDEV("button",{onClick:()=>s(u.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:n===u.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:n===u.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:n===u.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontSize:"0.75rem",opacity:.7},children:u.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:88,columnNumber:13},this),u.label]},u.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:65,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:58,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&e&&y.jsxDEV(Pee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:96,columnNumber:46},this),n==="team"&&y.jsxDEV(Bee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:97,columnNumber:34},this),n==="integrations"&&y.jsxDEV(qee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:98,columnNumber:42},this),n==="squad"&&y.jsxDEV(Oee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:99,columnNumber:35},this),n==="server"&&y.jsxDEV(zee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:100,columnNumber:36},this),n==="env"&&e&&y.jsxDEV(Lee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:101,columnNumber:44},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:95,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:30,columnNumber:5},this)}const g6=[{value:"0",label:"Domingo"},{value:"1",label:"Segunda"},{value:"2",label:"Terça"},{value:"3",label:"Quarta"},{value:"4",label:"Quinta"},{value:"5",label:"Sexta"},{value:"6",label:"Sábado"}];function Gee(t,e){switch(t){case"every_n_minutes":return`*/${e.everyNMinutes||"30"} * * * *`;case"every_n_hours":return`${e.minute||"0"} */${e.everyNHours||"2"} * * *`;case"hourly":return`${e.minute||"0"} * * * *`;case"daily":return`${e.minute||"0"} ${e.hour||"9"} * * *`;case"weekly":return`${e.minute||"0"} ${e.hour||"9"} * * ${e.dayOfWeek||"1"}`;case"monthly":return`${e.minute||"0"} ${e.hour||"9"} ${e.dayOfMonth||"1"} * *`;case"custom":return"";default:return"0 9 * * *"}}function bT(t){var u;if(!t)return"";const e=t.split(" ");if(e.length!==5)return t;const[n,s,o,,l]=e;return n.startsWith("*/")?`A cada ${n.replace("*/","")} minutos`:s.startsWith("*/")?`A cada ${s.replace("*/","")} horas no minuto ${n}`:s==="*"&&o==="*"?`A cada hora no minuto ${n}`:o==="*"&&l==="*"?`Diariamente às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:o==="*"&&l!=="*"?`Semanalmente, ${((u=g6.find(h=>h.value===l))==null?void 0:u.label)||`dia ${l}`} às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:l==="*"&&o!=="*"?`Mensalmente, dia ${o} às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:t}function Yee(t){if(t===null)return"—";if(t<1e3)return`${t}ms`;const e=Math.floor(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),s=e%60;if(n<60)return`${n}m ${s}s`;const o=Math.floor(n/60),l=n%60;return`${o}h ${l}m`}function p3(t){return t?new Date(t).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"—"}function $ee(t){switch(t){case"completed":return{label:"Sucesso",color:"var(--status-active)"};case"failed":return{label:"Falhou",color:"var(--status-error)"};case"running":return{label:"Executando",color:"var(--status-warning)"};default:return{label:t,color:"var(--text-muted)"}}}const Hy={width:"100%",padding:"6px 10px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",outline:"none"},iu={...Hy,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",paddingRight:"28px"},Po={fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,display:"block"},ol={padding:"6px 16px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer",border:"none",transition:"all 0.15s ease"};function g3({children:t,onClose:e,title:n,wide:s}){return y.jsxDEV("div",{"data-testid":"modal-overlay",onClick:o=>{o.target===o.currentTarget&&e()},style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--sp-4)",animation:"fadeIn 0.15s var(--ease-out) both"},children:y.jsxDEV("div",{"data-testid":"modal-content",style:{background:"var(--surface-1)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",width:"100%",maxWidth:s?900:560,maxHeight:"90vh",display:"flex",flexDirection:"column",animation:"fadeInUp 0.2s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.9rem",color:"var(--text-primary)"},children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:186,columnNumber:11},this),y.jsxDEV("button",{onClick:e,style:{...ol,padding:"4px 8px",fontSize:"0.7rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:192,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:178,columnNumber:9},this),y.jsxDEV("div",{style:{overflow:"auto",flex:1},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:201,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:163,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:147,columnNumber:5},this)}function Xee(){var Tr,ke,Oe;const t=zo(ce=>ce.jobs),e=zo(ce=>ce.loading),n=zo(ce=>ce.fetchJobs),s=zo(ce=>ce.createJob),o=zo(ce=>ce.deleteJob),l=zo(ce=>ce.pauseJob),u=zo(ce=>ce.resumeJob),f=zo(ce=>ce.triggerJob),h=zo(ce=>ce.history),p=zo(ce=>ce.historyLoading),g=zo(ce=>ce.fetchHistory),x=Ps(ce=>ce.squads),[v,E]=O.useState(!1),[S,T]=O.useState(null),[D,A]=O.useState(null),[M,j]=O.useState(null),[U,P]=O.useState(""),[z,K]=O.useState(""),[te,H]=O.useState("daily"),[I,F]=O.useState("0"),[$,J]=O.useState("9"),[X,Q]=O.useState("1"),[L,ee]=O.useState("1"),[ne,oe]=O.useState("30"),[G,B]=O.useState("2"),[ae,Z]=O.useState(""),[be,Ve]=O.useState(""),[he,Ne]=O.useState("America/Sao_Paulo"),[De,me]=O.useState("30"),[qe,Te]=O.useState("0");O.useEffect(()=>{n()},[n]);const Ke=O.useCallback(()=>{K(""),H("daily"),F("0"),J("9"),Q("1"),ee("1"),oe("30"),B("2"),Z(""),Ve(""),Ne("America/Sao_Paulo"),me("30"),Te("0"),T(null)},[]),et=()=>{E(!1),Ke()},Ct=()=>{Ke(),E(!0)},kt=ce=>{K(ce.squad_name),Ve(ce.prompt||""),Ne(ce.timezone||"America/Sao_Paulo"),me(String(ce.timeout_minutes||30)),Te(String(ce.retry_on_failure||0)),T(ce.squad_name);const tt=ce.cron_expression.split(" ");if(tt.length===5){const[bt,en,cr,,Fn]=tt;bt.startsWith("*/")?(H("every_n_minutes"),oe(bt.replace("*/",""))):en.startsWith("*/")?(H("every_n_hours"),B(en.replace("*/","")),F(bt)):en==="*"?(H("hourly"),F(bt)):cr==="*"&&Fn==="*"?(H("daily"),F(bt),J(en)):cr==="*"&&Fn!=="*"?(H("weekly"),F(bt),J(en),Q(Fn)):Fn==="*"&&cr!=="*"?(H("monthly"),F(bt),J(en),ee(cr)):(H("custom"),Z(ce.cron_expression))}else H("custom"),Z(ce.cron_expression);E(!0)},Fe=te==="custom"?ae:Gee(te,{minute:I,hour:$,dayOfMonth:L,dayOfWeek:X,everyNMinutes:ne,everyNHours:G}),Ut=async()=>{if(!z||!Fe||!be.trim())return;const ce={squad_name:z,cron_expression:Fe,prompt:be.trim(),timezone:he||void 0,timeout_minutes:parseInt(De)||30,retry_on_failure:parseInt(qe)||0};await s(ce)&&et()},Bn=ce=>{A(ce),j(null),g(ce)},wr=()=>{A(null),j(null)},rt=ce=>ce==="active"?"var(--status-active)":ce==="paused"?"var(--status-warning)":"var(--status-error)",Jt=ce=>ce==="active"?"var(--status-active-glow)":ce==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)",Cr=x.filter(ce=>!t.some(tt=>tt.squad_name===ce.code)),br=U.toLowerCase(),qn=U?t.filter(ce=>{var tt;return ce.squad_name.toLowerCase().includes(br)||((tt=ce.prompt)==null?void 0:tt.toLowerCase().includes(br))||ce.status.toLowerCase().includes(br)||bT(ce.cron_expression).toLowerCase().includes(br)}):t;return y.jsxDEV("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both",width:"100%",boxSizing:"border-box"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("div",{children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:377,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:386,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:376,columnNumber:9},this),y.jsxDEV("button",{"data-testid":"btn-new-schedule",onClick:Ct,style:{...ol,background:"var(--accent)",color:"var(--text-inverse)"},children:"+ New Schedule"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:394,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:375,columnNumber:7},this),t.length>0&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:y.jsxDEV("input",{"data-testid":"search-jobs",type:"text",placeholder:"Search by name, prompt, status...",value:U,onChange:ce=>P(ce.target.value),style:{...Hy,maxWidth:400,paddingLeft:32,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"10px center"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:410,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:409,columnNumber:9},this),e&&y.jsxDEV("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:429,columnNumber:9},this),!e&&t.length===0&&!v&&y.jsxDEV("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[y.jsxDEV("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:445,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:446,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Click ",y.jsxDEV("strong",{children:"+ New Schedule"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:451,columnNumber:19},this)," to create your first automated job."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:447,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:440,columnNumber:9},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)",width:"100%"},children:qn.map((ce,tt)=>y.jsxDEV("div",{"data-testid":`job-${ce.squad_name}`,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${tt*40}ms both`,display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:ce.squad_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:481,columnNumber:15},this),y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:rt(ce.status),flexShrink:0,marginLeft:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:rt(ce.status),boxShadow:`0 0 8px ${Jt(ce.status)}`,display:"inline-block",animation:ce.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:502,columnNumber:17},this),ce.status]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:492,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:480,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[y.jsxDEV("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.6rem",flexShrink:0},children:ce.cron_expression},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:522,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:bT(ce.cron_expression)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:531,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:514,columnNumber:13},this),ce.prompt&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)"},children:ce.prompt},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:538,columnNumber:15},this),ce.last_run_at&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["Last: ",new Date(ce.last_run_at).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),ce.last_result&&y.jsxDEV("span",{children:[" — ",ce.last_result]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:563,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:555,columnNumber:15},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",flexWrap:"wrap",marginTop:"auto"},children:[y.jsxDEV("button",{onClick:()=>kt(ce),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Edit"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:569,columnNumber:15},this),ce.status==="active"?y.jsxDEV("button",{onClick:()=>l(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-warning)"},children:"Pause"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:575,columnNumber:17},this):y.jsxDEV("button",{onClick:()=>u(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-active)"},children:"Resume"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:581,columnNumber:17},this),y.jsxDEV("button",{onClick:()=>f(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--accent)",color:"var(--text-inverse)"},children:"Trigger"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:587,columnNumber:15},this),y.jsxDEV("button",{"data-testid":`btn-history-${ce.squad_name}`,onClick:()=>Bn(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)"},children:"Log"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:591,columnNumber:15},this),y.jsxDEV("button",{onClick:()=>{confirm(`Delete schedule for ${ce.squad_name}?`)&&o(ce.squad_name)},style:{...ol,padding:"3px 6px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",marginLeft:"auto"},title:"Delete schedule",children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:600,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:568,columnNumber:13},this)]},ce.squad_name,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:464,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:457,columnNumber:7},this),!e&&U&&qn.length===0&&t.length>0&&y.jsxDEV("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:['No jobs matching "',U,'"']},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:616,columnNumber:9},this),v&&y.jsxDEV(g3,{title:S?"Edit Schedule":"New Schedule",onClose:et,children:y.jsxDEV("div",{"data-testid":"schedule-form",style:{padding:"var(--sp-4)"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:636,columnNumber:15},this),S?y.jsxDEV("div",{style:{...Hy,background:"var(--surface-3)",color:"var(--text-secondary)"},children:S},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:638,columnNumber:17},this):y.jsxDEV("select",{"data-testid":"select-squad",value:z,onChange:ce=>K(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"",children:"Select a squad..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:648,columnNumber:19},this),Cr.map(ce=>y.jsxDEV("option",{value:ce.code,children:[ce.name," (",ce.code,")"]},ce.code,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:650,columnNumber:21},this)),t.length===0&&x.length===0&&y.jsxDEV("option",{disabled:!0,children:"No squads available"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:653,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:642,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:635,columnNumber:13},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Frequency"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:661,columnNumber:15},this),y.jsxDEV("select",{"data-testid":"select-frequency",value:te,onChange:ce=>H(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"every_n_minutes",children:"Every N minutes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:668,columnNumber:17},this),y.jsxDEV("option",{value:"every_n_hours",children:"Every N hours"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:669,columnNumber:17},this),y.jsxDEV("option",{value:"hourly",children:"Hourly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:670,columnNumber:17},this),y.jsxDEV("option",{value:"daily",children:"Daily"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:671,columnNumber:17},this),y.jsxDEV("option",{value:"weekly",children:"Weekly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:672,columnNumber:17},this),y.jsxDEV("option",{value:"monthly",children:"Monthly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:673,columnNumber:17},this),y.jsxDEV("option",{value:"custom",children:"Custom cron"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:674,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:662,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:660,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[te==="every_n_minutes"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Every (minutes)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:682,columnNumber:19},this),y.jsxDEV("select",{value:ne,onChange:ce=>oe(ce.target.value),style:iu,children:[1,2,5,10,15,20,30].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:685,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:683,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:681,columnNumber:17},this),te==="every_n_hours"&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Every (hours)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:693,columnNumber:21},this),y.jsxDEV("select",{value:G,onChange:ce=>B(ce.target.value),style:iu,children:[2,3,4,6,8,12].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:696,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:694,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:692,columnNumber:19},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"At minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:701,columnNumber:21},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:704,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:702,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:700,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:691,columnNumber:17},this),te==="hourly"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"At minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:712,columnNumber:19},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:715,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:713,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:711,columnNumber:17},this),(te==="daily"||te==="weekly"||te==="monthly")&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Hour"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:723,columnNumber:21},this),y.jsxDEV("select",{value:$,onChange:ce=>J(ce.target.value),style:iu,children:Array.from({length:24},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:726,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:724,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:722,columnNumber:19},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:731,columnNumber:21},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:734,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:732,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:730,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:721,columnNumber:17},this),te==="weekly"&&y.jsxDEV("div",{style:{flex:1,minWidth:140},children:[y.jsxDEV("label",{style:Po,children:"Day of week"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:742,columnNumber:19},this),y.jsxDEV("select",{value:X,onChange:ce=>Q(ce.target.value),style:iu,children:g6.map(ce=>y.jsxDEV("option",{value:ce.value,children:ce.label},ce.value,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:745,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:743,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:741,columnNumber:17},this),te==="monthly"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Day of month"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:752,columnNumber:19},this),y.jsxDEV("select",{value:L,onChange:ce=>ee(ce.target.value),style:iu,children:Array.from({length:31},(ce,tt)=>y.jsxDEV("option",{value:String(tt+1),children:tt+1},tt+1,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:755,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:753,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:751,columnNumber:17},this),te==="custom"&&y.jsxDEV("div",{style:{flex:1,minWidth:200},children:[y.jsxDEV("label",{style:Po,children:"Cron expression"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:762,columnNumber:19},this),y.jsxDEV("input",{type:"text",placeholder:"* * * * *",value:ae,onChange:ce=>Z(ce.target.value),style:Hy},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:763,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:761,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:679,columnNumber:13},this),Fe&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)",padding:"8px 12px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("code",{style:{color:"var(--accent)",fontWeight:600},children:Fe},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:788,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-muted)"},children:"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:789,columnNumber:17},this),y.jsxDEV("span",{"data-testid":"cron-preview",style:{color:"var(--text-secondary)"},children:bT(Fe)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:790,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:776,columnNumber:15},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Instruction for the agent"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:796,columnNumber:15},this),y.jsxDEV("textarea",{"data-testid":"input-prompt",placeholder:"What should the squad do on each execution?",value:be,onChange:ce=>Ve(ce.target.value),rows:3,style:{...Hy,resize:"vertical",lineHeight:1.5}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:797,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:795,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("div",{style:{flex:2,minWidth:180},children:[y.jsxDEV("label",{style:Po,children:"Timezone"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:810,columnNumber:17},this),y.jsxDEV("select",{value:he,onChange:ce=>Ne(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"America/Sao_Paulo",children:"America/Sao_Paulo"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:812,columnNumber:19},this),y.jsxDEV("option",{value:"America/New_York",children:"America/New_York"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:813,columnNumber:19},this),y.jsxDEV("option",{value:"America/Chicago",children:"America/Chicago"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:814,columnNumber:19},this),y.jsxDEV("option",{value:"America/Los_Angeles",children:"America/Los_Angeles"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:815,columnNumber:19},this),y.jsxDEV("option",{value:"Europe/London",children:"Europe/London"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:816,columnNumber:19},this),y.jsxDEV("option",{value:"Europe/Berlin",children:"Europe/Berlin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:817,columnNumber:19},this),y.jsxDEV("option",{value:"Asia/Tokyo",children:"Asia/Tokyo"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:818,columnNumber:19},this),y.jsxDEV("option",{value:"UTC",children:"UTC"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:819,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:811,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:809,columnNumber:15},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Timeout (min)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:823,columnNumber:17},this),y.jsxDEV("input",{type:"number",min:1,max:480,value:De,onChange:ce=>me(ce.target.value),style:Hy},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:824,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:822,columnNumber:15},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Retries"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:834,columnNumber:17},this),y.jsxDEV("select",{value:qe,onChange:ce=>Te(ce.target.value),style:iu,children:[0,1,2,3,4,5].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:837,columnNumber:21},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:835,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:833,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:808,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{"data-testid":"btn-save-schedule",onClick:Ut,disabled:!z||!Fe||!be.trim(),style:{...ol,background:z&&Fe&&be.trim()?"var(--accent)":"var(--surface-4)",color:z&&Fe&&be.trim()?"var(--text-inverse)":"var(--text-muted)"},children:S?"Update":"Create"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:845,columnNumber:15},this),y.jsxDEV("button",{onClick:et,style:{...ol,background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:857,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:844,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:633,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:629,columnNumber:9},this),D&&y.jsxDEV(g3,{title:`Execution Log — ${D}`,onClose:wr,wide:!0,children:y.jsxDEV("div",{"data-testid":`history-${D}`,children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 12px",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("button",{"data-testid":`btn-refresh-${D}`,onClick:()=>g(D),disabled:p[D],style:{...ol,padding:"3px 10px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:p[D]?"var(--text-muted)":"var(--text-secondary)",display:"inline-flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{style:{display:"inline-block",animation:p[D]?"spin 1s linear infinite":"none"},children:"↻"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:897,columnNumber:17},this),"Refresh"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:886,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:882,columnNumber:13},this),p[D]&&y.jsxDEV("div",{style:{padding:"var(--sp-3)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:906,columnNumber:15},this),!p[D]&&(!h[D]||h[D].length===0)&&y.jsxDEV("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"No executions recorded yet."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:913,columnNumber:15},this),!p[D]&&((Tr=h[D])==null?void 0:Tr.length)>0&&y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{background:"var(--surface-3)"},children:["Status","Started","Finished","Duration","Attempt","Output"].map(ce=>y.jsxDEV("th",{style:{padding:"6px 8px",textAlign:"left",fontWeight:600,fontSize:"0.6rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)",borderBottom:"1px solid var(--border-subtle)"},children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:927,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:925,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:924,columnNumber:17},this),y.jsxDEV("tbody",{children:h[D].map(ce=>{const tt=$ee(ce.status),bt=M===ce.id;return y.jsxDEV("tr",{"data-testid":`activity-${ce.id}`,style:{borderBottom:"1px solid var(--border-subtle)",transition:"background 0.1s"},onMouseEnter:en=>{en.currentTarget.style.background="var(--surface-3)"},onMouseLeave:en=>{en.currentTarget.style.background="transparent"},children:[y.jsxDEV("td",{style:{padding:"6px 8px"},children:y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:tt.color,fontWeight:600},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:tt.color,display:"inline-block",animation:ce.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:955,columnNumber:29},this),tt.label]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:951,columnNumber:27},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:950,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:p3(ce.started_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:963,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:p3(ce.finished_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:966,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:Yee(ce.duration_ms)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:969,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-muted)",textAlign:"center"},children:ce.attempt??1},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:972,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px"},children:ce.result_summary?y.jsxDEV("button",{"data-testid":`btn-output-${ce.id}`,onClick:()=>j(bt?null:ce.id),style:{...ol,padding:"2px 8px",fontSize:"0.62rem",background:bt?"var(--accent)":"var(--surface-4)",color:bt?"var(--text-inverse)":"var(--text-secondary)",border:"none"},children:bt?"Hide":"View"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:977,columnNumber:29},this):y.jsxDEV("span",{style:{color:"var(--text-muted)"},children:"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:990,columnNumber:29},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:975,columnNumber:25},this)]},ce.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:940,columnNumber:23},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:935,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:920,columnNumber:15},this),M&&((ke=h[D])==null?void 0:ke.find(ce=>ce.id===M))&&y.jsxDEV("div",{"data-testid":`output-panel-${M}`,style:{padding:"var(--sp-3)",background:"var(--surface-0)",borderTop:"1px solid var(--border-subtle)"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)"},children:"Output"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1013,columnNumber:19},this),y.jsxDEV("button",{onClick:()=>j(null),style:{...ol,padding:"2px 6px",fontSize:"0.6rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1017,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1009,columnNumber:17},this),y.jsxDEV("pre",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0,lineHeight:1.6,padding:"var(--sp-3)",background:"var(--surface-2)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)"},children:(Oe=h[D].find(ce=>ce.id===M))==null?void 0:Oe.result_summary},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1025,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1002,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:880,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:875,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:373,columnNumber:5},this)}const fc=Nc(t=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),s=await fetch(`/api/email/leads?${n}`);if(s.ok){const o=await s.json();t({leads:o.data,total:o.total})}}finally{t({loading:!1})}},fetchCampaigns:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),s=await fetch(`/api/email/campaigns?${n}`);if(s.ok){const o=await s.json();t({campaigns:o.data})}}finally{t({loading:!1})}},fetchLists:async()=>{const e=await fetch("/api/email/leads/lists");if(e.ok){const n=await e.json();t({lists:n.lists})}},fetchTags:async()=>{const e=await fetch("/api/email/leads/tags");if(e.ok){const n=await e.json();t({tags:n.tags})}}}));function Kee(){const t=fc(x=>x.leads),e=fc(x=>x.total),n=fc(x=>x.lists),s=fc(x=>x.tags),o=fc(x=>x.loading),l=fc(x=>x.fetchLeads),u=fc(x=>x.fetchLists),f=fc(x=>x.fetchTags),[h,p]=O.useState("");O.useEffect(()=>{l(),u(),f()},[l,u,f]);const g=()=>{l(h?{search:h}:{})};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[y.jsxDEV(xT,{label:"Total Leads",value:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:32,columnNumber:9},this),y.jsxDEV(xT,{label:"Lists",value:n.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:33,columnNumber:9},this),y.jsxDEV(xT,{label:"Tags",value:s.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:31,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Search leads...",value:h,onChange:x=>p(x.target.value),onKeyDown:x=>x.key==="Enter"&&g(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:39,columnNumber:9},this),y.jsxDEV("button",{onClick:g,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:56,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:38,columnNumber:7},this),o?y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:72,columnNumber:9},this):y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(x=>y.jsxDEV("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:x},x,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:86,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:84,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:83,columnNumber:13},this),y.jsxDEV("tbody",{children:[t.map(x=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:Bo,children:x.email},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:102,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.name||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:103,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.company||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:104,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:y.jsxDEV(b6,{status:x.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:106,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:105,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.source||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:108,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(x.created_at).toLocaleDateString()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:109,columnNumber:19},this)]},x.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:101,columnNumber:17},this)),t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:6,style:{...Bo,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:116,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:115,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:99,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:82,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:76,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:29,columnNumber:5},this)}function Wee(){const t=fc(s=>s.campaigns),e=fc(s=>s.loading),n=fc(s=>s.fetchCampaigns);return O.useEffect(()=>{n()},[n]),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:e?y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:141,columnNumber:9},this):y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(s=>y.jsxDEV("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:s},s,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:155,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:153,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:152,columnNumber:13},this),y.jsxDEV("tbody",{children:[t.map(s=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:Bo,children:s.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:171,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:s.subject},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:172,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:y.jsxDEV(b6,{status:s.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:174,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:173,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.total_recipients},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:176,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.sent_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:177,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.bounce_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:178,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(s.created_at).toLocaleDateString()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:179,columnNumber:19},this)]},s.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:170,columnNumber:17},this)),t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:7,style:{...Bo,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:186,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:185,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:168,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:151,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:145,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:139,columnNumber:5},this)}function Qee(){return y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:207,columnNumber:7},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[y.jsxDEV("p",{children:"Configure these environment variables on the server:"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:221,columnNumber:9},this),y.jsxDEV("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[y.jsxDEV("code",{children:"AWS_ACCESS_KEY_ID=..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:229,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:229,columnNumber:45},this),y.jsxDEV("code",{children:"AWS_SECRET_ACCESS_KEY=..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:230,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:230,columnNumber:49},this),y.jsxDEV("code",{children:"AWS_REGION=us-east-1"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:231,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:231,columnNumber:44},this),y.jsxDEV("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:232,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:232,columnNumber:61},this),y.jsxDEV("code",{children:"SES_RATE_LIMIT=14"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:233,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:233,columnNumber:41},this),y.jsxDEV("code",{children:"SERVER_URL=https://yourdomain.com"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:234,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:222,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:215,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:201,columnNumber:5},this)}function xT({label:t,value:e}){return y.jsxDEV("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:250,columnNumber:7},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:258,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:243,columnNumber:5},this)}function b6({status:t}){const n={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[t]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return y.jsxDEV("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:n.bg,color:n.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:281,columnNumber:5},this)}const Bo={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function Zee(){const[t,e]=O.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return y.jsxDEV("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:315,columnNumber:9},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:324,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:314,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:n.map(s=>y.jsxDEV("button",{onClick:()=>e(s.key),style:{padding:"8px 16px",background:t===s.key?"var(--accent-glow)":"transparent",border:t===s.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:t===s.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t===s.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:s.label},s.key,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:342,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:334,columnNumber:7},this),t==="leads"&&y.jsxDEV(Kee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:364,columnNumber:27},this),t==="campaigns"&&y.jsxDEV(Wee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:365,columnNumber:31},this),t==="settings"&&y.jsxDEV(Qee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:366,columnNumber:30},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:312,columnNumber:5},this)}function Os(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,s;n<t.length;n++)(s=Os(t[n]))!==""&&(e+=(e&&" ")+s);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var Jee={value:()=>{}};function bD(){for(var t=0,e=arguments.length,n={},s;t<e;++t){if(!(s=arguments[t]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new NS(n)}function NS(t){this._=t}function ete(t,e){return t.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}NS.prototype=bD.prototype={constructor:NS,on:function(t,e){var n=this._,s=ete(t+"",n),o,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((o=(t=s[l]).type)&&(o=tte(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++l<u;)if(o=(t=s[l]).type)n[o]=b3(n[o],t.name,e);else if(e==null)for(o in n)n[o]=b3(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new NS(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,l;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(l=this._[t],s=0,o=l.length;s<o;++s)l[s].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],o=0,l=s.length;o<l;++o)s[o].value.apply(e,n)}};function tte(t,e){for(var n=0,s=t.length,o;n<s;++n)if((o=t[n]).name===e)return o.value}function b3(t,e,n){for(var s=0,o=t.length;s<o;++s)if(t[s].name===e){t[s]=Jee,t=t.slice(0,s).concat(t.slice(s+1));break}return n!=null&&t.push({name:e,value:n}),t}var TR="http://www.w3.org/1999/xhtml";const x3={svg:"http://www.w3.org/2000/svg",xhtml:TR,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xD(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),x3.hasOwnProperty(e)?{space:x3[e],local:t}:t}function nte(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===TR&&e.documentElement.namespaceURI===TR?e.createElement(t):e.createElementNS(n,t)}}function rte(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function x6(t){var e=xD(t);return(e.local?rte:nte)(e)}function ste(){}function Oj(t){return t==null?ste:function(){return this.querySelector(t)}}function ite(t){typeof t!="function"&&(t=Oj(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=new Array(u),h,p,g=0;g<u;++g)(h=l[g])&&(p=t.call(h,h.__data__,g,l))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p);return new dl(s,this._parents)}function ote(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ate(){return[]}function y6(t){return t==null?ate:function(){return this.querySelectorAll(t)}}function lte(t){return function(){return ote(t.apply(this,arguments))}}function ute(t){typeof t=="function"?t=lte(t):t=y6(t);for(var e=this._groups,n=e.length,s=[],o=[],l=0;l<n;++l)for(var u=e[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&(s.push(t.call(h,h.__data__,p,u)),o.push(h));return new dl(s,o)}function v6(t){return function(){return this.matches(t)}}function E6(t){return function(e){return e.matches(t)}}var cte=Array.prototype.find;function dte(t){return function(){return cte.call(this.children,t)}}function fte(){return this.firstElementChild}function hte(t){return this.select(t==null?fte:dte(typeof t=="function"?t:E6(t)))}var mte=Array.prototype.filter;function pte(){return Array.from(this.children)}function gte(t){return function(){return mte.call(this.children,t)}}function bte(t){return this.selectAll(t==null?pte:gte(typeof t=="function"?t:E6(t)))}function xte(t){typeof t!="function"&&(t=v6(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=[],h,p=0;p<u;++p)(h=l[p])&&t.call(h,h.__data__,p,l)&&f.push(h);return new dl(s,this._parents)}function _6(t){return new Array(t.length)}function yte(){return new dl(this._enter||this._groups.map(_6),this._parents)}function GS(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}GS.prototype={constructor:GS,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function vte(t){return function(){return t}}function Ete(t,e,n,s,o,l){for(var u=0,f,h=e.length,p=l.length;u<p;++u)(f=e[u])?(f.__data__=l[u],s[u]=f):n[u]=new GS(t,l[u]);for(;u<h;++u)(f=e[u])&&(o[u]=f)}function _te(t,e,n,s,o,l,u){var f,h,p=new Map,g=e.length,x=l.length,v=new Array(g),E;for(f=0;f<g;++f)(h=e[f])&&(v[f]=E=u.call(h,h.__data__,f,e)+"",p.has(E)?o[f]=h:p.set(E,h));for(f=0;f<x;++f)E=u.call(t,l[f],f,l)+"",(h=p.get(E))?(s[f]=h,h.__data__=l[f],p.delete(E)):n[f]=new GS(t,l[f]);for(f=0;f<g;++f)(h=e[f])&&p.get(v[f])===h&&(o[f]=h)}function wte(t){return t.__data__}function Nte(t,e){if(!arguments.length)return Array.from(this,wte);var n=e?_te:Ete,s=this._parents,o=this._groups;typeof t!="function"&&(t=vte(t));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),p=0;p<l;++p){var g=s[p],x=o[p],v=x.length,E=Ste(t.call(g,g&&g.__data__,p,s)),S=E.length,T=f[p]=new Array(S),D=u[p]=new Array(S),A=h[p]=new Array(v);n(g,x,T,D,A,E,e);for(var M=0,j=0,U,P;M<S;++M)if(U=T[M]){for(M>=j&&(j=M+1);!(P=D[j])&&++j<S;);U._next=P||null}}return u=new dl(u,s),u._enter=f,u._exit=h,u}function Ste(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dte(){return new dl(this._exit||this._groups.map(_6),this._parents)}function Ate(t,e,n){var s=this.enter(),o=this,l=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?l.remove():n(l),s&&o?s.merge(o).order():o}function Cte(t){for(var e=t.selection?t.selection():t,n=this._groups,s=e._groups,o=n.length,l=s.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var p=n[h],g=s[h],x=p.length,v=f[h]=new Array(x),E,S=0;S<x;++S)(E=p[S]||g[S])&&(v[S]=E);for(;h<o;++h)f[h]=n[h];return new dl(f,this._parents)}function Tte(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var s=t[e],o=s.length-1,l=s[o],u;--o>=0;)(u=s[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function Rte(t){t||(t=jte);function e(x,v){return x&&v?t(x.__data__,v.__data__):!x-!v}for(var n=this._groups,s=n.length,o=new Array(s),l=0;l<s;++l){for(var u=n[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g])&&(h[g]=p);h.sort(e)}return new dl(o,this._parents).order()}function jte(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function kte(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Mte(){return Array.from(this)}function Vte(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],o=0,l=s.length;o<l;++o){var u=s[o];if(u)return u}return null}function Ute(){let t=0;for(const e of this)++t;return t}function Pte(){return!this.node()}function Ote(t){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var o=e[n],l=0,u=o.length,f;l<u;++l)(f=o[l])&&t.call(f,f.__data__,l,o);return this}function zte(t){return function(){this.removeAttribute(t)}}function Lte(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bte(t,e){return function(){this.setAttribute(t,e)}}function Ite(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hte(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qte(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Fte(t,e){var n=xD(t);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((e==null?n.local?Lte:zte:typeof e=="function"?n.local?qte:Hte:n.local?Ite:Bte)(n,e))}function w6(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gte(t){return function(){this.style.removeProperty(t)}}function Yte(t,e,n){return function(){this.style.setProperty(t,e,n)}}function $te(t,e,n){return function(){var s=e.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,n)}}function Xte(t,e,n){return arguments.length>1?this.each((e==null?Gte:typeof e=="function"?$te:Yte)(t,e,n??"")):av(this.node(),t)}function av(t,e){return t.style.getPropertyValue(e)||w6(t).getComputedStyle(t,null).getPropertyValue(e)}function Kte(t){return function(){delete this[t]}}function Wte(t,e){return function(){this[t]=e}}function Qte(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Zte(t,e){return arguments.length>1?this.each((e==null?Kte:typeof e=="function"?Qte:Wte)(t,e)):this.node()[t]}function N6(t){return t.trim().split(/^|\s+/)}function zj(t){return t.classList||new S6(t)}function S6(t){this._node=t,this._names=N6(t.getAttribute("class")||"")}S6.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function D6(t,e){for(var n=zj(t),s=-1,o=e.length;++s<o;)n.add(e[s])}function A6(t,e){for(var n=zj(t),s=-1,o=e.length;++s<o;)n.remove(e[s])}function Jte(t){return function(){D6(this,t)}}function ene(t){return function(){A6(this,t)}}function tne(t,e){return function(){(e.apply(this,arguments)?D6:A6)(this,t)}}function nne(t,e){var n=N6(t+"");if(arguments.length<2){for(var s=zj(this.node()),o=-1,l=n.length;++o<l;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?tne:e?Jte:ene)(n,e))}function rne(){this.textContent=""}function sne(t){return function(){this.textContent=t}}function ine(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function one(t){return arguments.length?this.each(t==null?rne:(typeof t=="function"?ine:sne)(t)):this.node().textContent}function ane(){this.innerHTML=""}function lne(t){return function(){this.innerHTML=t}}function une(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function cne(t){return arguments.length?this.each(t==null?ane:(typeof t=="function"?une:lne)(t)):this.node().innerHTML}function dne(){this.nextSibling&&this.parentNode.appendChild(this)}function fne(){return this.each(dne)}function hne(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mne(){return this.each(hne)}function pne(t){var e=typeof t=="function"?t:x6(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function gne(){return null}function bne(t,e){var n=typeof t=="function"?t:x6(t),s=e==null?gne:typeof e=="function"?e:Oj(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function xne(){var t=this.parentNode;t&&t.removeChild(this)}function yne(){return this.each(xne)}function vne(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ene(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _ne(t){return this.select(t?Ene:vne)}function wne(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nne(t){return function(e){t.call(this,e,this.__data__)}}function Sne(t){return t.trim().split(/^|\s+/).map(function(e){var n="",s=e.indexOf(".");return s>=0&&(n=e.slice(s+1),e=e.slice(0,s)),{type:e,name:n}})}function Dne(t){return function(){var e=this.__on;if(e){for(var n=0,s=-1,o=e.length,l;n<o;++n)l=e[n],(!t.type||l.type===t.type)&&l.name===t.name?this.removeEventListener(l.type,l.listener,l.options):e[++s]=l;++s?e.length=s:delete this.__on}}}function Ane(t,e,n){return function(){var s=this.__on,o,l=Nne(e);if(s){for(var u=0,f=s.length;u<f;++u)if((o=s[u]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=n),o.value=e;return}}this.addEventListener(t.type,l,n),o={type:t.type,name:t.name,value:e,listener:l,options:n},s?s.push(o):this.__on=[o]}}function Cne(t,e,n){var s=Sne(t+""),o,l=s.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,p=f.length,g;h<p;++h)for(o=0,g=f[h];o<l;++o)if((u=s[o]).type===g.type&&u.name===g.name)return g.value}return}for(f=e?Ane:Dne,o=0;o<l;++o)this.each(f(s[o],e,n));return this}function C6(t,e,n){var s=w6(t),o=s.CustomEvent;typeof o=="function"?o=new o(e,n):(o=s.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Tne(t,e){return function(){return C6(this,t,e)}}function Rne(t,e){return function(){return C6(this,t,e.apply(this,arguments))}}function jne(t,e){return this.each((typeof e=="function"?Rne:Tne)(t,e))}function*kne(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],o=0,l=s.length,u;o<l;++o)(u=s[o])&&(yield u)}var T6=[null];function dl(t,e){this._groups=t,this._parents=e}function u_(){return new dl([[document.documentElement]],T6)}function Mne(){return this}dl.prototype=u_.prototype={constructor:dl,select:ite,selectAll:ute,selectChild:hte,selectChildren:bte,filter:xte,data:Nte,enter:yte,exit:Dte,join:Ate,merge:Cte,selection:Mne,order:Tte,sort:Rte,call:kte,nodes:Mte,node:Vte,size:Ute,empty:Pte,each:Ote,attr:Fte,style:Xte,property:Zte,classed:nne,text:one,html:cne,raise:fne,lower:mne,append:pne,insert:bne,remove:yne,clone:_ne,datum:wne,on:Cne,dispatch:jne,[Symbol.iterator]:kne};function ll(t){return typeof t=="string"?new dl([[document.querySelector(t)]],[document.documentElement]):new dl([[t]],T6)}function Vne(t){let e;for(;e=t.sourceEvent;)t=e;return t}function hc(t,e){if(t=Vne(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(e.getScreenCTM().inverse()),[s.x,s.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const Une={passive:!1},F1={capture:!0,passive:!1};function yT(t){t.stopImmediatePropagation()}function Qy(t){t.preventDefault(),t.stopImmediatePropagation()}function R6(t){var e=t.document.documentElement,n=ll(t).on("dragstart.drag",Qy,F1);"onselectstart"in e?n.on("selectstart.drag",Qy,F1):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function j6(t,e){var n=t.document.documentElement,s=ll(t).on("dragstart.drag",null);e&&(s.on("click.drag",Qy,F1),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const uS=t=>()=>t;function RR(t,{sourceEvent:e,subject:n,target:s,identifier:o,active:l,x:u,y:f,dx:h,dy:p,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:g}})}RR.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Pne(t){return!t.ctrlKey&&!t.button}function One(){return this.parentNode}function zne(t,e){return e??{x:t.x,y:t.y}}function Lne(){return navigator.maxTouchPoints||"ontouchstart"in this}function k6(){var t=Pne,e=One,n=zne,s=Lne,o={},l=bD("start","drag","end"),u=0,f,h,p,g,x=0;function v(U){U.on("mousedown.drag",E).filter(s).on("touchstart.drag",D).on("touchmove.drag",A,Une).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(U,P){if(!(g||!t.call(this,U,P))){var z=j(this,e.call(this,U,P),U,P,"mouse");z&&(ll(U.view).on("mousemove.drag",S,F1).on("mouseup.drag",T,F1),R6(U.view),yT(U),p=!1,f=U.clientX,h=U.clientY,z("start",U))}}function S(U){if(Qy(U),!p){var P=U.clientX-f,z=U.clientY-h;p=P*P+z*z>x}o.mouse("drag",U)}function T(U){ll(U.view).on("mousemove.drag mouseup.drag",null),j6(U.view,p),Qy(U),o.mouse("end",U)}function D(U,P){if(t.call(this,U,P)){var z=U.changedTouches,K=e.call(this,U,P),te=z.length,H,I;for(H=0;H<te;++H)(I=j(this,K,U,P,z[H].identifier,z[H]))&&(yT(U),I("start",U,z[H]))}}function A(U){var P=U.changedTouches,z=P.length,K,te;for(K=0;K<z;++K)(te=o[P[K].identifier])&&(Qy(U),te("drag",U,P[K]))}function M(U){var P=U.changedTouches,z=P.length,K,te;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),K=0;K<z;++K)(te=o[P[K].identifier])&&(yT(U),te("end",U,P[K]))}function j(U,P,z,K,te,H){var I=l.copy(),F=hc(H||z,P),$,J,X;if((X=n.call(U,new RR("beforestart",{sourceEvent:z,target:v,identifier:te,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),K))!=null)return $=X.x-F[0]||0,J=X.y-F[1]||0,function Q(L,ee,ne){var oe=F,G;switch(L){case"start":o[te]=Q,G=u++;break;case"end":delete o[te],--u;case"drag":F=hc(ne||ee,P),G=u;break}I.call(L,U,new RR(L,{sourceEvent:ee,subject:X,target:v,identifier:te,active:G,x:F[0]+$,y:F[1]+J,dx:F[0]-oe[0],dy:F[1]-oe[1],dispatch:I}),K)}}return v.filter=function(U){return arguments.length?(t=typeof U=="function"?U:uS(!!U),v):t},v.container=function(U){return arguments.length?(e=typeof U=="function"?U:uS(U),v):e},v.subject=function(U){return arguments.length?(n=typeof U=="function"?U:uS(U),v):n},v.touchable=function(U){return arguments.length?(s=typeof U=="function"?U:uS(!!U),v):s},v.on=function(){var U=l.on.apply(l,arguments);return U===l?v:U},v.clickDistance=function(U){return arguments.length?(x=(U=+U)*U,v):Math.sqrt(x)},v}function Lj(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function M6(t,e){var n=Object.create(t.prototype);for(var s in e)n[s]=e[s];return n}function c_(){}var G1=.7,YS=1/G1,Zy="\\s*([+-]?\\d+)\\s*",Y1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bne=/^#([0-9a-f]{3,8})$/,Ine=new RegExp(`^rgb\\(${Zy},${Zy},${Zy}\\)$`),Hne=new RegExp(`^rgb\\(${gd},${gd},${gd}\\)$`),qne=new RegExp(`^rgba\\(${Zy},${Zy},${Zy},${Y1}\\)$`),Fne=new RegExp(`^rgba\\(${gd},${gd},${gd},${Y1}\\)$`),Gne=new RegExp(`^hsl\\(${Y1},${gd},${gd}\\)$`),Yne=new RegExp(`^hsla\\(${Y1},${gd},${gd},${Y1}\\)$`),y3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Lj(c_,nb,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:v3,formatHex:v3,formatHex8:$ne,formatHsl:Xne,formatRgb:E3,toString:E3});function v3(){return this.rgb().formatHex()}function $ne(){return this.rgb().formatHex8()}function Xne(){return V6(this).formatHsl()}function E3(){return this.rgb().formatRgb()}function nb(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Bne.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?_3(e):n===3?new ma(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?cS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?cS(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ine.exec(t))?new ma(e[1],e[2],e[3],1):(e=Hne.exec(t))?new ma(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qne.exec(t))?cS(e[1],e[2],e[3],e[4]):(e=Fne.exec(t))?cS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Gne.exec(t))?S3(e[1],e[2]/100,e[3]/100,1):(e=Yne.exec(t))?S3(e[1],e[2]/100,e[3]/100,e[4]):y3.hasOwnProperty(t)?_3(y3[t]):t==="transparent"?new ma(NaN,NaN,NaN,0):null}function _3(t){return new ma(t>>16&255,t>>8&255,t&255,1)}function cS(t,e,n,s){return s<=0&&(t=e=n=NaN),new ma(t,e,n,s)}function Kne(t){return t instanceof c_||(t=nb(t)),t?(t=t.rgb(),new ma(t.r,t.g,t.b,t.opacity)):new ma}function jR(t,e,n,s){return arguments.length===1?Kne(t):new ma(t,e,n,s??1)}function ma(t,e,n,s){this.r=+t,this.g=+e,this.b=+n,this.opacity=+s}Lj(ma,jR,M6(c_,{brighter(t){return t=t==null?YS:Math.pow(YS,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?G1:Math.pow(G1,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ma(Wg(this.r),Wg(this.g),Wg(this.b),$S(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w3,formatHex:w3,formatHex8:Wne,formatRgb:N3,toString:N3}));function w3(){return`#${Kg(this.r)}${Kg(this.g)}${Kg(this.b)}`}function Wne(){return`#${Kg(this.r)}${Kg(this.g)}${Kg(this.b)}${Kg((isNaN(this.opacity)?1:this.opacity)*255)}`}function N3(){const t=$S(this.opacity);return`${t===1?"rgb(":"rgba("}${Wg(this.r)}, ${Wg(this.g)}, ${Wg(this.b)}${t===1?")":`, ${t})`}`}function $S(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Wg(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Kg(t){return t=Wg(t),(t<16?"0":"")+t.toString(16)}function S3(t,e,n,s){return s<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pc(t,e,n,s)}function V6(t){if(t instanceof pc)return new pc(t.h,t.s,t.l,t.opacity);if(t instanceof c_||(t=nb(t)),!t)return new pc;if(t instanceof pc)return t;t=t.rgb();var e=t.r/255,n=t.g/255,s=t.b/255,o=Math.min(e,n,s),l=Math.max(e,n,s),u=NaN,f=l-o,h=(l+o)/2;return f?(e===l?u=(n-s)/f+(n<s)*6:n===l?u=(s-e)/f+2:u=(e-n)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new pc(u,f,h,t.opacity)}function Qne(t,e,n,s){return arguments.length===1?V6(t):new pc(t,e,n,s??1)}function pc(t,e,n,s){this.h=+t,this.s=+e,this.l=+n,this.opacity=+s}Lj(pc,Qne,M6(c_,{brighter(t){return t=t==null?YS:Math.pow(YS,t),new pc(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?G1:Math.pow(G1,t),new pc(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*e,o=2*n-s;return new ma(vT(t>=240?t-240:t+120,o,s),vT(t,o,s),vT(t<120?t+240:t-120,o,s),this.opacity)},clamp(){return new pc(D3(this.h),dS(this.s),dS(this.l),$S(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=$S(this.opacity);return`${t===1?"hsl(":"hsla("}${D3(this.h)}, ${dS(this.s)*100}%, ${dS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function D3(t){return t=(t||0)%360,t<0?t+360:t}function dS(t){return Math.max(0,Math.min(1,t||0))}function vT(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Bj=t=>()=>t;function Zne(t,e){return function(n){return t+n*e}}function Jne(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(s){return Math.pow(t+s*e,n)}}function ere(t){return(t=+t)==1?U6:function(e,n){return n-e?Jne(e,n,t):Bj(isNaN(e)?n:e)}}function U6(t,e){var n=e-t;return n?Zne(t,n):Bj(isNaN(t)?e:t)}const XS=(function t(e){var n=ere(e);function s(o,l){var u=n((o=jR(o)).r,(l=jR(l)).r),f=n(o.g,l.g),h=n(o.b,l.b),p=U6(o.opacity,l.opacity);return function(g){return o.r=u(g),o.g=f(g),o.b=h(g),o.opacity=p(g),o+""}}return s.gamma=t,s})(1);function tre(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,s=e.slice(),o;return function(l){for(o=0;o<n;++o)s[o]=t[o]*(1-l)+e[o]*l;return s}}function nre(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function rre(t,e){var n=e?e.length:0,s=t?Math.min(n,t.length):0,o=new Array(s),l=new Array(n),u;for(u=0;u<s;++u)o[u]=M1(t[u],e[u]);for(;u<n;++u)l[u]=e[u];return function(f){for(u=0;u<s;++u)l[u]=o[u](f);return l}}function sre(t,e){var n=new Date;return t=+t,e=+e,function(s){return n.setTime(t*(1-s)+e*s),n}}function hd(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ire(t,e){var n={},s={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=M1(t[o],e[o]):s[o]=e[o];return function(l){for(o in n)s[o]=n[o](l);return s}}var kR=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ET=new RegExp(kR.source,"g");function ore(t){return function(){return t}}function are(t){return function(e){return t(e)+""}}function P6(t,e){var n=kR.lastIndex=ET.lastIndex=0,s,o,l,u=-1,f=[],h=[];for(t=t+"",e=e+"";(s=kR.exec(t))&&(o=ET.exec(e));)(l=o.index)>n&&(l=e.slice(n,l),f[u]?f[u]+=l:f[++u]=l),(s=s[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:hd(s,o)})),n=ET.lastIndex;return n<e.length&&(l=e.slice(n),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?are(h[0].x):ore(e):(e=h.length,function(p){for(var g=0,x;g<e;++g)f[(x=h[g]).i]=x.x(p);return f.join("")})}function M1(t,e){var n=typeof e,s;return e==null||n==="boolean"?Bj(e):(n==="number"?hd:n==="string"?(s=nb(e))?(e=s,XS):P6:e instanceof nb?XS:e instanceof Date?sre:nre(e)?tre:Array.isArray(e)?rre:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ire:hd)(t,e)}var A3=180/Math.PI,MR={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function O6(t,e,n,s,o,l){var u,f,h;return(u=Math.sqrt(t*t+e*e))&&(t/=u,e/=u),(h=t*n+e*s)&&(n-=t*h,s-=e*h),(f=Math.sqrt(n*n+s*s))&&(n/=f,s/=f,h/=f),t*s<e*n&&(t=-t,e=-e,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(e,t)*A3,skewX:Math.atan(h)*A3,scaleX:u,scaleY:f}}var fS;function lre(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?MR:O6(e.a,e.b,e.c,e.d,e.e,e.f)}function ure(t){return t==null||(fS||(fS=document.createElementNS("http://www.w3.org/2000/svg","g")),fS.setAttribute("transform",t),!(t=fS.transform.baseVal.consolidate()))?MR:(t=t.matrix,O6(t.a,t.b,t.c,t.d,t.e,t.f))}function z6(t,e,n,s){function o(p){return p.length?p.pop()+" ":""}function l(p,g,x,v,E,S){if(p!==x||g!==v){var T=E.push("translate(",null,e,null,n);S.push({i:T-4,x:hd(p,x)},{i:T-2,x:hd(g,v)})}else(x||v)&&E.push("translate("+x+e+v+n)}function u(p,g,x,v){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),v.push({i:x.push(o(x)+"rotate(",null,s)-2,x:hd(p,g)})):g&&x.push(o(x)+"rotate("+g+s)}function f(p,g,x,v){p!==g?v.push({i:x.push(o(x)+"skewX(",null,s)-2,x:hd(p,g)}):g&&x.push(o(x)+"skewX("+g+s)}function h(p,g,x,v,E,S){if(p!==x||g!==v){var T=E.push(o(E)+"scale(",null,",",null,")");S.push({i:T-4,x:hd(p,x)},{i:T-2,x:hd(g,v)})}else(x!==1||v!==1)&&E.push(o(E)+"scale("+x+","+v+")")}return function(p,g){var x=[],v=[];return p=t(p),g=t(g),l(p.translateX,p.translateY,g.translateX,g.translateY,x,v),u(p.rotate,g.rotate,x,v),f(p.skewX,g.skewX,x,v),h(p.scaleX,p.scaleY,g.scaleX,g.scaleY,x,v),p=g=null,function(E){for(var S=-1,T=v.length,D;++S<T;)x[(D=v[S]).i]=D.x(E);return x.join("")}}}var cre=z6(lre,"px, ","px)","deg)"),dre=z6(ure,", ",")",")"),fre=1e-12;function C3(t){return((t=Math.exp(t))+1/t)/2}function hre(t){return((t=Math.exp(t))-1/t)/2}function mre(t){return((t=Math.exp(2*t))-1)/(t+1)}const SS=(function t(e,n,s){function o(l,u){var f=l[0],h=l[1],p=l[2],g=u[0],x=u[1],v=u[2],E=g-f,S=x-h,T=E*E+S*S,D,A;if(T<fre)A=Math.log(v/p)/e,D=function(K){return[f+K*E,h+K*S,p*Math.exp(e*K*A)]};else{var M=Math.sqrt(T),j=(v*v-p*p+s*T)/(2*p*n*M),U=(v*v-p*p-s*T)/(2*v*n*M),P=Math.log(Math.sqrt(j*j+1)-j),z=Math.log(Math.sqrt(U*U+1)-U);A=(z-P)/e,D=function(K){var te=K*A,H=C3(P),I=p/(n*M)*(H*mre(e*te+P)-hre(P));return[f+I*E,h+I*S,p*H/C3(e*te+P)]}}return D.duration=A*1e3*e/Math.SQRT2,D}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return t(u,f,h)},o})(Math.SQRT2,2,4);var lv=0,E1=0,m1=0,L6=1e3,KS,_1,WS=0,rb=0,yD=0,$1=typeof performance=="object"&&performance.now?performance:Date,B6=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ij(){return rb||(B6(pre),rb=$1.now()+yD)}function pre(){rb=0}function QS(){this._call=this._time=this._next=null}QS.prototype=I6.prototype={constructor:QS,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ij():+n)+(e==null?0:+e),!this._next&&_1!==this&&(_1?_1._next=this:KS=this,_1=this),this._call=t,this._time=n,VR()},stop:function(){this._call&&(this._call=null,this._time=1/0,VR())}};function I6(t,e,n){var s=new QS;return s.restart(t,e,n),s}function gre(){Ij(),++lv;for(var t=KS,e;t;)(e=rb-t._time)>=0&&t._call.call(void 0,e),t=t._next;--lv}function T3(){rb=(WS=$1.now())+yD,lv=E1=0;try{gre()}finally{lv=0,xre(),rb=0}}function bre(){var t=$1.now(),e=t-WS;e>L6&&(yD-=e,WS=t)}function xre(){for(var t,e=KS,n,s=1/0;e;)e._call?(s>e._time&&(s=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:KS=n);_1=t,VR(s)}function VR(t){if(!lv){E1&&(E1=clearTimeout(E1));var e=t-rb;e>24?(t<1/0&&(E1=setTimeout(T3,t-$1.now()-yD)),m1&&(m1=clearInterval(m1))):(m1||(WS=$1.now(),m1=setInterval(bre,L6)),lv=1,B6(T3))}}function R3(t,e,n){var s=new QS;return e=e==null?0:+e,s.restart(o=>{s.stop(),t(o+e)},e,n),s}var yre=bD("start","end","cancel","interrupt"),vre=[],H6=0,j3=1,UR=2,DS=3,k3=4,PR=5,AS=6;function vD(t,e,n,s,o,l){var u=t.__transition;if(!u)t.__transition={};else if(n in u)return;Ere(t,n,{name:e,index:s,group:o,on:yre,tween:vre,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:H6})}function Hj(t,e){var n=Sc(t,e);if(n.state>H6)throw new Error("too late; already scheduled");return n}function yd(t,e){var n=Sc(t,e);if(n.state>DS)throw new Error("too late; already running");return n}function Sc(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ere(t,e,n){var s=t.__transition,o;s[e]=n,n.timer=I6(l,0,n.time);function l(p){n.state=j3,n.timer.restart(u,n.delay,n.time),n.delay<=p&&u(p-n.delay)}function u(p){var g,x,v,E;if(n.state!==j3)return h();for(g in s)if(E=s[g],E.name===n.name){if(E.state===DS)return R3(u);E.state===k3?(E.state=AS,E.timer.stop(),E.on.call("interrupt",t,t.__data__,E.index,E.group),delete s[g]):+g<e&&(E.state=AS,E.timer.stop(),E.on.call("cancel",t,t.__data__,E.index,E.group),delete s[g])}if(R3(function(){n.state===DS&&(n.state=k3,n.timer.restart(f,n.delay,n.time),f(p))}),n.state=UR,n.on.call("start",t,t.__data__,n.index,n.group),n.state===UR){for(n.state=DS,o=new Array(v=n.tween.length),g=0,x=-1;g<v;++g)(E=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(o[++x]=E);o.length=x+1}}function f(p){for(var g=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(h),n.state=PR,1),x=-1,v=o.length;++x<v;)o[x].call(t,g);n.state===PR&&(n.on.call("end",t,t.__data__,n.index,n.group),h())}function h(){n.state=AS,n.timer.stop(),delete s[e];for(var p in s)return;delete t.__transition}}function CS(t,e){var n=t.__transition,s,o,l=!0,u;if(n){e=e==null?null:e+"";for(u in n){if((s=n[u]).name!==e){l=!1;continue}o=s.state>UR&&s.state<PR,s.state=AS,s.timer.stop(),s.on.call(o?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete n[u]}l&&delete t.__transition}}function _re(t){return this.each(function(){CS(this,t)})}function wre(t,e){var n,s;return function(){var o=yd(this,t),l=o.tween;if(l!==n){s=n=l;for(var u=0,f=s.length;u<f;++u)if(s[u].name===e){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function Nre(t,e,n){var s,o;if(typeof n!="function")throw new Error;return function(){var l=yd(this,t),u=l.tween;if(u!==s){o=(s=u).slice();for(var f={name:e,value:n},h=0,p=o.length;h<p;++h)if(o[h].name===e){o[h]=f;break}h===p&&o.push(f)}l.tween=o}}function Sre(t,e){var n=this._id;if(t+="",arguments.length<2){for(var s=Sc(this.node(),n).tween,o=0,l=s.length,u;o<l;++o)if((u=s[o]).name===t)return u.value;return null}return this.each((e==null?wre:Nre)(n,t,e))}function qj(t,e,n){var s=t._id;return t.each(function(){var o=yd(this,s);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Sc(o,s).value[e]}}function q6(t,e){var n;return(typeof e=="number"?hd:e instanceof nb?XS:(n=nb(e))?(e=n,XS):P6)(t,e)}function Dre(t){return function(){this.removeAttribute(t)}}function Are(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Cre(t,e,n){var s,o=n+"",l;return function(){var u=this.getAttribute(t);return u===o?null:u===s?l:l=e(s=u,n)}}function Tre(t,e,n){var s,o=n+"",l;return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===s?l:l=e(s=u,n)}}function Rre(t,e,n){var s,o,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttribute(t):(u=this.getAttribute(t),h=f+"",u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f)))}}function jre(t,e,n){var s,o,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),h=f+"",u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f)))}}function kre(t,e){var n=xD(t),s=n==="transform"?dre:q6;return this.attrTween(t,typeof e=="function"?(n.local?jre:Rre)(n,s,qj(this,"attr."+t,e)):e==null?(n.local?Are:Dre)(n):(n.local?Tre:Cre)(n,s,e))}function Mre(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Vre(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ure(t,e){var n,s;function o(){var l=e.apply(this,arguments);return l!==s&&(n=(s=l)&&Vre(t,l)),n}return o._value=e,o}function Pre(t,e){var n,s;function o(){var l=e.apply(this,arguments);return l!==s&&(n=(s=l)&&Mre(t,l)),n}return o._value=e,o}function Ore(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var s=xD(t);return this.tween(n,(s.local?Ure:Pre)(s,e))}function zre(t,e){return function(){Hj(this,t).delay=+e.apply(this,arguments)}}function Lre(t,e){return e=+e,function(){Hj(this,t).delay=e}}function Bre(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zre:Lre)(e,t)):Sc(this.node(),e).delay}function Ire(t,e){return function(){yd(this,t).duration=+e.apply(this,arguments)}}function Hre(t,e){return e=+e,function(){yd(this,t).duration=e}}function qre(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ire:Hre)(e,t)):Sc(this.node(),e).duration}function Fre(t,e){if(typeof e!="function")throw new Error;return function(){yd(this,t).ease=e}}function Gre(t){var e=this._id;return arguments.length?this.each(Fre(e,t)):Sc(this.node(),e).ease}function Yre(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yd(this,t).ease=n}}function $re(t){if(typeof t!="function")throw new Error;return this.each(Yre(this._id,t))}function Xre(t){typeof t!="function"&&(t=v6(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=[],h,p=0;p<u;++p)(h=l[p])&&t.call(h,h.__data__,p,l)&&f.push(h);return new Zf(s,this._parents,this._name,this._id)}function Kre(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,s=e.length,o=n.length,l=Math.min(s,o),u=new Array(s),f=0;f<l;++f)for(var h=e[f],p=n[f],g=h.length,x=u[f]=new Array(g),v,E=0;E<g;++E)(v=h[E]||p[E])&&(x[E]=v);for(;f<s;++f)u[f]=e[f];return new Zf(u,this._parents,this._name,this._id)}function Wre(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Qre(t,e,n){var s,o,l=Wre(e)?Hj:yd;return function(){var u=l(this,t),f=u.on;f!==s&&(o=(s=f).copy()).on(e,n),u.on=o}}function Zre(t,e){var n=this._id;return arguments.length<2?Sc(this.node(),n).on.on(t):this.each(Qre(n,t,e))}function Jre(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ese(){return this.on("end.remove",Jre(this._id))}function tse(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Oj(t));for(var s=this._groups,o=s.length,l=new Array(o),u=0;u<o;++u)for(var f=s[u],h=f.length,p=l[u]=new Array(h),g,x,v=0;v<h;++v)(g=f[v])&&(x=t.call(g,g.__data__,v,f))&&("__data__"in g&&(x.__data__=g.__data__),p[v]=x,vD(p[v],e,n,v,p,Sc(g,n)));return new Zf(l,this._parents,e,n)}function nse(t){var e=this._name,n=this._id;typeof t!="function"&&(t=y6(t));for(var s=this._groups,o=s.length,l=[],u=[],f=0;f<o;++f)for(var h=s[f],p=h.length,g,x=0;x<p;++x)if(g=h[x]){for(var v=t.call(g,g.__data__,x,h),E,S=Sc(g,n),T=0,D=v.length;T<D;++T)(E=v[T])&&vD(E,e,n,T,v,S);l.push(v),u.push(g)}return new Zf(l,u,e,n)}var rse=u_.prototype.constructor;function sse(){return new rse(this._groups,this._parents)}function ise(t,e){var n,s,o;return function(){var l=av(this,t),u=(this.style.removeProperty(t),av(this,t));return l===u?null:l===n&&u===s?o:o=e(n=l,s=u)}}function F6(t){return function(){this.style.removeProperty(t)}}function ose(t,e,n){var s,o=n+"",l;return function(){var u=av(this,t);return u===o?null:u===s?l:l=e(s=u,n)}}function ase(t,e,n){var s,o,l;return function(){var u=av(this,t),f=n(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(t),av(this,t))),u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f))}}function lse(t,e){var n,s,o,l="style."+e,u="end."+l,f;return function(){var h=yd(this,t),p=h.on,g=h.value[l]==null?f||(f=F6(e)):void 0;(p!==n||o!==g)&&(s=(n=p).copy()).on(u,o=g),h.on=s}}function use(t,e,n){var s=(t+="")=="transform"?cre:q6;return e==null?this.styleTween(t,ise(t,s)).on("end.style."+t,F6(t)):typeof e=="function"?this.styleTween(t,ase(t,s,qj(this,"style."+t,e))).each(lse(this._id,t)):this.styleTween(t,ose(t,s,e),n).on("end.style."+t,null)}function cse(t,e,n){return function(s){this.style.setProperty(t,e.call(this,s),n)}}function dse(t,e,n){var s,o;function l(){var u=e.apply(this,arguments);return u!==o&&(s=(o=u)&&cse(t,u,n)),s}return l._value=e,l}function fse(t,e,n){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(e==null)return this.tween(s,null);if(typeof e!="function")throw new Error;return this.tween(s,dse(t,e,n??""))}function hse(t){return function(){this.textContent=t}}function mse(t){return function(){var e=t(this);this.textContent=e??""}}function pse(t){return this.tween("text",typeof t=="function"?mse(qj(this,"text",t)):hse(t==null?"":t+""))}function gse(t){return function(e){this.textContent=t.call(this,e)}}function bse(t){var e,n;function s(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&gse(o)),e}return s._value=t,s}function xse(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,bse(t))}function yse(){for(var t=this._name,e=this._id,n=G6(),s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],f=u.length,h,p=0;p<f;++p)if(h=u[p]){var g=Sc(h,e);vD(h,t,n,p,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Zf(s,this._parents,t,n)}function vse(){var t,e,n=this,s=n._id,o=n.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};n.each(function(){var p=yd(this,s),g=p.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(f),e._.interrupt.push(f),e._.end.push(h)),p.on=e}),o===0&&l()})}var Ese=0;function Zf(t,e,n,s){this._groups=t,this._parents=e,this._name=n,this._id=s}function G6(){return++Ese}var Hf=u_.prototype;Zf.prototype={constructor:Zf,select:tse,selectAll:nse,selectChild:Hf.selectChild,selectChildren:Hf.selectChildren,filter:Xre,merge:Kre,selection:sse,transition:yse,call:Hf.call,nodes:Hf.nodes,node:Hf.node,size:Hf.size,empty:Hf.empty,each:Hf.each,on:Zre,attr:kre,attrTween:Ore,style:use,styleTween:fse,text:pse,textTween:xse,remove:ese,tween:Sre,delay:Bre,duration:qre,ease:Gre,easeVarying:$re,end:vse,[Symbol.iterator]:Hf[Symbol.iterator]};function _se(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var wse={time:null,delay:0,duration:250,ease:_se};function Nse(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Sse(t){var e,n;t instanceof Zf?(e=t._id,t=t._name):(e=G6(),(n=wse).time=Ij(),t=t==null?null:t+"");for(var s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&vD(h,t,e,p,u,n||Nse(h,e));return new Zf(s,this._parents,t,e)}u_.prototype.interrupt=_re;u_.prototype.transition=Sse;const hS=t=>()=>t;function Dse(t,{sourceEvent:e,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Yf(t,e,n){this.k=t,this.x=e,this.y=n}Yf.prototype={constructor:Yf,scale:function(t){return t===1?this:new Yf(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Yf(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ED=new Yf(1,0,0);Y6.prototype=Yf.prototype;function Y6(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ED;return t.__zoom}function _T(t){t.stopImmediatePropagation()}function p1(t){t.preventDefault(),t.stopImmediatePropagation()}function Ase(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Cse(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function M3(){return this.__zoom||ED}function Tse(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rse(){return navigator.maxTouchPoints||"ontouchstart"in this}function jse(t,e,n){var s=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],l=t.invertY(e[0][1])-n[0][1],u=t.invertY(e[1][1])-n[1][1];return t.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $6(){var t=Ase,e=Cse,n=jse,s=Tse,o=Rse,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=SS,p=bD("start","zoom","end"),g,x,v,E=500,S=150,T=0,D=10;function A(X){X.property("__zoom",M3).on("wheel.zoom",te,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(X,Q,L,ee){var ne=X.selection?X.selection():X;ne.property("__zoom",M3),X!==ne?P(X,Q,L,ee):ne.interrupt().each(function(){z(this,arguments).event(ee).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},A.scaleBy=function(X,Q,L,ee){A.scaleTo(X,function(){var ne=this.__zoom.k,oe=typeof Q=="function"?Q.apply(this,arguments):Q;return ne*oe},L,ee)},A.scaleTo=function(X,Q,L,ee){A.transform(X,function(){var ne=e.apply(this,arguments),oe=this.__zoom,G=L==null?U(ne):typeof L=="function"?L.apply(this,arguments):L,B=oe.invert(G),ae=typeof Q=="function"?Q.apply(this,arguments):Q;return n(j(M(oe,ae),G,B),ne,u)},L,ee)},A.translateBy=function(X,Q,L,ee){A.transform(X,function(){return n(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof L=="function"?L.apply(this,arguments):L),e.apply(this,arguments),u)},null,ee)},A.translateTo=function(X,Q,L,ee,ne){A.transform(X,function(){var oe=e.apply(this,arguments),G=this.__zoom,B=ee==null?U(oe):typeof ee=="function"?ee.apply(this,arguments):ee;return n(ED.translate(B[0],B[1]).scale(G.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof L=="function"?-L.apply(this,arguments):-L),oe,u)},ee,ne)};function M(X,Q){return Q=Math.max(l[0],Math.min(l[1],Q)),Q===X.k?X:new Yf(Q,X.x,X.y)}function j(X,Q,L){var ee=Q[0]-L[0]*X.k,ne=Q[1]-L[1]*X.k;return ee===X.x&&ne===X.y?X:new Yf(X.k,ee,ne)}function U(X){return[(+X[0][0]+ +X[1][0])/2,(+X[0][1]+ +X[1][1])/2]}function P(X,Q,L,ee){X.on("start.zoom",function(){z(this,arguments).event(ee).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(ee).end()}).tween("zoom",function(){var ne=this,oe=arguments,G=z(ne,oe).event(ee),B=e.apply(ne,oe),ae=L==null?U(B):typeof L=="function"?L.apply(ne,oe):L,Z=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),be=ne.__zoom,Ve=typeof Q=="function"?Q.apply(ne,oe):Q,he=h(be.invert(ae).concat(Z/be.k),Ve.invert(ae).concat(Z/Ve.k));return function(Ne){if(Ne===1)Ne=Ve;else{var De=he(Ne),me=Z/De[2];Ne=new Yf(me,ae[0]-De[0]*me,ae[1]-De[1]*me)}G.zoom(null,Ne)}})}function z(X,Q,L){return!L&&X.__zooming||new K(X,Q)}function K(X,Q){this.that=X,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=e.apply(X,Q),this.taps=0}K.prototype={event:function(X){return X&&(this.sourceEvent=X),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(X,Q){return this.mouse&&X!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&X!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&X!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(X){var Q=ll(this.that).datum();p.call(X,this.that,new Dse(X,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:p}),Q)}};function te(X,...Q){if(!t.apply(this,arguments))return;var L=z(this,Q).event(X),ee=this.__zoom,ne=Math.max(l[0],Math.min(l[1],ee.k*Math.pow(2,s.apply(this,arguments)))),oe=hc(X);if(L.wheel)(L.mouse[0][0]!==oe[0]||L.mouse[0][1]!==oe[1])&&(L.mouse[1]=ee.invert(L.mouse[0]=oe)),clearTimeout(L.wheel);else{if(ee.k===ne)return;L.mouse=[oe,ee.invert(oe)],CS(this),L.start()}p1(X),L.wheel=setTimeout(G,S),L.zoom("mouse",n(j(M(ee,ne),L.mouse[0],L.mouse[1]),L.extent,u));function G(){L.wheel=null,L.end()}}function H(X,...Q){if(v||!t.apply(this,arguments))return;var L=X.currentTarget,ee=z(this,Q,!0).event(X),ne=ll(X.view).on("mousemove.zoom",ae,!0).on("mouseup.zoom",Z,!0),oe=hc(X,L),G=X.clientX,B=X.clientY;R6(X.view),_T(X),ee.mouse=[oe,this.__zoom.invert(oe)],CS(this),ee.start();function ae(be){if(p1(be),!ee.moved){var Ve=be.clientX-G,he=be.clientY-B;ee.moved=Ve*Ve+he*he>T}ee.event(be).zoom("mouse",n(j(ee.that.__zoom,ee.mouse[0]=hc(be,L),ee.mouse[1]),ee.extent,u))}function Z(be){ne.on("mousemove.zoom mouseup.zoom",null),j6(be.view,ee.moved),p1(be),ee.event(be).end()}}function I(X,...Q){if(t.apply(this,arguments)){var L=this.__zoom,ee=hc(X.changedTouches?X.changedTouches[0]:X,this),ne=L.invert(ee),oe=L.k*(X.shiftKey?.5:2),G=n(j(M(L,oe),ee,ne),e.apply(this,Q),u);p1(X),f>0?ll(this).transition().duration(f).call(P,G,ee,X):ll(this).call(A.transform,G,ee,X)}}function F(X,...Q){if(t.apply(this,arguments)){var L=X.touches,ee=L.length,ne=z(this,Q,X.changedTouches.length===ee).event(X),oe,G,B,ae;for(_T(X),G=0;G<ee;++G)B=L[G],ae=hc(B,this),ae=[ae,this.__zoom.invert(ae),B.identifier],ne.touch0?!ne.touch1&&ne.touch0[2]!==ae[2]&&(ne.touch1=ae,ne.taps=0):(ne.touch0=ae,oe=!0,ne.taps=1+!!g);g&&(g=clearTimeout(g)),oe&&(ne.taps<2&&(x=ae[0],g=setTimeout(function(){g=null},E)),CS(this),ne.start())}}function $(X,...Q){if(this.__zooming){var L=z(this,Q).event(X),ee=X.changedTouches,ne=ee.length,oe,G,B,ae;for(p1(X),oe=0;oe<ne;++oe)G=ee[oe],B=hc(G,this),L.touch0&&L.touch0[2]===G.identifier?L.touch0[0]=B:L.touch1&&L.touch1[2]===G.identifier&&(L.touch1[0]=B);if(G=L.that.__zoom,L.touch1){var Z=L.touch0[0],be=L.touch0[1],Ve=L.touch1[0],he=L.touch1[1],Ne=(Ne=Ve[0]-Z[0])*Ne+(Ne=Ve[1]-Z[1])*Ne,De=(De=he[0]-be[0])*De+(De=he[1]-be[1])*De;G=M(G,Math.sqrt(Ne/De)),B=[(Z[0]+Ve[0])/2,(Z[1]+Ve[1])/2],ae=[(be[0]+he[0])/2,(be[1]+he[1])/2]}else if(L.touch0)B=L.touch0[0],ae=L.touch0[1];else return;L.zoom("touch",n(j(G,B,ae),L.extent,u))}}function J(X,...Q){if(this.__zooming){var L=z(this,Q).event(X),ee=X.changedTouches,ne=ee.length,oe,G;for(_T(X),v&&clearTimeout(v),v=setTimeout(function(){v=null},E),oe=0;oe<ne;++oe)G=ee[oe],L.touch0&&L.touch0[2]===G.identifier?delete L.touch0:L.touch1&&L.touch1[2]===G.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(G=hc(G,this),Math.hypot(x[0]-G[0],x[1]-G[1])<D)){var B=ll(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return A.wheelDelta=function(X){return arguments.length?(s=typeof X=="function"?X:hS(+X),A):s},A.filter=function(X){return arguments.length?(t=typeof X=="function"?X:hS(!!X),A):t},A.touchable=function(X){return arguments.length?(o=typeof X=="function"?X:hS(!!X),A):o},A.extent=function(X){return arguments.length?(e=typeof X=="function"?X:hS([[+X[0][0],+X[0][1]],[+X[1][0],+X[1][1]]]),A):e},A.scaleExtent=function(X){return arguments.length?(l[0]=+X[0],l[1]=+X[1],A):[l[0],l[1]]},A.translateExtent=function(X){return arguments.length?(u[0][0]=+X[0][0],u[1][0]=+X[1][0],u[0][1]=+X[0][1],u[1][1]=+X[1][1],A):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},A.constrain=function(X){return arguments.length?(n=X,A):n},A.duration=function(X){return arguments.length?(f=+X,A):f},A.interpolate=function(X){return arguments.length?(h=X,A):h},A.on=function(){var X=p.on.apply(p,arguments);return X===p?A:X},A.clickDistance=function(X){return arguments.length?(T=(X=+X)*X,A):Math.sqrt(T)},A.tapDistance=function(X){return arguments.length?(D=+X,A):D},A}const fl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:s}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},X1=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],X6=["Enter"," ","Escape"],K6={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var uv;(function(t){t.Strict="strict",t.Loose="loose"})(uv||(uv={}));var Qg;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Qg||(Qg={}));var K1;(function(t){t.Partial="partial",t.Full="full"})(K1||(K1={}));const W6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var jm;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(jm||(jm={}));var W1;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(W1||(W1={}));var Dt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Dt||(Dt={}));const V3={[Dt.Left]:Dt.Right,[Dt.Right]:Dt.Left,[Dt.Top]:Dt.Bottom,[Dt.Bottom]:Dt.Top};function Q6(t){return t===null?null:t?"valid":"invalid"}const Z6=t=>"id"in t&&"source"in t&&"target"in t,kse=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Fj=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),d_=(t,e=[0,0])=>{const{width:n,height:s}=nh(t),o=t.origin??e,l=n*o[0],u=s*o[1];return{x:t.position.x-l,y:t.position.y-u}},Mse=(t,e={nodeOrigin:[0,0]})=>{if(e.nodeLookup||console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((s,o)=>{const l=typeof o=="string";let u=!e.nodeLookup&&!l?o:void 0;e.nodeLookup&&(u=l?e.nodeLookup.get(o):Fj(o)?o:e.nodeLookup.get(o.id));const f=u?ZS(u,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return _D(s,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wD(n)},f_=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(o=>{(e.filter===void 0||e.filter(o))&&(n=_D(n,ZS(o)),s=!0)}),s?wD(n):{x:0,y:0,width:0,height:0}},Gj=(t,e,[n,s,o]=[0,0,1],l=!1,u=!1)=>{const f={...m_(e,[n,s,o]),width:e.width/o,height:e.height/o},h=[];for(const p of t.values()){const{measured:g,selectable:x=!0,hidden:v=!1}=p;if(u&&!x||v)continue;const E=g.width??p.width??p.initialWidth??null,S=g.height??p.height??p.initialHeight??null,T=Q1(f,dv(p)),D=(E??0)*(S??0),A=l&&T>0;(!p.internals.handleBounds||A||T>=D||p.dragging)&&h.push(p)}return h},Vse=(t,e)=>{const n=new Set;return t.forEach(s=>{n.add(s.id)}),e.filter(s=>n.has(s.source)||n.has(s.target))};function Use(t,e){const n=new Map,s=e!=null&&e.nodes?new Set(e.nodes.map(o=>o.id)):null;return t.forEach(o=>{o.measured.width&&o.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function Pse({nodes:t,width:e,height:n,panZoom:s,minZoom:o,maxZoom:l},u){if(t.size===0)return Promise.resolve(!0);const f=Use(t,u),h=f_(f),p=Yj(h,e,n,(u==null?void 0:u.minZoom)??o,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await s.setViewport(p,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function J6({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:l}){const u=n.get(t),f=u.parentId?n.get(u.parentId):void 0,{x:h,y:p}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??s;let x=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)l==null||l("005",fl.error005());else{const E=f.measured.width,S=f.measured.height;E&&S&&(x=[[h,p],[h+E,p+S]])}else f&&fv(u.extent)&&(x=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const v=fv(x)?sb(e,x,u.measured):e;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",fl.error015())),{position:{x:v.x-h+(u.measured.width??0)*g[0],y:v.y-p+(u.measured.height??0)*g[1]},positionAbsolute:v}}async function Ose({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:s,onBeforeDelete:o}){const l=new Set(t.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const E=l.has(v.id),S=!E&&v.parentId&&u.find(T=>T.id===v.parentId);(E||S)&&u.push(v)}const f=new Set(e.map(v=>v.id)),h=s.filter(v=>v.deletable!==!1),g=Vse(u,h);for(const v of h)f.has(v.id)&&!g.find(S=>S.id===v.id)&&g.push(v);if(!o)return{edges:g,nodes:u};const x=await o({nodes:u,edges:g});return typeof x=="boolean"?x?{edges:g,nodes:u}:{edges:[],nodes:[]}:x}const cv=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),sb=(t={x:0,y:0},e,n)=>({x:cv(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:cv(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function ez(t,e,n){const{width:s,height:o}=nh(n),{x:l,y:u}=n.internals.positionAbsolute;return sb(t,[[l,u],[l+s,u+o]],e)}const U3=(t,e,n)=>t<e?cv(Math.abs(t-e),1,e)/e:t>n?-cv(Math.abs(t-n),1,e)/e:0,tz=(t,e,n=15,s=40)=>{const o=U3(t.x,s,e.width-s)*n,l=U3(t.y,s,e.height-s)*n;return[o,l]},_D=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),OR=({x:t,y:e,width:n,height:s})=>({x:t,y:e,x2:t+n,y2:e+s}),wD=({x:t,y:e,x2:n,y2:s})=>({x:t,y:e,width:n-t,height:s-e}),dv=(t,e=[0,0])=>{var o,l;const{x:n,y:s}=Fj(t)?t.internals.positionAbsolute:d_(t,e);return{x:n,y:s,width:((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0,height:((l=t.measured)==null?void 0:l.height)??t.height??t.initialHeight??0}},ZS=(t,e=[0,0])=>{var o,l;const{x:n,y:s}=Fj(t)?t.internals.positionAbsolute:d_(t,e);return{x:n,y:s,x2:n+(((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0),y2:s+(((l=t.measured)==null?void 0:l.height)??t.height??t.initialHeight??0)}},nz=(t,e)=>wD(_D(OR(t),OR(e))),Q1=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),s=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*s)},P3=t=>gc(t.width)&&gc(t.height)&&gc(t.x)&&gc(t.y),gc=t=>!isNaN(t)&&isFinite(t),rz=(t,e)=>{console.warn(`[React Flow]: ${e} Help: https://reactflow.dev/error#${t}`)},h_=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),m_=({x:t,y:e},[n,s,o],l=!1,u=[1,1])=>{const f={x:(t-n)/o,y:(e-s)/o};return l?h_(f,u):f},JS=({x:t,y:e},[n,s,o])=>({x:t*o+n,y:e*o+s});function Uy(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function zse(t,e,n){if(typeof t=="string"||typeof t=="number"){const s=Uy(t,n),o=Uy(t,e);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof t=="object"){const s=Uy(t.top??t.y??0,n),o=Uy(t.bottom??t.y??0,n),l=Uy(t.left??t.x??0,e),u=Uy(t.right??t.x??0,e);return{top:s,right:u,bottom:o,left:l,x:l+u,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Lse(t,e,n,s,o,l){const{x:u,y:f}=JS(t,[e,n,s]),{x:h,y:p}=JS({x:t.x+t.width,y:t.y+t.height},[e,n,s]),g=o-h,x=l-p;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(x)}}const Yj=(t,e,n,s,o,l)=>{const u=zse(l,e,n),f=(e-u.x)/t.width,h=(n-u.y)/t.height,p=Math.min(f,h),g=cv(p,s,o),x=t.x+t.width/2,v=t.y+t.height/2,E=e/2-x*g,S=n/2-v*g,T=Lse(t,E,S,g,e,n),D={left:Math.min(T.left-u.left,0),top:Math.min(T.top-u.top,0),right:Math.min(T.right-u.right,0),bottom:Math.min(T.bottom-u.bottom,0)};return{x:E-D.left+D.right,y:S-D.top+D.bottom,zoom:g}},Z1=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function fv(t){return t!=null&&t!=="parent"}function nh(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function sz(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function iz(t,e={width:0,height:0},n,s,o){const l={...t},u=s.get(n);if(u){const f=u.origin||o;l.x+=u.internals.positionAbsolute.x-(e.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(e.height??0)*f[1]}return l}function O3(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Bse(){let t,e;return{promise:new Promise((s,o)=>{t=s,e=o}),resolve:t,reject:e}}function Ise(t){return{...K6,...t||{}}}function V1(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:l,y:u}=bc(t),f=m_({x:l-((o==null?void 0:o.left)??0),y:u-((o==null?void 0:o.top)??0)},s),{x:h,y:p}=n?h_(f,e):f;return{xSnapped:h,ySnapped:p,...f}}const $j=t=>({width:t.offsetWidth,height:t.offsetHeight}),oz=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Hse=["INPUT","SELECT","TEXTAREA"];function az(t){var s,o;const e=((o=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:o[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Hse.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const lz=t=>"clientX"in t,bc=(t,e)=>{var l,u;const n=lz(t),s=n?t.clientX:(l=t.touches)==null?void 0:l[0].clientX,o=n?t.clientY:(u=t.touches)==null?void 0:u[0].clientY;return{x:s-((e==null?void 0:e.left)??0),y:o-((e==null?void 0:e.top)??0)}},z3=(t,e,n,s,o)=>{const l=e.querySelectorAll(`.${t}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-n.left)/s,y:(f.top-n.top)/s,...$j(u)}})};function uz({sourceX:t,sourceY:e,targetX:n,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=t*.125+o*.375+u*.375+n*.125,p=e*.125+l*.375+f*.375+s*.125,g=Math.abs(h-t),x=Math.abs(p-e);return[h,p,g,x]}function mS(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function L3({pos:t,x1:e,y1:n,x2:s,y2:o,c:l}){switch(t){case Dt.Left:return[e-mS(e-s,l),n];case Dt.Right:return[e+mS(s-e,l),n];case Dt.Top:return[e,n-mS(n-o,l)];case Dt.Bottom:return[e,n+mS(o-n,l)]}}function cz({sourceX:t,sourceY:e,sourcePosition:n=Dt.Bottom,targetX:s,targetY:o,targetPosition:l=Dt.Top,curvature:u=.25}){const[f,h]=L3({pos:n,x1:t,y1:e,x2:s,y2:o,c:u}),[p,g]=L3({pos:l,x1:s,y1:o,x2:t,y2:e,c:u}),[x,v,E,S]=uz({sourceX:t,sourceY:e,targetX:s,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:g});return[`M${t},${e} C${f},${h} ${p},${g} ${s},${o}`,x,v,E,S]}function dz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const o=Math.abs(n-t)/2,l=n<t?n+o:n-o,u=Math.abs(s-e)/2,f=s<e?s+u:s-u;return[l,f,o,u]}function qse({sourceNode:t,targetNode:e,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1,zIndexMode:l="basic"}){if(l==="manual")return s;const u=o&&n?s+1e3:s,f=Math.max(t.parentId||o&&t.selected?t.internals.z:0,e.parentId||o&&e.selected?e.internals.z:0);return u+f}function Fse({sourceNode:t,targetNode:e,width:n,height:s,transform:o}){const l=_D(ZS(t),ZS(e));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return Q1(u,wD(l))>0}const Gse=({source:t,sourceHandle:e,target:n,targetHandle:s})=>`xy-edge__${t}${e||""}-${n}${s||""}`,Yse=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),$se=(t,e,n={})=>{if(!t.source||!t.target)return rz("006",fl.error006()),e;const s=n.getEdgeId||Gse;let o;return Z6(t)?o={...t}:o={...t,id:s(t)},Yse(o,e)?e:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,e.concat(o))};function fz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const[o,l,u,f]=dz({sourceX:t,sourceY:e,targetX:n,targetY:s});return[`M ${t},${e}L ${n},${s}`,o,l,u,f]}const B3={[Dt.Left]:{x:-1,y:0},[Dt.Right]:{x:1,y:0},[Dt.Top]:{x:0,y:-1},[Dt.Bottom]:{x:0,y:1}},Xse=({source:t,sourcePosition:e=Dt.Bottom,target:n})=>e===Dt.Left||e===Dt.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},I3=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Kse({source:t,sourcePosition:e=Dt.Bottom,target:n,targetPosition:s=Dt.Top,center:o,offset:l,stepPosition:u}){const f=B3[e],h=B3[s],p={x:t.x+f.x*l,y:t.y+f.y*l},g={x:n.x+h.x*l,y:n.y+h.y*l},x=Xse({source:p,sourcePosition:e,target:g}),v=x.x!==0?"x":"y",E=x[v];let S=[],T,D;const A={x:0,y:0},M={x:0,y:0},[,,j,U]=dz({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(f[v]*h[v]===-1){v==="x"?(T=o.x??p.x+(g.x-p.x)*u,D=o.y??(p.y+g.y)/2):(T=o.x??(p.x+g.x)/2,D=o.y??p.y+(g.y-p.y)*u);const z=[{x:T,y:p.y},{x:T,y:g.y}],K=[{x:p.x,y:D},{x:g.x,y:D}];f[v]===E?S=v==="x"?z:K:S=v==="x"?K:z}else{const z=[{x:p.x,y:g.y}],K=[{x:g.x,y:p.y}];if(v==="x"?S=f.x===E?K:z:S=f.y===E?z:K,e===s){const $=Math.abs(t[v]-n[v]);if($<=l){const J=Math.min(l-1,l-$);f[v]===E?A[v]=(p[v]>t[v]?-1:1)*J:M[v]=(g[v]>n[v]?-1:1)*J}}if(e!==s){const $=v==="x"?"y":"x",J=f[v]===h[$],X=p[$]>g[$],Q=p[$]<g[$];(f[v]===1&&(!J&&X||J&&Q)||f[v]!==1&&(!J&&Q||J&&X))&&(S=v==="x"?z:K)}const te={x:p.x+A.x,y:p.y+A.y},H={x:g.x+M.x,y:g.y+M.y},I=Math.max(Math.abs(te.x-S[0].x),Math.abs(H.x-S[0].x)),F=Math.max(Math.abs(te.y-S[0].y),Math.abs(H.y-S[0].y));I>=F?(T=(te.x+H.x)/2,D=S[0].y):(T=S[0].x,D=(te.y+H.y)/2)}return[[t,{x:p.x+A.x,y:p.y+A.y},...S,{x:g.x+M.x,y:g.y+M.y},n],T,D,j,U]}function Wse(t,e,n,s){const o=Math.min(I3(t,e)/2,I3(e,n)/2,s),{x:l,y:u}=e;if(t.x===l&&l===n.x||t.y===u&&u===n.y)return`L${l} ${u}`;if(t.y===u){const p=t.x<n.x?-1:1,g=t.y<n.y?1:-1;return`L ${l+o*p},${u}Q ${l},${u} ${l},${u+o*g}`}const f=t.x<n.x?1:-1,h=t.y<n.y?-1:1;return`L ${l},${u+o*h}Q ${l},${u} ${l+o*f},${u}`}function zR({sourceX:t,sourceY:e,sourcePosition:n=Dt.Bottom,targetX:s,targetY:o,targetPosition:l=Dt.Top,borderRadius:u=5,centerX:f,centerY:h,offset:p=20,stepPosition:g=.5}){const[x,v,E,S,T]=Kse({source:{x:t,y:e},sourcePosition:n,target:{x:s,y:o},targetPosition:l,center:{x:f,y:h},offset:p,stepPosition:g});return[x.reduce((A,M,j)=>{let U="";return j>0&&j<x.length-1?U=Wse(x[j-1],M,x[j+1],u):U=`${j===0?"M":"L"}${M.x} ${M.y}`,A+=U,A},""),v,E,S,T]}function H3(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Qse(t){var x;const{sourceNode:e,targetNode:n}=t;if(!H3(e)||!H3(n))return null;const s=e.internals.handleBounds||q3(e.handles),o=n.internals.handleBounds||q3(n.handles),l=F3((s==null?void 0:s.source)??[],t.sourceHandle),u=F3(t.connectionMode===uv.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),t.targetHandle);if(!l||!u)return(x=t.onError)==null||x.call(t,"008",fl.error008(l?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const f=(l==null?void 0:l.position)||Dt.Bottom,h=(u==null?void 0:u.position)||Dt.Top,p=ib(e,l,f),g=ib(n,u,h);return{sourceX:p.x,sourceY:p.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function q3(t){if(!t)return null;const e=[],n=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?e.push(s):s.type==="target"&&n.push(s);return{source:e,target:n}}function ib(t,e,n=Dt.Left,s=!1){const o=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,l=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:u,height:f}=e??nh(t);if(s)return{x:o+u/2,y:l+f/2};switch((e==null?void 0:e.position)??n){case Dt.Top:return{x:o+u/2,y:l};case Dt.Right:return{x:o+u,y:l+f/2};case Dt.Bottom:return{x:o+u/2,y:l+f};case Dt.Left:return{x:o,y:l+f/2}}}function F3(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function LR(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function Zse(t,{id:e,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const l=new Set;return t.reduce((u,f)=>([f.markerStart||s,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=LR(h,e);l.has(p)||(u.push({id:p,color:h.color||n,...h}),l.add(p))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const hz=1e3,Jse=10,Xj={nodeOrigin:[0,0],nodeExtent:X1,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},eie={...Xj,checkEquality:!0};function Kj(t,e){const n={...t};for(const s in e)e[s]!==void 0&&(n[s]=e[s]);return n}function tie(t,e,n){const s=Kj(Xj,n);for(const o of t.values())if(o.parentId)Qj(o,t,e,s);else{const l=d_(o,s.nodeOrigin),u=fv(o.extent)?o.extent:s.nodeExtent,f=sb(l,u,nh(o));o.internals.positionAbsolute=f}}function nie(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],s=[];for(const o of t.handles){const l={id:o.id,width:o.width??1,height:o.height??1,nodeId:t.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(l):o.type==="target"&&s.push(l)}return{source:n,target:s}}function Wj(t){return t==="manual"}function BR(t,e,n,s={}){var p,g;const o=Kj(eie,s),l={i:0},u=new Map(e),f=o!=null&&o.elevateNodesOnSelect&&!Wj(o.zIndexMode)?hz:0;let h=t.length>0;e.clear(),n.clear();for(const x of t){let v=u.get(x.id);if(o.checkEquality&&x===(v==null?void 0:v.internals.userNode))e.set(x.id,v);else{const E=d_(x,o.nodeOrigin),S=fv(x.extent)?x.extent:o.nodeExtent,T=sb(E,S,nh(x));v={...o.defaults,...x,measured:{width:(p=x.measured)==null?void 0:p.width,height:(g=x.measured)==null?void 0:g.height},internals:{positionAbsolute:T,handleBounds:nie(x,v),z:mz(x,f,o.zIndexMode),userNode:x}},e.set(x.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(h=!1),x.parentId&&Qj(v,e,n,s,l)}return h}function rie(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Qj(t,e,n,s,o){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Kj(Xj,s),p=t.parentId,g=e.get(p);if(!g){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}rie(t,n),o&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++o.i,g.internals.z=g.internals.z+o.i*Jse),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const x=l&&!Wj(h)?hz:0,{x:v,y:E,z:S}=sie(t,g,u,f,x,h),{positionAbsolute:T}=t.internals,D=v!==T.x||E!==T.y;(D||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:D?{x:v,y:E}:T,z:S}})}function mz(t,e,n){const s=gc(t.zIndex)?t.zIndex:0;return Wj(n)?s:s+(t.selected?e:0)}function sie(t,e,n,s,o,l){const{x:u,y:f}=e.internals.positionAbsolute,h=nh(t),p=d_(t,n),g=fv(t.extent)?sb(p,t.extent,h):p;let x=sb({x:u+g.x,y:f+g.y},s,h);t.extent==="parent"&&(x=ez(x,h,e));const v=mz(t,o,l),E=e.internals.z??0;return{x:x.x,y:x.y,z:E>=v?E+1:v}}function Zj(t,e,n,s=[0,0]){var u;const o=[],l=new Map;for(const f of t){const h=e.get(f.parentId);if(!h)continue;const p=((u=l.get(f.parentId))==null?void 0:u.expandedRect)??dv(h),g=nz(p,f.rect);l.set(f.parentId,{expandedRect:g,parent:h})}return l.size>0&&l.forEach(({expandedRect:f,parent:h},p)=>{var j;const g=h.internals.positionAbsolute,x=nh(h),v=h.origin??s,E=f.x<g.x?Math.round(Math.abs(g.x-f.x)):0,S=f.y<g.y?Math.round(Math.abs(g.y-f.y)):0,T=Math.max(x.width,Math.round(f.width)),D=Math.max(x.height,Math.round(f.height)),A=(T-x.width)*v[0],M=(D-x.height)*v[1];(E>0||S>0||A||M)&&(o.push({id:p,type:"position",position:{x:h.position.x-E+A,y:h.position.y-S+M}}),(j=n.get(p))==null||j.forEach(U=>{t.some(P=>P.id===U.id)||o.push({id:U.id,type:"position",position:{x:U.position.x+E,y:U.position.y+S}})})),(x.width<f.width||x.height<f.height||E||S)&&o.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:T+(E?v[0]*E-A:0),height:D+(S?v[1]*S-M:0)}})}),o}function iie(t,e,n,s,o,l,u){const f=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const p=[],g=window.getComputedStyle(f),{m22:x}=new window.DOMMatrixReadOnly(g.transform),v=[];for(const E of t.values()){const S=e.get(E.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const T=$j(E.nodeElement),D=S.measured.width!==T.width||S.measured.height!==T.height;if(!!(T.width&&T.height&&(D||!S.internals.handleBounds||E.force))){const M=E.nodeElement.getBoundingClientRect(),j=fv(S.extent)?S.extent:l;let{positionAbsolute:U}=S.internals;S.parentId&&S.extent==="parent"?U=ez(U,T,e.get(S.parentId)):j&&(U=sb(U,j,T));const P={...S,measured:T,internals:{...S.internals,positionAbsolute:U,handleBounds:{source:z3("source",E.nodeElement,M,x,S.id),target:z3("target",E.nodeElement,M,x,S.id)}}};e.set(S.id,P),S.parentId&&Qj(P,e,n,{nodeOrigin:o,zIndexMode:u}),h=!0,D&&(p.push({id:S.id,type:"dimensions",dimensions:T}),S.expandParent&&S.parentId&&v.push({id:S.id,parentId:S.parentId,rect:dv(P,o)}))}}if(v.length>0){const E=Zj(v,e,n,o);p.push(...E)}return{changes:p,updatedInternals:h}}async function oie({delta:t,panZoom:e,transform:n,translateExtent:s,width:o,height:l}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const u=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[o,l]],s),f=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(f)}function G3(t,e,n,s,o,l){let u=o;const f=s.get(u)||new Map;s.set(u,f.set(n,e)),u=`${o}-${t}`;const h=s.get(u)||new Map;if(s.set(u,h.set(n,e)),l){u=`${o}-${t}-${l}`;const p=s.get(u)||new Map;s.set(u,p.set(n,e))}}function pz(t,e,n){t.clear(),e.clear();for(const s of n){const{source:o,target:l,sourceHandle:u=null,targetHandle:f=null}=s,h={edgeId:s.id,source:o,target:l,sourceHandle:u,targetHandle:f},p=`${o}-${u}--${l}-${f}`,g=`${l}-${f}--${o}-${u}`;G3("source",h,g,t,o,u),G3("target",h,p,t,l,f),e.set(s.id,s)}}function gz(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:gz(n,e):!1}function Y3(t,e,n){var o;let s=t;do{if((o=s==null?void 0:s.matches)!=null&&o.call(s,e))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function aie(t,e,n,s){const o=new Map;for(const[l,u]of t)if((u.selected||u.id===s)&&(!u.parentId||!gz(u,t))&&(u.draggable||e&&typeof u.draggable>"u")){const f=t.get(l);f&&o.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return o}function wT({nodeId:t,dragItems:e,nodeLookup:n,dragging:s=!0}){var u,f,h;const o=[];for(const[p,g]of e){const x=(u=n.get(p))==null?void 0:u.internals.userNode;x&&o.push({...x,position:g.position,dragging:s})}if(!t)return[o[0],o];const l=(f=n.get(t))==null?void 0:f.internals.userNode;return[l?{...l,position:((h=e.get(t))==null?void 0:h.position)||l.position,dragging:s}:o[0],o]}function lie({dragItems:t,snapGrid:e,x:n,y:s}){const o=t.values().next().value;if(!o)return null;const l={x:n-o.distance.x,y:s-o.distance.y},u=h_(l,e);return{x:u.x-l.x,y:u.y-l.y}}function uie({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:s,onDragStop:o}){let l={x:null,y:null},u=0,f=new Map,h=!1,p={x:0,y:0},g=null,x=!1,v=null,E=!1,S=!1,T=null;function D({noDragClassName:M,handleSelector:j,domNode:U,isSelectable:P,nodeId:z,nodeClickDistance:K=0}){v=ll(U);function te({x:$,y:J}){const{nodeLookup:X,nodeExtent:Q,snapGrid:L,snapToGrid:ee,nodeOrigin:ne,onNodeDrag:oe,onSelectionDrag:G,onError:B,updateNodePositions:ae}=e();l={x:$,y:J};let Z=!1;const be=f.size>1,Ve=be&&Q?OR(f_(f)):null,he=be&&ee?lie({dragItems:f,snapGrid:L,x:$,y:J}):null;for(const[Ne,De]of f){if(!X.has(Ne))continue;let me={x:$-De.distance.x,y:J-De.distance.y};ee&&(me=he?{x:Math.round(me.x+he.x),y:Math.round(me.y+he.y)}:h_(me,L));let qe=null;if(be&&Q&&!De.extent&&Ve){const{positionAbsolute:et}=De.internals,Ct=et.x-Ve.x+Q[0][0],kt=et.x+De.measured.width-Ve.x2+Q[1][0],Fe=et.y-Ve.y+Q[0][1],Ut=et.y+De.measured.height-Ve.y2+Q[1][1];qe=[[Ct,Fe],[kt,Ut]]}const{position:Te,positionAbsolute:Ke}=J6({nodeId:Ne,nextPosition:me,nodeLookup:X,nodeExtent:qe||Q,nodeOrigin:ne,onError:B});Z=Z||De.position.x!==Te.x||De.position.y!==Te.y,De.position=Te,De.internals.positionAbsolute=Ke}if(S=S||Z,!!Z&&(ae(f,!0),T&&(s||oe||!z&&G))){const[Ne,De]=wT({nodeId:z,dragItems:f,nodeLookup:X});s==null||s(T,f,Ne,De),oe==null||oe(T,Ne,De),z||G==null||G(T,De)}}async function H(){if(!g)return;const{transform:$,panBy:J,autoPanSpeed:X,autoPanOnNodeDrag:Q}=e();if(!Q){h=!1,cancelAnimationFrame(u);return}const[L,ee]=tz(p,g,X);(L!==0||ee!==0)&&(l.x=(l.x??0)-L/$[2],l.y=(l.y??0)-ee/$[2],await J({x:L,y:ee})&&te(l)),u=requestAnimationFrame(H)}function I($){var be;const{nodeLookup:J,multiSelectionActive:X,nodesDraggable:Q,transform:L,snapGrid:ee,snapToGrid:ne,selectNodesOnDrag:oe,onNodeDragStart:G,onSelectionDragStart:B,unselectNodesAndEdges:ae}=e();x=!0,(!oe||!P)&&!X&&z&&((be=J.get(z))!=null&&be.selected||ae()),P&&oe&&z&&(t==null||t(z));const Z=V1($.sourceEvent,{transform:L,snapGrid:ee,snapToGrid:ne,containerBounds:g});if(l=Z,f=aie(J,Q,Z,z),f.size>0&&(n||G||!z&&B)){const[Ve,he]=wT({nodeId:z,dragItems:f,nodeLookup:J});n==null||n($.sourceEvent,f,Ve,he),G==null||G($.sourceEvent,Ve,he),z||B==null||B($.sourceEvent,he)}}const F=k6().clickDistance(K).on("start",$=>{const{domNode:J,nodeDragThreshold:X,transform:Q,snapGrid:L,snapToGrid:ee}=e();g=(J==null?void 0:J.getBoundingClientRect())||null,E=!1,S=!1,T=$.sourceEvent,X===0&&I($),l=V1($.sourceEvent,{transform:Q,snapGrid:L,snapToGrid:ee,containerBounds:g}),p=bc($.sourceEvent,g)}).on("drag",$=>{const{autoPanOnNodeDrag:J,transform:X,snapGrid:Q,snapToGrid:L,nodeDragThreshold:ee,nodeLookup:ne}=e(),oe=V1($.sourceEvent,{transform:X,snapGrid:Q,snapToGrid:L,containerBounds:g});if(T=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||z&&!ne.has(z))&&(E=!0),!E){if(!h&&J&&x&&(h=!0,H()),!x){const G=bc($.sourceEvent,g),B=G.x-p.x,ae=G.y-p.y;Math.sqrt(B*B+ae*ae)>ee&&I($)}(l.x!==oe.xSnapped||l.y!==oe.ySnapped)&&f&&x&&(p=bc($.sourceEvent,g),te(oe))}}).on("end",$=>{if(!(!x||E)&&(h=!1,x=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:J,updateNodePositions:X,onNodeDragStop:Q,onSelectionDragStop:L}=e();if(S&&(X(f,!1),S=!1),o||Q||!z&&L){const[ee,ne]=wT({nodeId:z,dragItems:f,nodeLookup:J,dragging:!1});o==null||o($.sourceEvent,f,ee,ne),Q==null||Q($.sourceEvent,ee,ne),z||L==null||L($.sourceEvent,ne)}}}).filter($=>{const J=$.target;return!$.button&&(!M||!Y3(J,`.${M}`,U))&&(!j||Y3(J,j,U))});v.call(F)}function A(){v==null||v.on(".drag",null)}return{update:D,destroy:A}}function cie(t,e,n){const s=[],o={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const l of e.values())Q1(o,dv(l))>0&&s.push(l);return s}const die=250;function fie(t,e,n,s){var f,h;let o=[],l=1/0;const u=cie(t,n,e+die);for(const p of u){const g=[...((f=p.internals.handleBounds)==null?void 0:f.source)??[],...((h=p.internals.handleBounds)==null?void 0:h.target)??[]];for(const x of g){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:v,y:E}=ib(p,x,x.position,!0),S=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(E-t.y,2));S>e||(S<l?(o=[{...x,x:v,y:E}],l=S):S===l&&o.push({...x,x:v,y:E}))}}if(!o.length)return null;if(o.length>1){const p=s.type==="source"?"target":"source";return o.find(g=>g.type===p)??o[0]}return o[0]}function bz(t,e,n,s,o,l=!1){var p,g,x;const u=s.get(t);if(!u)return null;const f=o==="strict"?(p=u.internals.handleBounds)==null?void 0:p[e]:[...((g=u.internals.handleBounds)==null?void 0:g.source)??[],...((x=u.internals.handleBounds)==null?void 0:x.target)??[]],h=(n?f==null?void 0:f.find(v=>v.id===n):f==null?void 0:f[0])??null;return h&&l?{...h,...ib(u,h,h.position,!0)}:h}function xz(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function hie(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const yz=()=>!0;function mie(t,{connectionMode:e,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:p,autoPanOnConnect:g,flowId:x,panBy:v,cancelConnection:E,onConnectStart:S,onConnect:T,onConnectEnd:D,isValidConnection:A=yz,onReconnectEnd:M,updateConnection:j,getTransform:U,getFromHandle:P,autoPanSpeed:z,dragThreshold:K=1,handleDomNode:te}){const H=oz(t.target);let I=0,F;const{x:$,y:J}=bc(t),X=xz(l,te),Q=f==null?void 0:f.getBoundingClientRect();let L=!1;if(!Q||!X)return;const ee=bz(o,X,s,h,e);if(!ee)return;let ne=bc(t,Q),oe=!1,G=null,B=!1,ae=null;function Z(){if(!g||!Q)return;const[Te,Ke]=tz(ne,Q,z);v({x:Te,y:Ke}),I=requestAnimationFrame(Z)}const be={...ee,nodeId:o,type:X,position:ee.position},Ve=h.get(o);let Ne={inProgress:!0,isValid:null,from:ib(Ve,be,Dt.Left,!0),fromHandle:be,fromPosition:be.position,fromNode:Ve,to:ne,toHandle:null,toPosition:V3[be.position],toNode:null,pointer:ne};function De(){L=!0,j(Ne),S==null||S(t,{nodeId:o,handleId:s,handleType:X})}K===0&&De();function me(Te){if(!L){const{x:Ut,y:Bn}=bc(Te),wr=Ut-$,rt=Bn-J;if(!(wr*wr+rt*rt>K*K))return;De()}if(!P()||!be){qe(Te);return}const Ke=U();ne=bc(Te,Q),F=fie(m_(ne,Ke,!1,[1,1]),n,h,be),oe||(Z(),oe=!0);const et=vz(Te,{handle:F,connectionMode:e,fromNodeId:o,fromHandleId:s,fromType:u?"target":"source",isValidConnection:A,doc:H,lib:p,flowId:x,nodeLookup:h});ae=et.handleDomNode,G=et.connection,B=hie(!!F,et.isValid);const Ct=h.get(o),kt=Ct?ib(Ct,be,Dt.Left,!0):Ne.from,Fe={...Ne,from:kt,isValid:B,to:et.toHandle&&B?JS({x:et.toHandle.x,y:et.toHandle.y},Ke):ne,toHandle:et.toHandle,toPosition:B&&et.toHandle?et.toHandle.position:V3[be.position],toNode:et.toHandle?h.get(et.toHandle.nodeId):null,pointer:ne};j(Fe),Ne=Fe}function qe(Te){if(!("touches"in Te&&Te.touches.length>0)){if(L){(F||ae)&&G&&B&&(T==null||T(G));const{inProgress:Ke,...et}=Ne,Ct={...et,toPosition:Ne.toHandle?Ne.toPosition:null};D==null||D(Te,Ct),l&&(M==null||M(Te,Ct))}E(),cancelAnimationFrame(I),oe=!1,B=!1,G=null,ae=null,H.removeEventListener("mousemove",me),H.removeEventListener("mouseup",qe),H.removeEventListener("touchmove",me),H.removeEventListener("touchend",qe)}}H.addEventListener("mousemove",me),H.addEventListener("mouseup",qe),H.addEventListener("touchmove",me),H.addEventListener("touchend",qe)}function vz(t,{handle:e,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:p=yz,nodeLookup:g}){const x=l==="target",v=e?u.querySelector(`.${f}-flow__handle[data-id="${h}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:E,y:S}=bc(t),T=u.elementFromPoint(E,S),D=T!=null&&T.classList.contains(`${f}-flow__handle`)?T:v,A={handleDomNode:D,isValid:!1,connection:null,toHandle:null};if(D){const M=xz(void 0,D),j=D.getAttribute("data-nodeid"),U=D.getAttribute("data-handleid"),P=D.classList.contains("connectable"),z=D.classList.contains("connectableend");if(!j||!M)return A;const K={source:x?j:s,sourceHandle:x?U:o,target:x?s:j,targetHandle:x?o:U};A.connection=K;const H=P&&z&&(n===uv.Strict?x&&M==="source"||!x&&M==="target":j!==s||U!==o);A.isValid=H&&p(K),A.toHandle=bz(j,M,U,g,n,!0)}return A}const IR={onPointerDown:mie,isValid:vz};function pie({domNode:t,panZoom:e,getTransform:n,getViewScale:s}){const o=ll(t);function l({translateExtent:f,width:h,height:p,zoomStep:g=1,pannable:x=!0,zoomable:v=!0,inversePan:E=!1}){const S=j=>{if(j.sourceEvent.type!=="wheel"||!e)return;const U=n(),P=j.sourceEvent.ctrlKey&&Z1()?10:1,z=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*g,K=U[2]*Math.pow(2,z*P);e.scaleTo(K)};let T=[0,0];const D=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(T=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},A=j=>{const U=n();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!e)return;const P=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],z=[P[0]-T[0],P[1]-T[1]];T=P;const K=s()*Math.max(U[2],Math.log(U[2]))*(E?-1:1),te={x:U[0]-z[0]*K,y:U[1]-z[1]*K},H=[[0,0],[h,p]];e.setViewportConstrained({x:te.x,y:te.y,zoom:U[2]},H,f)},M=$6().on("start",D).on("zoom",x?A:null).on("zoom.wheel",v?S:null);o.call(M,{})}function u(){o.on("zoom",null)}return{update:l,destroy:u,pointer:hc}}const ND=t=>({x:t.x,y:t.y,zoom:t.k}),NT=({x:t,y:e,zoom:n})=>ED.translate(t,e).scale(n),$y=(t,e)=>t.target.closest(`.${e}`),Ez=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),gie=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,ST=(t,e=0,n=gie,s=()=>{})=>{const o=typeof e=="number"&&e>0;return o||s(),o?t.transition().duration(e).ease(n).on("end",s):t},_z=t=>{const e=t.ctrlKey&&Z1()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function bie({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:p}){return g=>{if($y(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(g.ctrlKey&&u){const D=hc(g),A=_z(g),M=x*Math.pow(2,A);s.scaleTo(n,M,D,g);return}const v=g.deltaMode===1?20:1;let E=o===Qg.Vertical?0:g.deltaX*v,S=o===Qg.Horizontal?0:g.deltaY*v;!Z1()&&g.shiftKey&&o!==Qg.Vertical&&(E=g.deltaY*v,S=0),s.translateBy(n,-(E/x)*l,-(S/x)*l,{internal:!0});const T=ND(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h==null||h(g,T),t.panScrollTimeout=setTimeout(()=>{p==null||p(g,T),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,f==null||f(g,T))}}function xie({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(s,o){const l=s.type==="wheel",u=!e&&l&&!s.ctrlKey,f=$y(s,t);if(s.ctrlKey&&l&&f&&s.preventDefault(),u||f)return null;s.preventDefault(),n.call(this,s,o)}}function yie({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return s=>{var l,u,f;if((l=s.sourceEvent)!=null&&l.internal)return;const o=ND(s.transform);t.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=o,((f=s.sourceEvent)==null?void 0:f.type)==="mousedown"&&e(!0),n&&(n==null||n(s.sourceEvent,o))}}function vie({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return l=>{var u,f;t.usedRightMouseButton=!!(n&&Ez(e,t.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||s([l.transform.x,l.transform.y,l.transform.k]),o&&!((f=l.sourceEvent)!=null&&f.internal)&&(o==null||o(l.sourceEvent,ND(l.transform)))}}function Eie({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:l}){return u=>{var f;if(!((f=u.sourceEvent)!=null&&f.internal)&&(t.isZoomingOrPanning=!1,l&&Ez(e,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),o)){const h=ND(u.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{o==null||o(u.sourceEvent,h)},n?150:0)}}}function _ie({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:p,connectionInProgress:g}){return x=>{var D;const v=t||e,E=n&&x.ctrlKey,S=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&($y(x,`${p}-flow__node`)||$y(x,`${p}-flow__edge`)))return!0;if(!s&&!v&&!o&&!l&&!n||u||g&&!S||$y(x,f)&&S||$y(x,h)&&(!S||o&&S&&!t)||!n&&x.ctrlKey&&S)return!1;if(!n&&x.type==="touchstart"&&((D=x.touches)==null?void 0:D.length)>1)return x.preventDefault(),!1;if(!v&&!o&&!E&&S||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const T=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||S)&&T}}function wie({domNode:t,minZoom:e,maxZoom:n,translateExtent:s,viewport:o,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),x=$6().scaleExtent([e,n]).translateExtent(s),v=ll(t).call(x);M({x:o.x,y:o.y,zoom:cv(o.zoom,e,n)},[[0,0],[g.width,g.height]],s);const E=v.on("wheel.zoom"),S=v.on("dblclick.zoom");x.wheelDelta(_z);function T(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).transform(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function D({noWheelClassName:F,noPanClassName:$,onPaneContextMenu:J,userSelectionActive:X,panOnScroll:Q,panOnDrag:L,panOnScrollMode:ee,panOnScrollSpeed:ne,preventScrolling:oe,zoomOnPinch:G,zoomOnScroll:B,zoomOnDoubleClick:ae,zoomActivationKeyPressed:Z,lib:be,onTransformChange:Ve,connectionInProgress:he,paneClickDistance:Ne,selectionOnDrag:De}){X&&!p.isZoomingOrPanning&&A();const me=Q&&!Z&&!X;x.clickDistance(De?1/0:!gc(Ne)||Ne<0?0:Ne);const qe=me?bie({zoomPanValues:p,noWheelClassName:F,d3Selection:v,d3Zoom:x,panOnScrollMode:ee,panOnScrollSpeed:ne,zoomOnPinch:G,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):xie({noWheelClassName:F,preventScrolling:oe,d3ZoomHandler:E});if(v.on("wheel.zoom",qe,{passive:!1}),!X){const Ke=yie({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});x.on("start",Ke);const et=vie({zoomPanValues:p,panOnDrag:L,onPaneContextMenu:!!J,onPanZoom:l,onTransformChange:Ve});x.on("zoom",et);const Ct=Eie({zoomPanValues:p,panOnDrag:L,panOnScroll:Q,onPaneContextMenu:J,onPanZoomEnd:f,onDraggingChange:h});x.on("end",Ct)}const Te=_ie({zoomActivationKeyPressed:Z,panOnDrag:L,zoomOnScroll:B,panOnScroll:Q,zoomOnDoubleClick:ae,zoomOnPinch:G,userSelectionActive:X,noPanClassName:$,noWheelClassName:F,lib:be,connectionInProgress:he});x.filter(Te),ae?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function A(){x.on("zoom",null)}async function M(F,$,J){const X=NT(F),Q=x==null?void 0:x.constrain()(X,$,J);return Q&&await T(Q),new Promise(L=>L(Q))}async function j(F,$){const J=NT(F);return await T(J,$),new Promise(X=>X(J))}function U(F){if(v){const $=NT(F),J=v.property("__zoom");(J.k!==F.zoom||J.x!==F.x||J.y!==F.y)&&(x==null||x.transform(v,$,null,{sync:!0}))}}function P(){const F=v?Y6(v.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function z(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).scaleTo(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function K(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).scaleBy(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function te(F){x==null||x.scaleExtent(F)}function H(F){x==null||x.translateExtent(F)}function I(F){const $=!gc(F)||F<0?0:F;x==null||x.clickDistance($)}return{update:D,destroy:A,setViewport:j,setViewportConstrained:M,getViewport:P,scaleTo:z,scaleBy:K,setScaleExtent:te,setTranslateExtent:H,syncViewport:U,setClickDistance:I}}var hv;(function(t){t.Line="line",t.Handle="handle"})(hv||(hv={}));function Nie({width:t,prevWidth:e,height:n,prevHeight:s,affectsX:o,affectsY:l}){const u=t-e,f=n-s,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&o&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function $3(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),s=t.includes("left"),o=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:s,affectsY:o}}function Dm(t,e){return Math.max(0,e-t)}function Am(t,e){return Math.max(0,t-e)}function pS(t,e,n){return Math.max(0,e-t,t-n)}function X3(t,e){return t?!e:e}function Sie(t,e,n,s,o,l,u,f){let{affectsX:h,affectsY:p}=e;const{isHorizontal:g,isVertical:x}=e,v=g&&x,{xSnapped:E,ySnapped:S}=n,{minWidth:T,maxWidth:D,minHeight:A,maxHeight:M}=s,{x:j,y:U,width:P,height:z,aspectRatio:K}=t;let te=Math.floor(g?E-t.pointerX:0),H=Math.floor(x?S-t.pointerY:0);const I=P+(h?-te:te),F=z+(p?-H:H),$=-l[0]*P,J=-l[1]*z;let X=pS(I,T,D),Q=pS(F,A,M);if(u){let ne=0,oe=0;h&&te<0?ne=Dm(j+te+$,u[0][0]):!h&&te>0&&(ne=Am(j+I+$,u[1][0])),p&&H<0?oe=Dm(U+H+J,u[0][1]):!p&&H>0&&(oe=Am(U+F+J,u[1][1])),X=Math.max(X,ne),Q=Math.max(Q,oe)}if(f){let ne=0,oe=0;h&&te>0?ne=Am(j+te,f[0][0]):!h&&te<0&&(ne=Dm(j+I,f[1][0])),p&&H>0?oe=Am(U+H,f[0][1]):!p&&H<0&&(oe=Dm(U+F,f[1][1])),X=Math.max(X,ne),Q=Math.max(Q,oe)}if(o){if(g){const ne=pS(I/K,A,M)*K;if(X=Math.max(X,ne),u){let oe=0;!h&&!p||h&&!p&&v?oe=Am(U+J+I/K,u[1][1])*K:oe=Dm(U+J+(h?te:-te)/K,u[0][1])*K,X=Math.max(X,oe)}if(f){let oe=0;!h&&!p||h&&!p&&v?oe=Dm(U+I/K,f[1][1])*K:oe=Am(U+(h?te:-te)/K,f[0][1])*K,X=Math.max(X,oe)}}if(x){const ne=pS(F*K,T,D)/K;if(Q=Math.max(Q,ne),u){let oe=0;!h&&!p||p&&!h&&v?oe=Am(j+F*K+$,u[1][0])/K:oe=Dm(j+(p?H:-H)*K+$,u[0][0])/K,Q=Math.max(Q,oe)}if(f){let oe=0;!h&&!p||p&&!h&&v?oe=Dm(j+F*K,f[1][0])/K:oe=Am(j+(p?H:-H)*K,f[0][0])/K,Q=Math.max(Q,oe)}}}H=H+(H<0?Q:-Q),te=te+(te<0?X:-X),o&&(v?I>F*K?H=(X3(h,p)?-te:te)/K:te=(X3(h,p)?-H:H)*K:g?(H=te/K,p=h):(te=H*K,h=p));const L=h?j+te:j,ee=p?U+H:U;return{width:P+(h?-te:te),height:z+(p?-H:H),x:l[0]*te*(h?-1:1)+L,y:l[1]*H*(p?-1:1)+ee}}const wz={width:0,height:0,x:0,y:0},Die={...wz,pointerX:0,pointerY:0,aspectRatio:1};function Aie(t){return[[0,0],[t.measured.width,t.measured.height]]}function Cie(t,e,n){const s=e.position.x+t.position.x,o=e.position.y+t.position.y,l=t.measured.width??0,u=t.measured.height??0,f=n[0]*l,h=n[1]*u;return[[s-f,o-h],[s+l-f,o+u-h]]}function Tie({domNode:t,nodeId:e,getStoreItems:n,onChange:s,onEnd:o}){const l=ll(t);let u={controlDirection:$3("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:p,boundaries:g,keepAspectRatio:x,resizeDirection:v,onResizeStart:E,onResize:S,onResizeEnd:T,shouldResize:D}){let A={...wz},M={...Die};u={boundaries:g,resizeDirection:v,keepAspectRatio:x,controlDirection:$3(p)};let j,U=null,P=[],z,K,te,H=!1;const I=k6().on("start",F=>{const{nodeLookup:$,transform:J,snapGrid:X,snapToGrid:Q,nodeOrigin:L,paneDomNode:ee}=n();if(j=$.get(e),!j)return;U=(ee==null?void 0:ee.getBoundingClientRect())??null;const{xSnapped:ne,ySnapped:oe}=V1(F.sourceEvent,{transform:J,snapGrid:X,snapToGrid:Q,containerBounds:U});A={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},M={...A,pointerX:ne,pointerY:oe,aspectRatio:A.width/A.height},z=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(z=$.get(j.parentId),K=z&&j.extent==="parent"?Aie(z):void 0),P=[],te=void 0;for(const[G,B]of $)if(B.parentId===e&&(P.push({id:G,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const ae=Cie(B,j,B.origin??L);te?te=[[Math.min(ae[0][0],te[0][0]),Math.min(ae[0][1],te[0][1])],[Math.max(ae[1][0],te[1][0]),Math.max(ae[1][1],te[1][1])]]:te=ae}E==null||E(F,{...A})}).on("drag",F=>{const{transform:$,snapGrid:J,snapToGrid:X,nodeOrigin:Q}=n(),L=V1(F.sourceEvent,{transform:$,snapGrid:J,snapToGrid:X,containerBounds:U}),ee=[];if(!j)return;const{x:ne,y:oe,width:G,height:B}=A,ae={},Z=j.origin??Q,{width:be,height:Ve,x:he,y:Ne}=Sie(M,u.controlDirection,L,u.boundaries,u.keepAspectRatio,Z,K,te),De=be!==G,me=Ve!==B,qe=he!==ne&&De,Te=Ne!==oe&&me;if(!qe&&!Te&&!De&&!me)return;if((qe||Te||Z[0]===1||Z[1]===1)&&(ae.x=qe?he:A.x,ae.y=Te?Ne:A.y,A.x=ae.x,A.y=ae.y,P.length>0)){const kt=he-ne,Fe=Ne-oe;for(const Ut of P)Ut.position={x:Ut.position.x-kt+Z[0]*(be-G),y:Ut.position.y-Fe+Z[1]*(Ve-B)},ee.push(Ut)}if((De||me)&&(ae.width=De&&(!u.resizeDirection||u.resizeDirection==="horizontal")?be:A.width,ae.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?Ve:A.height,A.width=ae.width,A.height=ae.height),z&&j.expandParent){const kt=Z[0]*(ae.width??0);ae.x&&ae.x<kt&&(A.x=kt,M.x=M.x-(ae.x-kt));const Fe=Z[1]*(ae.height??0);ae.y&&ae.y<Fe&&(A.y=Fe,M.y=M.y-(ae.y-Fe))}const Ke=Nie({width:A.width,prevWidth:G,height:A.height,prevHeight:B,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),et={...A,direction:Ke};(D==null?void 0:D(F,et))!==!1&&(H=!0,S==null||S(F,et),s(ae,ee))}).on("end",F=>{H&&(T==null||T(F,{...A}),o==null||o({...A}),H=!1)});l.call(I)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}var DT={exports:{}},AT={},CT={exports:{}},TT={},K3;function Rie(){if(K3)return TT;K3=1;/**
794
+ `))};return window.addEventListener("execution:chunk",E),()=>window.removeEventListener("execution:chunk",E)},[g,e]),O.useEffect(()=>{g&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[s,g]);const x=O.useCallback(()=>{navigator.clipboard.writeText(s).catch(()=>{})},[s]);if(!t)return y.jsxDEV("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No execution linked to this task"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:72,columnNumber:7},this);if(l)return y.jsxDEV("div",{style:{padding:"20px",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"Loading logs..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:84,columnNumber:7},this);const v=f?"none":300;return y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:6},children:[g&&y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"#f59e0b",animation:"pulse 1.5s infinite",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:100,columnNumber:13},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:g?"Live Output":"Execution Log"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:105,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:98,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[s&&y.jsxDEV("button",{onClick:x,style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--accent-dim)",cursor:"pointer"},children:"copy"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:114,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>h(E=>!E),style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--accent-dim)",cursor:"pointer"},children:f?"collapse":"expand"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:119,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:112,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:95,columnNumber:7},this),y.jsxDEV("div",{ref:p,style:{padding:"10px 12px",background:"#0d1117",borderRadius:"var(--radius-sm)",border:g?"1px solid #f59e0b44":"1px solid var(--border-subtle)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.7rem",color:"#c9d1d9",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:v,overflowY:"auto",minHeight:60},children:s||(g?"Waiting for output...":"No output recorded")},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:126,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/ExecutionLogPanel.tsx",lineNumber:94,columnNumber:5},this)}let mT=0;const p6=[{key:"planned",label:"Planejado",color:"var(--status-idle)",glow:"none"},{key:"executing",label:"Executando",color:"var(--accent)",glow:"var(--accent-glow)"},{key:"done",label:"Finalizado",color:"var(--status-active)",glow:"var(--status-active-glow)"},{key:"failed",label:"Falhou",color:"var(--status-error)",glow:"none"}];function pT(t){if(!t)return"—";const e=new Date(t);return e.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit"})+" "+e.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function gT(t,e){if(!t||!e)return null;const n=new Date(e).getTime()-new Date(t).getTime();if(n<0)return null;if(n<1e3)return`${n}ms`;const s=Math.floor(n/1e3);if(s<60)return`${s}s`;const o=Math.floor(s/60),l=s%60;if(o<60)return`${o}m ${l}s`;const u=Math.floor(o/60),f=o%60;return`${u}h ${f}m`}function Vee(){const t=Ps(Q=>Q.squads),e=Ps(Q=>Q.activeStates),[n,s]=O.useState(null),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(null),[g,x]=O.useState(""),[v,E]=O.useState(""),[S,T]=O.useState(null),[D,A]=O.useState(null),[M,j]=O.useState(!1),U=O.useRef(null);O.useEffect(()=>{var Q;if(M){const L=document.createElement("style");L.textContent='[data-layout="header"],[data-layout="sidebar"],[data-layout="statusbar"]{display:none!important}',document.head.appendChild(L),U.current=L}else(Q=U.current)==null||Q.remove(),U.current=null;return()=>{var L;(L=U.current)==null||L.remove(),U.current=null}},[M]);const P=n;O.useEffect(()=>{if(!P){f([]),A(null);return}const Q=P==="__all__"?"/api/kanban/tasks":`/api/kanban/${P}/tasks`;fetch(Q,{credentials:"include"}).then(L=>L.json()).then(L=>f(Array.isArray(L)?L:[])).catch(()=>f([]))},[P]),O.useEffect(()=>{const Q=L=>{const ee=L.detail;if(!(ee!=null&&ee.activityId)&&!(ee!=null&&ee.squadName)||!P||mT>0)return;const ne=P==="__all__"?"/api/kanban/tasks":`/api/kanban/${P}/tasks`;fetch(ne,{credentials:"include"}).then(oe=>oe.json()).then(oe=>{const G=Array.isArray(oe)?oe:[];f(G),A(B=>B?G.find(Z=>Z.id===B.id)??null:null)}).catch(()=>{})};return window.addEventListener("kanban:task_updated",Q),()=>window.removeEventListener("kanban:task_updated",Q)},[P]);const z=O.useMemo(()=>p6.map(Q=>({...Q,tasks:u.filter(L=>L.status===Q.key).sort((L,ee)=>L.position-ee.position)})),[u]),K=t.filter(Q=>{if(!o)return!0;const L=o.toLowerCase();return Q.name.toLowerCase().includes(L)||Q.code.toLowerCase().includes(L)}),te=O.useCallback(async Q=>{if(!P||!g.trim())return;const L=await fetch(`/api/kanban/${P}/tasks`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:g.trim(),description:v.trim()||void 0,status:Q})});if(L.ok){const ee=await L.json();f(ne=>[...ne,ee]),x(""),E(""),p(null)}},[P,g,v]),H=O.useCallback(async Q=>{if(!P)return;(await fetch(`/api/kanban/${P}/tasks/${Q}`,{method:"DELETE",credentials:"include"})).ok&&(f(ee=>ee.filter(ne=>ne.id!==Q)),(D==null?void 0:D.id)===Q&&A(null))},[P,D]),I=O.useCallback(async(Q,L)=>{if(!P)return;const ee=u.find(oe=>oe.id===Q);if(!ee||ee.status===L)return;const ne=ee.squad_code||P;f(oe=>oe.map(G=>G.id===Q?{...G,status:L}:G)),mT++;try{const oe=await fetch(`/api/kanban/${ne}/tasks/${Q}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:L})});if(oe.ok){const G=await oe.json();f(B=>B.map(ae=>ae.id===Q?G:ae)),(D==null?void 0:D.id)===Q&&A(G),L==="executing"&&QO(ne,`Execute a seguinte tarefa do kanban: ${ee.title}${ee.description?" — "+ee.description:""}`)}else f(G=>G.map(B=>B.id===Q?ee:B))}finally{setTimeout(()=>{mT--},500)}},[P,u,D]),F=O.useCallback(async(Q,L)=>{if(!P)return;const ee=await fetch(`/api/kanban/${P}/tasks/${Q}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({result:L})});if(ee.ok){const ne=await ee.json();f(oe=>oe.map(G=>G.id===Q?ne:G)),A(ne)}},[P]),$=O.useCallback((Q,L)=>{Q.preventDefault(),Q.dataTransfer.dropEffect="move",T(L)},[]),J=O.useCallback(()=>{T(null)},[]),X=O.useCallback((Q,L)=>{Q.preventDefault(),T(null);const ee=Q.dataTransfer.getData("text/plain");if(!ee.startsWith("task:"))return;const ne=ee.replace("task:","");I(ne,L)},[I]);return y.jsxDEV("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[y.jsxDEV("div",{style:{width:240,minWidth:240,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[y.jsxDEV("div",{style:{padding:"8px 14px",borderBottom:"1px solid var(--border-subtle)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:"Squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:253,columnNumber:11},this),y.jsxDEV("button",{onClick:()=>j(Q=>!Q),title:M?"Voltar ao modo normal":"Modo foco — tela cheia",style:{background:M?"rgba(0,200,255,0.1)":"transparent",border:`1px solid ${M?"var(--accent)":"var(--border-subtle)"}`,color:M?"var(--accent)":"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.58rem",padding:"2px 7px",borderRadius:3},children:M?"← Normal":"⛶ Foco"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:257,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:248,columnNumber:9},this),y.jsxDEV("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("input",{type:"text",placeholder:"Search squads...",value:o,onChange:Q=>l(Q.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",outline:"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:273,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:272,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"6px 8px"},children:[y.jsxDEV("button",{onClick:()=>{s("__all__"),A(null)},style:{width:"100%",background:P==="__all__"?"var(--accent-glow)":"none",border:P==="__all__"?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:6},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",flexShrink:0}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:298,columnNumber:13},this),y.jsxDEV("div",{style:{overflow:"hidden"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:P==="__all__"?600:400,color:P==="__all__"?"var(--accent)":"var(--text-primary)"},children:"Todos"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:304,columnNumber:15},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"all squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:311,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:303,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:287,columnNumber:11},this),y.jsxDEV("div",{style:{borderBottom:"1px solid var(--border-subtle)",margin:"4px 0 6px"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:317,columnNumber:11},this),K.map(Q=>{var ne;const L=Q.code===P,ee=!!e[Q.code];return y.jsxDEV("button",{onClick:()=>{s(Q.code),A(null)},style:{width:"100%",background:L?"var(--accent-glow)":"none",border:L?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-sm)",padding:"8px 10px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",textAlign:"left",marginBottom:2},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:ee?"var(--status-active)":"var(--status-idle)",flexShrink:0}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:335,columnNumber:17},this),y.jsxDEV("div",{style:{overflow:"hidden"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:L?600:400,color:L?"var(--accent)":"var(--text-primary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Q.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:341,columnNumber:19},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:[((ne=Q.agents)==null?void 0:ne.length)||0," agents"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:349,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:340,columnNumber:17},this)]},Q.code,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:323,columnNumber:15},this)}),K.length===0&&y.jsxDEV("div",{style:{padding:"16px 10px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:357,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:285,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:242,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:P?y.jsxDEV("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",flex:1,overflow:"auto"},children:z.map((Q,L)=>{const ee=S===Q.key;return y.jsxDEV("div",{"data-testid":`column-${Q.key}`,onDragOver:ne=>$(ne,Q.key),onDragLeave:J,onDrop:ne=>X(ne,Q.key),style:{flex:1,background:ee?"rgba(0, 200, 255, 0.04)":"var(--surface-2)",border:ee?"1px dashed var(--accent)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${L*80}ms both`,transition:"background 0.15s ease, border-color 0.15s ease"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${Q.color}`},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:Q.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:408,columnNumber:23},this),y.jsxDEV("span",{"data-testid":`count-${Q.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:Q.color,background:Q.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${Q.color}`},children:Q.tasks.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:411,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:403,columnNumber:21},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto"},children:Q.tasks.map(ne=>y.jsxDEV(kee,{task:ne,selected:(D==null?void 0:D.id)===ne.id,onClick:A,onDelete:ne.activity_id?void 0:H},ne.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:424,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:422,columnNumber:21},this),h===Q.key?y.jsxDEV("div",{style:{marginTop:"var(--sp-3)",background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"10px 12px",border:"1px solid var(--border-default)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Title",value:g,onChange:ne=>x(ne.target.value),autoFocus:!0,onKeyDown:ne=>{ne.key==="Enter"&&g.trim()&&te(Q.key),ne.key==="Escape"&&(p(null),x(""),E(""))},style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,outline:"none",marginBottom:6}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:441,columnNumber:25},this),y.jsxDEV("textarea",{placeholder:"Description (optional)",value:v,onChange:ne=>E(ne.target.value),onKeyDown:ne=>{ne.key==="Escape"&&(p(null),x(""),E(""))},rows:2,style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none",resize:"none",marginBottom:8}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:455,columnNumber:25},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[y.jsxDEV("button",{onClick:()=>te(Q.key),disabled:!g.trim(),style:{background:g.trim()?"var(--accent)":"var(--surface-4)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:g.trim()?"var(--text-inverse)":"var(--text-muted)",cursor:g.trim()?"pointer":"default"},children:"Add"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:468,columnNumber:27},this),y.jsxDEV("button",{onClick:()=>{p(null),x(""),E("")},style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:477,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:467,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:436,columnNumber:23},this):y.jsxDEV("button",{"data-testid":`add-task-${Q.key}`,onClick:()=>{p(Q.key),x(""),E("")},style:{marginTop:"var(--sp-3)",width:"100%",background:"none",border:"1px dashed var(--border-default)",borderRadius:"var(--radius-sm)",padding:"8px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:ne=>{ne.currentTarget.style.borderColor="var(--accent-dim)",ne.currentTarget.style.color="var(--accent)"},onMouseLeave:ne=>{ne.currentTarget.style.borderColor="var(--border-default)",ne.currentTarget.style.color="var(--text-muted)"},children:"+ New Task"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:488,columnNumber:23},this)]},Q.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:386,columnNumber:19},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:379,columnNumber:13},this),D&&y.jsxDEV(Uee,{task:D,onClose:()=>A(null),onMove:I,onUpdateResult:F},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:510,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:377,columnNumber:11},this):y.jsxDEV("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[y.jsxDEV("span",{style:{fontSize:"1.5rem",color:"var(--text-muted)",opacity:.4},children:"▦"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:371,columnNumber:13},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:372,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:367,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:365,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:240,columnNumber:5},this)}function Uee({task:t,onClose:e,onMove:n,onUpdateResult:s}){const[o,l]=O.useState(!1),[u,f]=O.useState(t.result||"");O.useEffect(()=>{f(t.result||""),l(!1)},[t.id,t.result]);const h=()=>{s(t.id,u),l(!1)},p=t.status==="planned"?"var(--status-idle)":t.status==="executing"?"var(--accent)":t.status==="failed"?"var(--status-error)":"var(--status-active)";return y.jsxDEV("div",{"data-testid":"task-detail-panel",style:{width:360,minWidth:360,borderLeft:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden",animation:"slideInRight 0.2s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,color:p,padding:"2px 10px",borderRadius:"var(--radius-full)",border:`1px solid ${p}`,textTransform:"uppercase"},children:t.status==="planned"?"planejado":t.status==="executing"?"executando":t.status==="failed"?"falhou":"finalizado"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:572,columnNumber:9},this),y.jsxDEV("button",{onClick:e,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"0 4px"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:579,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:568,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflowY:"auto",padding:"16px"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontSize:"1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:8,lineHeight:1.3},children:t.title},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:589,columnNumber:9},this),t.description&&y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",color:"var(--text-secondary)",lineHeight:1.5,marginBottom:16},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:598,columnNumber:11},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:20,padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)"},children:[y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Created"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:612,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.created_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:615,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:611,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Started"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:620,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.started_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:623,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:619,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Finished"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:628,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:pT(t.finished_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:631,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:627,columnNumber:11},this),y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.58rem",color:"var(--text-muted)",textTransform:"uppercase",marginBottom:2},children:"Duration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:636,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:gT(t.started_at,t.finished_at)?"var(--accent)":"var(--text-secondary)",fontWeight:gT(t.started_at,t.finished_at)?600:400},children:gT(t.started_at,t.finished_at)??"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:639,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:635,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:607,columnNumber:9},this),y.jsxDEV("div",{style:{marginBottom:20},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:8},children:"Move to"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:647,columnNumber:11},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:p6.filter(g=>g.key!==t.status).map(g=>y.jsxDEV("button",{"data-testid":`move-to-${g.key}`,onClick:()=>n(t.id,g.key),style:{flex:1,background:"var(--surface-3)",border:`1px solid ${g.color}`,borderRadius:"var(--radius-xs)",padding:"6px 10px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:g.color,cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:x=>{x.currentTarget.style.background=g.glow!=="none"?g.glow:"var(--surface-4)"},onMouseLeave:x=>{x.currentTarget.style.background="var(--surface-3)"},children:g.label},g.key,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:652,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:650,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:646,columnNumber:9},this),t.activity_id?y.jsxDEV(Mee,{activityId:t.activity_id,squadCode:t.squad_code,taskStatus:t.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:673,columnNumber:11},this):y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Output / Result"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:683,columnNumber:15},this),!o&&y.jsxDEV("button",{onClick:()=>{l(!0),f(t.result||"")},style:{background:"none",border:"none",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent-dim)",cursor:"pointer"},children:t.result?"edit":"+ add"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:687,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:680,columnNumber:13},this),o?y.jsxDEV("div",{children:[y.jsxDEV("textarea",{value:u,onChange:g=>f(g.target.value),autoFocus:!0,rows:8,style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",lineHeight:1.6,outline:"none",resize:"vertical",marginBottom:8}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:701,columnNumber:17},this),y.jsxDEV("div",{style:{display:"flex",gap:6},children:[y.jsxDEV("button",{onClick:h,style:{background:"var(--accent)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:"var(--text-inverse)",cursor:"pointer"},children:"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:715,columnNumber:19},this),y.jsxDEV("button",{onClick:()=>l(!1),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",padding:"4px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",cursor:"pointer"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:722,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:714,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:700,columnNumber:15},this):t.result?y.jsxDEV("div",{style:{padding:"12px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-primary)",lineHeight:1.6,whiteSpace:"pre-wrap",maxHeight:300,overflowY:"auto"},children:t.result},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:733,columnNumber:15},this):y.jsxDEV("div",{style:{padding:"20px",background:"var(--surface-2)",borderRadius:"var(--radius-sm)",border:"1px dashed var(--border-default)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)"},children:"No output yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:742,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:679,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:587,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KanbanView.tsx",lineNumber:557,columnNumber:5},this)}function Pee(){const t=au(te=>te.user),[e,n]=O.useState([]),[s,o]=O.useState(!0),[l,u]=O.useState(""),[f,h]=O.useState(""),[p,g]=O.useState("viewer"),[x,v]=O.useState(null),[E,S]=O.useState(null),[T,D]=O.useState(null),[A,M]=O.useState(""),j=O.useCallback(async()=>{try{const te=await fetch("/api/users",{credentials:"include"});if(te.ok){const H=await te.json();n(H.users)}}catch{v("Failed to load users")}finally{o(!1)}},[]);O.useEffect(()=>{j()},[j]);const U=async()=>{if(!(!l.trim()||!f.trim())){v(null);try{const te=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:l,password:f,role:p}),credentials:"include"});if(!te.ok){const H=await te.json();v(H.error||"Failed to create user");return}u(""),h(""),g("viewer"),await j()}catch{v("Network error")}}},P=async(te,H)=>{try{(await fetch(`/api/users/${te}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:H}),credentials:"include"})).ok&&await j()}catch{v("Failed to update role")}},z=async te=>{if(!A||A.length<6){v("Password must be at least 6 characters");return}try{const H=await fetch(`/api/users/${te}/password`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:A}),credentials:"include"});if(H.ok)D(null),M(""),v(null);else{const I=await H.json();v(I.error||"Failed to change password")}}catch{v("Network error")}},K=async te=>{try{(await fetch(`/api/users/${te}`,{method:"DELETE",credentials:"include"})).ok&&(S(null),await j())}catch{v("Failed to delete user")}};return s?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:125,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:139,columnNumber:7},this),x&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:x},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:150,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[y.jsxDEV("input",{className:"input",placeholder:"Username",value:l,onChange:te=>u(te.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:172,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Password",type:"password",value:f,onChange:te=>h(te.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:179,columnNumber:9},this),y.jsxDEV("select",{className:"input",value:p,onChange:te=>g(te.target.value),style:{minWidth:100},children:[y.jsxDEV("option",{value:"viewer",children:"viewer"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:193,columnNumber:11},this),y.jsxDEV("option",{value:"operator",children:"operator"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:194,columnNumber:11},this),y.jsxDEV("option",{value:"admin",children:"admin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:195,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:187,columnNumber:9},this),y.jsxDEV("button",{onClick:U,className:"btn btn-accent",children:"Create User"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:197,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:165,columnNumber:7},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((te,H)=>y.jsxDEV("th",{style:{textAlign:H===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:te},te,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:207,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:205,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:204,columnNumber:9},this),y.jsxDEV("tbody",{children:e.map(te=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:te.username},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:228,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:te.email||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:231,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px"},children:te.id===(t==null?void 0:t.id)?y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:te.role},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:236,columnNumber:19},this):y.jsxDEV("select",{className:"input",value:te.role,onChange:H=>P(te.id,H.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"viewer",children:"viewer"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:250,columnNumber:21},this),y.jsxDEV("option",{value:"operator",children:"operator"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:251,columnNumber:21},this),y.jsxDEV("option",{value:"admin",children:"admin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:252,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:244,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:234,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:te.last_login?new Date(te.last_login).toLocaleDateString():"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:256,columnNumber:15},this),y.jsxDEV("td",{style:{padding:"10px 12px",textAlign:"right"},children:y.jsxDEV("span",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[T===te.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:4,alignItems:"center"},children:[y.jsxDEV("input",{type:"password",placeholder:"New password",value:A,onChange:H=>M(H.target.value),autoFocus:!0,onKeyDown:H=>{H.key==="Enter"&&z(te.id),H.key==="Escape"&&(D(null),M(""))},style:{padding:"3px 8px",border:"1px solid var(--border-subtle)",borderRadius:3,background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",width:130}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:268,columnNumber:21},this),y.jsxDEV("button",{onClick:()=>z(te.id),className:"btn btn-sm btn-accent",children:"Set"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:281,columnNumber:21},this),y.jsxDEV("button",{onClick:()=>{D(null),M("")},className:"btn btn-sm",children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:282,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:267,columnNumber:19},this):y.jsxDEV("button",{onClick:()=>{D(te.id),M("")},className:"btn btn-sm",title:"Change password",children:"🔑"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:285,columnNumber:19},this),te.id!==(t==null?void 0:t.id)&&(E===te.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:294,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>K(te.id),className:"btn btn-sm btn-danger",children:"Yes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:301,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>S(null),className:"btn btn-sm",children:"No"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:307,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:293,columnNumber:21},this):y.jsxDEV("button",{onClick:()=>S(te.id),className:"btn btn-sm btn-danger",children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:315,columnNumber:21},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:265,columnNumber:17},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:264,columnNumber:15},this)]},te.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:227,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:225,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:203,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/UsersPanel.tsx",lineNumber:138,columnNumber:5},this)}function Oee(){const t=Ps(h=>h.selectedSquad),e=Ps(h=>h.activeStates),[n,s]=O.useState(null),[o,l]=O.useState(!1),u=t?e[t]:null;if(O.useEffect(()=>{if(!t){s(null);return}l(!0),fetch(`/api/squads/${t}`,{credentials:"include"}).then(h=>h.ok?h.json():null).then(h=>{h&&s(h.data)}).finally(()=>l(!1))},[t]),!t)return y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:38,columnNumber:7},this);if(o)return y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:50,columnNumber:7},this);const f={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:74,columnNumber:7},this),n&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Name"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:87,columnNumber:13},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:n.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:88,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:86,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Description"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:98,columnNumber:13},this),y.jsxDEV("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:n.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:99,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:97,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Agents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:109,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:n.agents.map(h=>y.jsxDEV("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:h.name},h.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:112,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:110,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:108,columnNumber:11},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Pipeline Steps"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:131,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:n.pipeline.steps.map((h,p)=>y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[y.jsxDEV("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:p+1},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:147,columnNumber:19},this),y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:h.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:163,columnNumber:19},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:h.agent},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:164,columnNumber:19},this)]},h.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:134,columnNumber:17},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:132,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:130,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:85,columnNumber:9},this),u&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:f,children:"Current State"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:181,columnNumber:11},this),y.jsxDEV("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(u,null,2)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:182,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:180,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/SquadInfoPanel.tsx",lineNumber:73,columnNumber:5},this)}function zee(){const[t,e]=O.useState(null),[n,s]=O.useState(null),[o,l]=O.useState(!0),[u,f]=O.useState(null),h=O.useCallback(async()=>{l(!0);try{const x=await fetch("/api/health",{credentials:"include"});if(x.ok){const v=await x.json();e(v),s(v.status==="ok")}else s(!1)}catch{s(!1)}finally{l(!1),f(new Date().toLocaleTimeString())}},[]);O.useEffect(()=>{h()},[h]);const p={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},g={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:66,columnNumber:9},this),y.jsxDEV("button",{onClick:h,className:"btn btn-sm",children:"Refresh"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:74,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:60,columnNumber:7},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:p,children:"Health Status"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:80,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"API Server"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:82,columnNumber:11},this),o?y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:84,columnNumber:13},this):y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:n?"var(--status-active)":"var(--status-error)"},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:n?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:n?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:102,columnNumber:15},this),n?"Healthy":"Unhealthy"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:93,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:81,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:79,columnNumber:7},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-5)"},children:[y.jsxDEV("div",{style:p,children:"Environment"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:119,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"API Port"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:121,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:122,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:120,columnNumber:9},this),y.jsxDEV("div",{style:g,children:[y.jsxDEV("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:131,columnNumber:11},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:132,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:130,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:118,columnNumber:7},this),u&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",u]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:143,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/ServerInfoPanel.tsx",lineNumber:59,columnNumber:5},this)}function Lee(){const[t,e]=O.useState([]),[n,s]=O.useState(!0),[o,l]=O.useState(!1),[u,f]=O.useState(null),[h,p]=O.useState(!1);O.useEffect(()=>{fetch("/api/settings/env/all",{credentials:"include"}).then(S=>S.json()).then(S=>{e(S.vars??[]),s(!1)}).catch(()=>s(!1))},[]);const g=O.useCallback((S,T,D)=>{e(A=>A.map((M,j)=>j===S?{...M,[T]:D,masked:T==="value"?!1:M.masked}:M)),p(!0),f(null)},[]),x=O.useCallback(()=>{e(S=>[...S,{key:"",value:"",masked:!1}]),p(!0),f(null)},[]),v=O.useCallback(S=>{e(T=>T.filter((D,A)=>A!==S)),p(!0),f(null)},[]),E=O.useCallback(async()=>{l(!0),f(null);try{const S=t.filter(D=>D.key.trim()).map(D=>({key:D.key.trim(),value:D.value})),T=await fetch("/api/settings/env/all",{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({vars:S})});if(T.ok){const D=await T.json();e(D.vars??[]),p(!1),f({type:"success",text:"Environment saved. Some changes may require a server restart."})}else{const D=await T.json();f({type:"error",text:D.error||"Failed to save"})}}catch{f({type:"error",text:"Network error"})}l(!1)},[t]);return n?y.jsxDEV("div",{style:{textAlign:"center",padding:40,color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:72,columnNumber:7},this):y.jsxDEV("div",{style:{maxWidth:800},children:[y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6,marginBottom:16},children:"Edit environment variables (.env). Secret values are masked. Changes to PORT, NODE_ENV or BRIDGE_TIMEOUT_MS may require a restart."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:80,columnNumber:7},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr 36px",gap:8,padding:"6px 0",borderBottom:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em"},children:[y.jsxDEV("span",{children:"Key"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:94,columnNumber:9},this),y.jsxDEV("span",{children:"Value"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:95,columnNumber:9},this),y.jsxDEV("span",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:96,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:88,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:4,marginTop:4},children:t.map((S,T)=>y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr 36px",gap:8,alignItems:"center"},children:[y.jsxDEV("input",{type:"text",value:S.key,onChange:D=>g(T,"key",D.target.value),placeholder:"VARIABLE_NAME",spellCheck:!1,style:{padding:"6px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:105,columnNumber:13},this),y.jsxDEV("input",{type:S.masked?"password":"text",value:S.value,onChange:D=>g(T,"value",D.target.value),onFocus:()=>{S.masked&&(e(D=>D.map((A,M)=>M===T?{...A,value:"",masked:!1}:A)),p(!0))},placeholder:"value",spellCheck:!1,style:{padding:"6px 10px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:118,columnNumber:13},this),y.jsxDEV("button",{onClick:()=>v(T),title:"Remove variable",style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:4,width:32,height:32,cursor:"pointer",color:"var(--text-muted)",fontSize:"0.9rem",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:D=>{D.currentTarget.style.color="#ef4444",D.currentTarget.style.borderColor="#ef444466"},onMouseLeave:D=>{D.currentTarget.style.color="var(--text-muted)",D.currentTarget.style.borderColor="var(--border-subtle)"},children:"×"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:137,columnNumber:13},this)]},T,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:102,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:100,columnNumber:7},this),y.jsxDEV("div",{style:{marginTop:16,display:"flex",alignItems:"center",gap:12},children:[y.jsxDEV("button",{onClick:x,style:{padding:"6px 16px",background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",cursor:"pointer"},children:"+ Add Variable"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:155,columnNumber:9},this),y.jsxDEV("button",{onClick:E,disabled:!h||o,style:{padding:"6px 20px",background:h?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:4,color:h?"var(--text-inverse)":"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",fontWeight:600,cursor:h?"pointer":"default",opacity:o?.6:1},children:o?"Saving...":"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:165,columnNumber:9},this),u&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:u.type==="success"?"#4ade80":"#ef4444"},children:u.text},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:180,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:154,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/EnvPanel.tsx",lineNumber:79,columnNumber:5},this)}function Bee(){const[t,e]=O.useState([]),[n,s]=O.useState(!0),[o,l]=O.useState(null),[u,f]=O.useState(null),[h,p]=O.useState(""),[g,x]=O.useState(""),[v,E]=O.useState(""),[S,T]=O.useState(""),[D,A]=O.useState(null),[M,j]=O.useState(""),[U,P]=O.useState(""),[z,K]=O.useState(""),[te,H]=O.useState(""),I=O.useCallback(async()=>{try{const L=await fetch("/api/team",{credentials:"include"});if(L.ok){const ee=await L.json();e(ee.members)}}catch{l("Failed to load team members")}finally{s(!1)}},[]);O.useEffect(()=>{I()},[I]);const F=async()=>{if(!(!h.trim()||!g.trim())){l(null);try{const L=await fetch("/api/team",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:h.trim(),role:g.trim(),email:v.trim()||void 0,phone:S.trim()||void 0}),credentials:"include"});if(!L.ok){const ee=await L.json();l(ee.error||"Failed to create team member");return}p(""),x(""),E(""),T(""),await I()}catch{l("Network error")}}},$=L=>{A(L.id),j(L.name),P(L.role),K(L.email||""),H(L.phone||"")},J=()=>{A(null)},X=async()=>{if(!(!D||!M.trim()||!U.trim())){l(null);try{(await fetch(`/api/team/${D}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:M.trim(),role:U.trim(),email:z.trim()||void 0,phone:te.trim()||void 0}),credentials:"include"})).ok&&(A(null),await I())}catch{l("Failed to update member")}}},Q=async L=>{try{(await fetch(`/api/team/${L}`,{method:"DELETE",credentials:"include"})).ok&&(f(null),await I())}catch{l("Failed to delete member")}};return n?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading team..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:133,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Team Members"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:147,columnNumber:7},this),o&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:o},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:158,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[y.jsxDEV("input",{className:"input",placeholder:"Name *",value:h,onChange:L=>p(L.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:180,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Role *",value:g,onChange:L=>x(L.target.value),style:{flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:187,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Email",type:"email",value:v,onChange:L=>E(L.target.value),style:{flex:1,minWidth:150}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:194,columnNumber:9},this),y.jsxDEV("input",{className:"input",placeholder:"Phone",type:"tel",value:S,onChange:L=>T(L.target.value),style:{flex:1,minWidth:130}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:202,columnNumber:9},this),y.jsxDEV("button",{onClick:F,className:"btn btn-accent",children:"Add Member"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:210,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:173,columnNumber:7},this),y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Name","Role","Email","Phone","Actions"].map((L,ee)=>y.jsxDEV("th",{style:{textAlign:ee===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:L},L,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:220,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:218,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:217,columnNumber:9},this),y.jsxDEV("tbody",{children:[t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:5,style:{padding:"var(--sp-5)",textAlign:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:"No team members yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:241,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:240,columnNumber:13},this),t.map(L=>D===L.id?y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-3)"},children:[y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:M,onChange:ee=>j(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:259,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:258,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:U,onChange:ee=>P(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:262,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:261,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:z,onChange:ee=>K(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:265,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:264,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px"},children:y.jsxDEV("input",{className:"input",value:te,onChange:ee=>H(ee.target.value),style:{width:"100%",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:268,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:267,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"6px 12px",textAlign:"right"},children:y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{onClick:X,className:"btn btn-sm btn-accent",children:"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:272,columnNumber:21},this),y.jsxDEV("button",{onClick:J,className:"btn btn-sm",children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:273,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:271,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:270,columnNumber:17},this)]},L.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:257,columnNumber:15},this):y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:L.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:279,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:L.role},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:282,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:L.email||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:285,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:L.phone||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:288,columnNumber:17},this),y.jsxDEV("td",{style:{padding:"10px 12px",textAlign:"right"},children:u===L.id?y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:299,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>Q(L.id),className:"btn btn-sm btn-danger",children:"Yes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:306,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>f(null),className:"btn btn-sm",children:"No"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:307,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:298,columnNumber:21},this):y.jsxDEV("span",{style:{display:"inline-flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{onClick:()=>$(L),className:"btn btn-sm",children:"Edit"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:311,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>f(L.id),className:"btn btn-sm btn-danger",children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:312,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:310,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:296,columnNumber:17},this)]},L.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:278,columnNumber:15},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:238,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:216,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/TeamPanel.tsx",lineNumber:146,columnNumber:5},this)}const Iee={dev:"Development",messaging:"Messaging",ads:"Advertising",crm:"CRM",support:"Support",email:"Email Marketing",sales:"Sales & Payments",pm:"Project Management",monitoring:"Monitoring",cloud:"Cloud & Deploy",design:"Design"},Hee={dev:"⌨",messaging:"💬",ads:"📢",crm:"📊",support:"🎧",email:"✉",sales:"💰",pm:"📋",monitoring:"🔍",cloud:"☁",design:"🎨"};function qee(){const[t,e]=O.useState([]),[n,s]=O.useState([]),[o,l]=O.useState(!0),[u,f]=O.useState(null),[h,p]=O.useState(null),[g,x]=O.useState(!1),[v,E]=O.useState({}),[S,T]=O.useState(!1),[D,A]=O.useState(null),[M,j]=O.useState(""),U=O.useCallback(async()=>{try{const[$,J]=await Promise.all([fetch("/api/integrations/catalog",{credentials:"include"}),fetch("/api/integrations",{credentials:"include"})]);if($.ok){const X=await $.json();e(X.providers)}if(J.ok){const X=await J.json();s(X.integrations)}}catch{f("Failed to load integrations")}finally{l(!1)}},[]);O.useEffect(()=>{U()},[U]);const P=$=>n.find(J=>J.provider===$),z=$=>{const J=P($.key),X={};for(const Q of $.fields)X[Q.key]=(J==null?void 0:J.config[Q.key])||"";E(X),T((J==null?void 0:J.enabled)??!1),p($.key),f(null)},K=async()=>{if(h){x(!0),f(null);try{const $=await fetch(`/api/integrations/${h}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:S,config:v}),credentials:"include"});if(!$.ok){const J=await $.json();f(J.error||"Failed to save");return}await U(),p(null)}catch{f("Network error")}finally{x(!1)}}},te=async $=>{try{(await fetch(`/api/integrations/${$}`,{method:"DELETE",credentials:"include"})).ok&&(await U(),h===$&&p(null))}catch{f("Failed to disconnect")}},H=Array.from(new Set(t.map($=>$.category))),I=M.toLowerCase(),F=t.filter($=>!(D&&$.category!==D||M&&!$.name.toLowerCase().includes(I)&&!$.description.toLowerCase().includes(I)));return o?y.jsxDEV("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading integrations..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:156,columnNumber:7},this):y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-2)"},children:"Integrations"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:170,columnNumber:7},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-muted)",marginBottom:"var(--sp-4)"},children:"Configure third-party services for your squads and agents"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:179,columnNumber:7},this),y.jsxDEV("input",{className:"input",type:"text",placeholder:"Search integrations...",value:M,onChange:$=>j($.target.value),style:{width:"100%",fontSize:"0.8rem",marginBottom:"var(--sp-3)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:189,columnNumber:7},this),u&&y.jsxDEV("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:u},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:203,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("button",{onClick:()=>A(null),style:{padding:"4px 12px",border:"1px solid",borderColor:D?"var(--border-subtle)":"var(--accent)",borderRadius:"var(--radius-sm)",background:D?"transparent":"var(--accent)",color:D?"var(--text-secondary)":"#fff",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"All"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:224,columnNumber:9},this),H.map($=>y.jsxDEV("button",{onClick:()=>A($),style:{padding:"4px 12px",border:"1px solid",borderColor:D===$?"var(--accent)":"var(--border-subtle)",borderRadius:"var(--radius-sm)",background:D===$?"var(--accent)":"transparent",color:D===$?"#fff":"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:[Hee[$]||""," ",Iee[$]||$]},$,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:241,columnNumber:11},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:218,columnNumber:7},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-3)"},children:F.map($=>{const J=P($.key),X=h===$.key;return y.jsxDEV("div",{style:{background:"var(--surface-3)",border:"1px solid",borderColor:J!=null&&J.enabled?"var(--status-running)":"var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",gridColumn:X?"1 / -1":void 0},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:X?"var(--sp-3)":0},children:[y.jsxDEV("div",{children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:$.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:297,columnNumber:21},this),(J==null?void 0:J.enabled)&&y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--status-running)",boxShadow:"0 0 4px var(--status-running)",display:"inline-block"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:306,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:292,columnNumber:19},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-muted)"},children:$.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:316,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:291,columnNumber:17},this),y.jsxDEV("button",{onClick:()=>X?p(null):z($),className:"btn btn-sm",style:{flexShrink:0},children:X?"Close":J?"Edit":"Configure"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:324,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:285,columnNumber:15},this),X&&y.jsxDEV("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:"var(--sp-3)"},children:[y.jsxDEV("label",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",cursor:"pointer"},children:[y.jsxDEV("input",{type:"checkbox",checked:S,onChange:Q=>T(Q.target.checked)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:347,columnNumber:21},this),"Enabled"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:337,columnNumber:19},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:$.fields.map(Q=>y.jsxDEV("div",{children:[y.jsxDEV("label",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:2,display:"block"},children:[Q.label," ",Q.required&&"*"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:359,columnNumber:25},this),y.jsxDEV("input",{className:"input",type:Q.type==="password"?"password":"text",placeholder:Q.placeholder||"",value:v[Q.key]||"",onChange:L=>E(ee=>({...ee,[Q.key]:L.target.value})),style:{width:"100%",fontSize:"0.8rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:370,columnNumber:25},this)]},Q.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:358,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:356,columnNumber:19},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginTop:"var(--sp-3)",justifyContent:"flex-end"},children:[J&&y.jsxDEV("button",{onClick:()=>te($.key),className:"btn btn-sm btn-danger",children:"Disconnect"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:390,columnNumber:23},this),y.jsxDEV("button",{onClick:()=>p(null),className:"btn btn-sm",children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:397,columnNumber:21},this),y.jsxDEV("button",{onClick:K,className:"btn btn-sm btn-accent",disabled:g,children:g?"Saving...":"Save"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:403,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:383,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:335,columnNumber:17},this)]},$.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:272,columnNumber:13},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:262,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/components/settings/IntegrationsPanel.tsx",lineNumber:169,columnNumber:5},this)}function Fee(){const t=au(u=>u.user),e=(t==null?void 0:t.role)==="admin",[n,s]=O.useState(e?"users":"squad"),l=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"team",label:"Team",icon:"◎"},{key:"integrations",label:"Integrations",icon:"⬡"},{key:"squad",label:"Squad",icon:"⬢"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(u=>!u.adminOnly||e);return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:39,columnNumber:9},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:48,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:38,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:l.map(u=>y.jsxDEV("button",{onClick:()=>s(u.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:n===u.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:n===u.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:n===u.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontSize:"0.75rem",opacity:.7},children:u.icon},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:88,columnNumber:13},this),u.label]},u.key,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:65,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:58,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto"},children:[n==="users"&&e&&y.jsxDEV(Pee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:96,columnNumber:46},this),n==="team"&&y.jsxDEV(Bee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:97,columnNumber:34},this),n==="integrations"&&y.jsxDEV(qee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:98,columnNumber:42},this),n==="squad"&&y.jsxDEV(Oee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:99,columnNumber:35},this),n==="server"&&y.jsxDEV(zee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:100,columnNumber:36},this),n==="env"&&e&&y.jsxDEV(Lee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:101,columnNumber:44},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:95,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SettingsView.tsx",lineNumber:30,columnNumber:5},this)}const g6=[{value:"0",label:"Domingo"},{value:"1",label:"Segunda"},{value:"2",label:"Terça"},{value:"3",label:"Quarta"},{value:"4",label:"Quinta"},{value:"5",label:"Sexta"},{value:"6",label:"Sábado"}];function Gee(t,e){switch(t){case"every_n_minutes":return`*/${e.everyNMinutes||"30"} * * * *`;case"every_n_hours":return`${e.minute||"0"} */${e.everyNHours||"2"} * * *`;case"hourly":return`${e.minute||"0"} * * * *`;case"daily":return`${e.minute||"0"} ${e.hour||"9"} * * *`;case"weekly":return`${e.minute||"0"} ${e.hour||"9"} * * ${e.dayOfWeek||"1"}`;case"monthly":return`${e.minute||"0"} ${e.hour||"9"} ${e.dayOfMonth||"1"} * *`;case"custom":return"";default:return"0 9 * * *"}}function bT(t){var u;if(!t)return"";const e=t.split(" ");if(e.length!==5)return t;const[n,s,o,,l]=e;return n.startsWith("*/")?`A cada ${n.replace("*/","")} minutos`:s.startsWith("*/")?`A cada ${s.replace("*/","")} horas no minuto ${n}`:s==="*"&&o==="*"?`A cada hora no minuto ${n}`:o==="*"&&l==="*"?`Diariamente às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:o==="*"&&l!=="*"?`Semanalmente, ${((u=g6.find(h=>h.value===l))==null?void 0:u.label)||`dia ${l}`} às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:l==="*"&&o!=="*"?`Mensalmente, dia ${o} às ${s.padStart(2,"0")}:${n.padStart(2,"0")}`:t}function Yee(t){if(t===null)return"—";if(t<1e3)return`${t}ms`;const e=Math.floor(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),s=e%60;if(n<60)return`${n}m ${s}s`;const o=Math.floor(n/60),l=n%60;return`${o}h ${l}m`}function p3(t){return t?new Date(t).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"—"}function $ee(t){switch(t){case"completed":return{label:"Sucesso",color:"var(--status-active)"};case"failed":return{label:"Falhou",color:"var(--status-error)"};case"running":return{label:"Executando",color:"var(--status-warning)"};default:return{label:t,color:"var(--text-muted)"}}}const Hy={width:"100%",padding:"6px 10px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",outline:"none"},iu={...Hy,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 8px center",paddingRight:"28px"},Po={fontFamily:"var(--font-mono)",fontSize:"0.62rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4,display:"block"},ol={padding:"6px 16px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer",border:"none",transition:"all 0.15s ease"};function g3({children:t,onClose:e,title:n,wide:s}){return y.jsxDEV("div",{"data-testid":"modal-overlay",onClick:o=>{o.target===o.currentTarget&&e()},style:{position:"fixed",inset:0,zIndex:1e3,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:"var(--sp-4)",animation:"fadeIn 0.15s var(--ease-out) both"},children:y.jsxDEV("div",{"data-testid":"modal-content",style:{background:"var(--surface-1)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",width:"100%",maxWidth:s?900:560,maxHeight:"90vh",display:"flex",flexDirection:"column",animation:"fadeInUp 0.2s var(--ease-out) both"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.9rem",color:"var(--text-primary)"},children:n},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:186,columnNumber:11},this),y.jsxDEV("button",{onClick:e,style:{...ol,padding:"4px 8px",fontSize:"0.7rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:192,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:178,columnNumber:9},this),y.jsxDEV("div",{style:{overflow:"auto",flex:1},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:201,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:163,columnNumber:7},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:147,columnNumber:5},this)}function Xee(){var Tr,ke,Oe;const t=zo(ce=>ce.jobs),e=zo(ce=>ce.loading),n=zo(ce=>ce.fetchJobs),s=zo(ce=>ce.createJob),o=zo(ce=>ce.deleteJob),l=zo(ce=>ce.pauseJob),u=zo(ce=>ce.resumeJob),f=zo(ce=>ce.triggerJob),h=zo(ce=>ce.history),p=zo(ce=>ce.historyLoading),g=zo(ce=>ce.fetchHistory),x=Ps(ce=>ce.squads),[v,E]=O.useState(!1),[S,T]=O.useState(null),[D,A]=O.useState(null),[M,j]=O.useState(null),[U,P]=O.useState(""),[z,K]=O.useState(""),[te,H]=O.useState("daily"),[I,F]=O.useState("0"),[$,J]=O.useState("9"),[X,Q]=O.useState("1"),[L,ee]=O.useState("1"),[ne,oe]=O.useState("30"),[G,B]=O.useState("2"),[ae,Z]=O.useState(""),[be,Ve]=O.useState(""),[he,Ne]=O.useState("America/Sao_Paulo"),[De,me]=O.useState("30"),[qe,Te]=O.useState("0");O.useEffect(()=>{n()},[n]);const Ke=O.useCallback(()=>{K(""),H("daily"),F("0"),J("9"),Q("1"),ee("1"),oe("30"),B("2"),Z(""),Ve(""),Ne("America/Sao_Paulo"),me("30"),Te("0"),T(null)},[]),et=()=>{E(!1),Ke()},Ct=()=>{Ke(),E(!0)},kt=ce=>{K(ce.squad_name),Ve(ce.prompt||""),Ne(ce.timezone||"America/Sao_Paulo"),me(String(ce.timeout_minutes||30)),Te(String(ce.retry_on_failure||0)),T(ce.squad_name);const tt=ce.cron_expression.split(" ");if(tt.length===5){const[bt,en,cr,,Fn]=tt;bt.startsWith("*/")?(H("every_n_minutes"),oe(bt.replace("*/",""))):en.startsWith("*/")?(H("every_n_hours"),B(en.replace("*/","")),F(bt)):en==="*"?(H("hourly"),F(bt)):cr==="*"&&Fn==="*"?(H("daily"),F(bt),J(en)):cr==="*"&&Fn!=="*"?(H("weekly"),F(bt),J(en),Q(Fn)):Fn==="*"&&cr!=="*"?(H("monthly"),F(bt),J(en),ee(cr)):(H("custom"),Z(ce.cron_expression))}else H("custom"),Z(ce.cron_expression);E(!0)},Fe=te==="custom"?ae:Gee(te,{minute:I,hour:$,dayOfMonth:L,dayOfWeek:X,everyNMinutes:ne,everyNHours:G}),Ut=async()=>{if(!z||!Fe||!be.trim())return;const ce={squad_name:z,cron_expression:Fe,prompt:be.trim(),timezone:he||void 0,timeout_minutes:parseInt(De)||30,retry_on_failure:parseInt(qe)||0};await s(ce)&&et()},Bn=ce=>{A(ce),j(null),g(ce)},wr=()=>{A(null),j(null)},rt=ce=>ce==="active"?"var(--status-active)":ce==="paused"?"var(--status-warning)":"var(--status-error)",Jt=ce=>ce==="active"?"var(--status-active-glow)":ce==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)",Cr=x.filter(ce=>!t.some(tt=>tt.squad_name===ce.code)),br=U.toLowerCase(),qn=U?t.filter(ce=>{var tt;return ce.squad_name.toLowerCase().includes(br)||((tt=ce.prompt)==null?void 0:tt.toLowerCase().includes(br))||ce.status.toLowerCase().includes(br)||bT(ce.cron_expression).toLowerCase().includes(br)}):t;return y.jsxDEV("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both",width:"100%",boxSizing:"border-box"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("div",{children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:377,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:386,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:376,columnNumber:9},this),y.jsxDEV("button",{"data-testid":"btn-new-schedule",onClick:Ct,style:{...ol,background:"var(--accent)",color:"var(--text-inverse)"},children:"+ New Schedule"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:394,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:375,columnNumber:7},this),t.length>0&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:y.jsxDEV("input",{"data-testid":"search-jobs",type:"text",placeholder:"Search by name, prompt, status...",value:U,onChange:ce=>P(ce.target.value),style:{...Hy,maxWidth:400,paddingLeft:32,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"10px center"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:410,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:409,columnNumber:9},this),e&&y.jsxDEV("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:429,columnNumber:9},this),!e&&t.length===0&&!v&&y.jsxDEV("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[y.jsxDEV("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:445,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:446,columnNumber:11},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Click ",y.jsxDEV("strong",{children:"+ New Schedule"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:451,columnNumber:19},this)," to create your first automated job."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:447,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:440,columnNumber:9},this),y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"var(--sp-3)",width:"100%"},children:qn.map((ce,tt)=>y.jsxDEV("div",{"data-testid":`job-${ce.squad_name}`,style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)",transition:"all var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${tt*40}ms both`,display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:ce.squad_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:481,columnNumber:15},this),y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:rt(ce.status),flexShrink:0,marginLeft:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:rt(ce.status),boxShadow:`0 0 8px ${Jt(ce.status)}`,display:"inline-block",animation:ce.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:502,columnNumber:17},this),ce.status]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:492,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:480,columnNumber:13},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-2)"},children:[y.jsxDEV("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.6rem",flexShrink:0},children:ce.cron_expression},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:522,columnNumber:15},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:bT(ce.cron_expression)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:531,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:514,columnNumber:13},this),ce.prompt&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.63rem",color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)"},children:ce.prompt},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:538,columnNumber:15},this),ce.last_run_at&&y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["Last: ",new Date(ce.last_run_at).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),ce.last_result&&y.jsxDEV("span",{children:[" — ",ce.last_result]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:563,columnNumber:37},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:555,columnNumber:15},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",flexWrap:"wrap",marginTop:"auto"},children:[y.jsxDEV("button",{onClick:()=>kt(ce),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Edit"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:569,columnNumber:15},this),ce.status==="active"?y.jsxDEV("button",{onClick:()=>l(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-warning)"},children:"Pause"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:575,columnNumber:17},this):y.jsxDEV("button",{onClick:()=>u(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",color:"var(--status-active)"},children:"Resume"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:581,columnNumber:17},this),y.jsxDEV("button",{onClick:()=>f(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"var(--accent)",color:"var(--text-inverse)"},children:"Trigger"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:587,columnNumber:15},this),y.jsxDEV("button",{"data-testid":`btn-history-${ce.squad_name}`,onClick:()=>Bn(ce.squad_name),style:{...ol,padding:"3px 8px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)"},children:"Log"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:591,columnNumber:15},this),y.jsxDEV("button",{onClick:()=>{confirm(`Delete schedule for ${ce.squad_name}?`)&&o(ce.squad_name)},style:{...ol,padding:"3px 6px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",marginLeft:"auto"},title:"Delete schedule",children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:600,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:568,columnNumber:13},this)]},ce.squad_name,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:464,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:457,columnNumber:7},this),!e&&U&&qn.length===0&&t.length>0&&y.jsxDEV("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:['No jobs matching "',U,'"']},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:616,columnNumber:9},this),v&&y.jsxDEV(g3,{title:S?"Edit Schedule":"New Schedule",onClose:et,children:y.jsxDEV("div",{"data-testid":"schedule-form",style:{padding:"var(--sp-4)"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:636,columnNumber:15},this),S?y.jsxDEV("div",{style:{...Hy,background:"var(--surface-3)",color:"var(--text-secondary)"},children:S},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:638,columnNumber:17},this):y.jsxDEV("select",{"data-testid":"select-squad",value:z,onChange:ce=>K(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"",children:"Select a squad..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:648,columnNumber:19},this),Cr.map(ce=>y.jsxDEV("option",{value:ce.code,children:[ce.name," (",ce.code,")"]},ce.code,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:650,columnNumber:21},this)),t.length===0&&x.length===0&&y.jsxDEV("option",{disabled:!0,children:"No squads available"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:653,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:642,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:635,columnNumber:13},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Frequency"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:661,columnNumber:15},this),y.jsxDEV("select",{"data-testid":"select-frequency",value:te,onChange:ce=>H(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"every_n_minutes",children:"Every N minutes"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:668,columnNumber:17},this),y.jsxDEV("option",{value:"every_n_hours",children:"Every N hours"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:669,columnNumber:17},this),y.jsxDEV("option",{value:"hourly",children:"Hourly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:670,columnNumber:17},this),y.jsxDEV("option",{value:"daily",children:"Daily"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:671,columnNumber:17},this),y.jsxDEV("option",{value:"weekly",children:"Weekly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:672,columnNumber:17},this),y.jsxDEV("option",{value:"monthly",children:"Monthly"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:673,columnNumber:17},this),y.jsxDEV("option",{value:"custom",children:"Custom cron"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:674,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:662,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:660,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[te==="every_n_minutes"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Every (minutes)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:682,columnNumber:19},this),y.jsxDEV("select",{value:ne,onChange:ce=>oe(ce.target.value),style:iu,children:[1,2,5,10,15,20,30].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:685,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:683,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:681,columnNumber:17},this),te==="every_n_hours"&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Every (hours)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:693,columnNumber:21},this),y.jsxDEV("select",{value:G,onChange:ce=>B(ce.target.value),style:iu,children:[2,3,4,6,8,12].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:696,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:694,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:692,columnNumber:19},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"At minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:701,columnNumber:21},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:704,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:702,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:700,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:691,columnNumber:17},this),te==="hourly"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"At minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:712,columnNumber:19},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:715,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:713,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:711,columnNumber:17},this),(te==="daily"||te==="weekly"||te==="monthly")&&y.jsxDEV(y.Fragment,{children:[y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Hour"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:723,columnNumber:21},this),y.jsxDEV("select",{value:$,onChange:ce=>J(ce.target.value),style:iu,children:Array.from({length:24},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:726,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:724,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:722,columnNumber:19},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Minute"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:731,columnNumber:21},this),y.jsxDEV("select",{value:I,onChange:ce=>F(ce.target.value),style:iu,children:Array.from({length:60},(ce,tt)=>y.jsxDEV("option",{value:String(tt),children:String(tt).padStart(2,"0")},tt,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:734,columnNumber:25},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:732,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:730,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:721,columnNumber:17},this),te==="weekly"&&y.jsxDEV("div",{style:{flex:1,minWidth:140},children:[y.jsxDEV("label",{style:Po,children:"Day of week"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:742,columnNumber:19},this),y.jsxDEV("select",{value:X,onChange:ce=>Q(ce.target.value),style:iu,children:g6.map(ce=>y.jsxDEV("option",{value:ce.value,children:ce.label},ce.value,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:745,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:743,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:741,columnNumber:17},this),te==="monthly"&&y.jsxDEV("div",{style:{flex:1,minWidth:120},children:[y.jsxDEV("label",{style:Po,children:"Day of month"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:752,columnNumber:19},this),y.jsxDEV("select",{value:L,onChange:ce=>ee(ce.target.value),style:iu,children:Array.from({length:31},(ce,tt)=>y.jsxDEV("option",{value:String(tt+1),children:tt+1},tt+1,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:755,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:753,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:751,columnNumber:17},this),te==="custom"&&y.jsxDEV("div",{style:{flex:1,minWidth:200},children:[y.jsxDEV("label",{style:Po,children:"Cron expression"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:762,columnNumber:19},this),y.jsxDEV("input",{type:"text",placeholder:"* * * * *",value:ae,onChange:ce=>Z(ce.target.value),style:Hy},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:763,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:761,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:679,columnNumber:13},this),Fe&&y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)",padding:"8px 12px",background:"var(--surface-3)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("code",{style:{color:"var(--accent)",fontWeight:600},children:Fe},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:788,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-muted)"},children:"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:789,columnNumber:17},this),y.jsxDEV("span",{"data-testid":"cron-preview",style:{color:"var(--text-secondary)"},children:bT(Fe)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:790,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:776,columnNumber:15},this),y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("label",{style:Po,children:"Instruction for the agent"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:796,columnNumber:15},this),y.jsxDEV("textarea",{"data-testid":"input-prompt",placeholder:"What should the squad do on each execution?",value:be,onChange:ce=>Ve(ce.target.value),rows:3,style:{...Hy,resize:"vertical",lineHeight:1.5}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:797,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:795,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("div",{style:{flex:2,minWidth:180},children:[y.jsxDEV("label",{style:Po,children:"Timezone"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:810,columnNumber:17},this),y.jsxDEV("select",{value:he,onChange:ce=>Ne(ce.target.value),style:iu,children:[y.jsxDEV("option",{value:"America/Sao_Paulo",children:"America/Sao_Paulo"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:812,columnNumber:19},this),y.jsxDEV("option",{value:"America/New_York",children:"America/New_York"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:813,columnNumber:19},this),y.jsxDEV("option",{value:"America/Chicago",children:"America/Chicago"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:814,columnNumber:19},this),y.jsxDEV("option",{value:"America/Los_Angeles",children:"America/Los_Angeles"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:815,columnNumber:19},this),y.jsxDEV("option",{value:"Europe/London",children:"Europe/London"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:816,columnNumber:19},this),y.jsxDEV("option",{value:"Europe/Berlin",children:"Europe/Berlin"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:817,columnNumber:19},this),y.jsxDEV("option",{value:"Asia/Tokyo",children:"Asia/Tokyo"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:818,columnNumber:19},this),y.jsxDEV("option",{value:"UTC",children:"UTC"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:819,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:811,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:809,columnNumber:15},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Timeout (min)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:823,columnNumber:17},this),y.jsxDEV("input",{type:"number",min:1,max:480,value:De,onChange:ce=>me(ce.target.value),style:Hy},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:824,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:822,columnNumber:15},this),y.jsxDEV("div",{style:{flex:1,minWidth:100},children:[y.jsxDEV("label",{style:Po,children:"Retries"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:834,columnNumber:17},this),y.jsxDEV("select",{value:qe,onChange:ce=>Te(ce.target.value),style:iu,children:[0,1,2,3,4,5].map(ce=>y.jsxDEV("option",{value:String(ce),children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:837,columnNumber:21},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:835,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:833,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:808,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[y.jsxDEV("button",{"data-testid":"btn-save-schedule",onClick:Ut,disabled:!z||!Fe||!be.trim(),style:{...ol,background:z&&Fe&&be.trim()?"var(--accent)":"var(--surface-4)",color:z&&Fe&&be.trim()?"var(--text-inverse)":"var(--text-muted)"},children:S?"Update":"Create"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:845,columnNumber:15},this),y.jsxDEV("button",{onClick:et,style:{...ol,background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-secondary)"},children:"Cancel"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:857,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:844,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:633,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:629,columnNumber:9},this),D&&y.jsxDEV(g3,{title:`Execution Log — ${D}`,onClose:wr,wide:!0,children:y.jsxDEV("div",{"data-testid":`history-${D}`,children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"flex-end",padding:"6px 12px",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("button",{"data-testid":`btn-refresh-${D}`,onClick:()=>g(D),disabled:p[D],style:{...ol,padding:"3px 10px",fontSize:"0.62rem",background:"none",border:"1px solid var(--border-subtle)",color:p[D]?"var(--text-muted)":"var(--text-secondary)",display:"inline-flex",alignItems:"center",gap:4},children:[y.jsxDEV("span",{style:{display:"inline-block",animation:p[D]?"spin 1s linear infinite":"none"},children:"↻"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:897,columnNumber:17},this),"Refresh"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:886,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:882,columnNumber:13},this),p[D]&&y.jsxDEV("div",{style:{padding:"var(--sp-3)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:906,columnNumber:15},this),!p[D]&&(!h[D]||h[D].length===0)&&y.jsxDEV("div",{style:{padding:"var(--sp-6)",textAlign:"center",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"No executions recorded yet."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:913,columnNumber:15},this),!p[D]&&((Tr=h[D])==null?void 0:Tr.length)>0&&y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{background:"var(--surface-3)"},children:["Status","Started","Finished","Duration","Attempt","Output"].map(ce=>y.jsxDEV("th",{style:{padding:"6px 8px",textAlign:"left",fontWeight:600,fontSize:"0.6rem",textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)",borderBottom:"1px solid var(--border-subtle)"},children:ce},ce,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:927,columnNumber:23},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:925,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:924,columnNumber:17},this),y.jsxDEV("tbody",{children:h[D].map(ce=>{const tt=$ee(ce.status),bt=M===ce.id;return y.jsxDEV("tr",{"data-testid":`activity-${ce.id}`,style:{borderBottom:"1px solid var(--border-subtle)",transition:"background 0.1s"},onMouseEnter:en=>{en.currentTarget.style.background="var(--surface-3)"},onMouseLeave:en=>{en.currentTarget.style.background="transparent"},children:[y.jsxDEV("td",{style:{padding:"6px 8px"},children:y.jsxDEV("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:tt.color,fontWeight:600},children:[y.jsxDEV("span",{style:{width:6,height:6,borderRadius:"50%",background:tt.color,display:"inline-block",animation:ce.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:955,columnNumber:29},this),tt.label]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:951,columnNumber:27},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:950,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:p3(ce.started_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:963,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)"},children:p3(ce.finished_at)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:966,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:Yee(ce.duration_ms)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:969,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px",color:"var(--text-muted)",textAlign:"center"},children:ce.attempt??1},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:972,columnNumber:25},this),y.jsxDEV("td",{style:{padding:"6px 8px"},children:ce.result_summary?y.jsxDEV("button",{"data-testid":`btn-output-${ce.id}`,onClick:()=>j(bt?null:ce.id),style:{...ol,padding:"2px 8px",fontSize:"0.62rem",background:bt?"var(--accent)":"var(--surface-4)",color:bt?"var(--text-inverse)":"var(--text-secondary)",border:"none"},children:bt?"Hide":"View"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:977,columnNumber:29},this):y.jsxDEV("span",{style:{color:"var(--text-muted)"},children:"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:990,columnNumber:29},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:975,columnNumber:25},this)]},ce.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:940,columnNumber:23},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:935,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:920,columnNumber:15},this),M&&((ke=h[D])==null?void 0:ke.find(ce=>ce.id===M))&&y.jsxDEV("div",{"data-testid":`output-panel-${M}`,style:{padding:"var(--sp-3)",background:"var(--surface-0)",borderTop:"1px solid var(--border-subtle)"},children:[y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-2)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--text-muted)"},children:"Output"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1013,columnNumber:19},this),y.jsxDEV("button",{onClick:()=>j(null),style:{...ol,padding:"2px 6px",fontSize:"0.6rem",background:"none",border:"none",color:"var(--text-muted)"},children:"✕"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1017,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1009,columnNumber:17},this),y.jsxDEV("pre",{style:{fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",margin:0,lineHeight:1.6,padding:"var(--sp-3)",background:"var(--surface-2)",borderRadius:"var(--radius-xs)",border:"1px solid var(--border-subtle)"},children:(Oe=h[D].find(ce=>ce.id===M))==null?void 0:Oe.result_summary},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1025,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:1002,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:880,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:875,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/SchedulerView.tsx",lineNumber:373,columnNumber:5},this)}const fc=Nc(t=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),s=await fetch(`/api/email/leads?${n}`);if(s.ok){const o=await s.json();t({leads:o.data,total:o.total})}}finally{t({loading:!1})}},fetchCampaigns:async(e={})=>{t({loading:!0});try{const n=new URLSearchParams(e),s=await fetch(`/api/email/campaigns?${n}`);if(s.ok){const o=await s.json();t({campaigns:o.data})}}finally{t({loading:!1})}},fetchLists:async()=>{const e=await fetch("/api/email/leads/lists");if(e.ok){const n=await e.json();t({lists:n.lists})}},fetchTags:async()=>{const e=await fetch("/api/email/leads/tags");if(e.ok){const n=await e.json();t({tags:n.tags})}}}));function Kee(){const t=fc(x=>x.leads),e=fc(x=>x.total),n=fc(x=>x.lists),s=fc(x=>x.tags),o=fc(x=>x.loading),l=fc(x=>x.fetchLeads),u=fc(x=>x.fetchLists),f=fc(x=>x.fetchTags),[h,p]=O.useState("");O.useEffect(()=>{l(),u(),f()},[l,u,f]);const g=()=>{l(h?{search:h}:{})};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[y.jsxDEV(xT,{label:"Total Leads",value:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:32,columnNumber:9},this),y.jsxDEV(xT,{label:"Lists",value:n.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:33,columnNumber:9},this),y.jsxDEV(xT,{label:"Tags",value:s.length},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:31,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Search leads...",value:h,onChange:x=>p(x.target.value),onKeyDown:x=>x.key==="Enter"&&g(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:39,columnNumber:9},this),y.jsxDEV("button",{onClick:g,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:56,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:38,columnNumber:7},this),o?y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:72,columnNumber:9},this):y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(x=>y.jsxDEV("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:x},x,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:86,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:84,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:83,columnNumber:13},this),y.jsxDEV("tbody",{children:[t.map(x=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:Bo,children:x.email},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:102,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.name||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:103,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.company||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:104,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:y.jsxDEV(b6,{status:x.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:106,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:105,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:x.source||"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:108,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(x.created_at).toLocaleDateString()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:109,columnNumber:19},this)]},x.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:101,columnNumber:17},this)),t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:6,style:{...Bo,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:116,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:115,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:99,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:82,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:76,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:29,columnNumber:5},this)}function Wee(){const t=fc(s=>s.campaigns),e=fc(s=>s.loading),n=fc(s=>s.fetchCampaigns);return O.useEffect(()=>{n()},[n]),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:e?y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:141,columnNumber:9},this):y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(s=>y.jsxDEV("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:s},s,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:155,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:153,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:152,columnNumber:13},this),y.jsxDEV("tbody",{children:[t.map(s=>y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:Bo,children:s.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:171,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:s.subject},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:172,columnNumber:19},this),y.jsxDEV("td",{style:Bo,children:y.jsxDEV(b6,{status:s.status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:174,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:173,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.total_recipients},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:176,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.sent_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:177,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)"},children:s.bounce_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:178,columnNumber:19},this),y.jsxDEV("td",{style:{...Bo,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(s.created_at).toLocaleDateString()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:179,columnNumber:19},this)]},s.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:170,columnNumber:17},this)),t.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:7,style:{...Bo,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:186,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:185,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:168,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:151,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:145,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:139,columnNumber:5},this)}function Qee(){return y.jsxDEV("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[y.jsxDEV("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:207,columnNumber:7},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[y.jsxDEV("p",{children:"Configure these environment variables on the server:"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:221,columnNumber:9},this),y.jsxDEV("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[y.jsxDEV("code",{children:"AWS_ACCESS_KEY_ID=..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:229,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:229,columnNumber:45},this),y.jsxDEV("code",{children:"AWS_SECRET_ACCESS_KEY=..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:230,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:230,columnNumber:49},this),y.jsxDEV("code",{children:"AWS_REGION=us-east-1"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:231,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:231,columnNumber:44},this),y.jsxDEV("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:232,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:232,columnNumber:61},this),y.jsxDEV("code",{children:"SES_RATE_LIMIT=14"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:233,columnNumber:11},this),y.jsxDEV("br",{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:233,columnNumber:41},this),y.jsxDEV("code",{children:"SERVER_URL=https://yourdomain.com"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:234,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:222,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:215,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:201,columnNumber:5},this)}function xT({label:t,value:e}){return y.jsxDEV("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:250,columnNumber:7},this),y.jsxDEV("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:e},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:258,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:243,columnNumber:5},this)}function b6({status:t}){const n={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[t]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return y.jsxDEV("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:n.bg,color:n.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:t},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:281,columnNumber:5},this)}const Bo={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function Zee(){const[t,e]=O.useState("leads"),n=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return y.jsxDEV("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-4)"},children:[y.jsxDEV("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:315,columnNumber:9},this),y.jsxDEV("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:324,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:314,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:n.map(s=>y.jsxDEV("button",{onClick:()=>e(s.key),style:{padding:"8px 16px",background:t===s.key?"var(--accent-glow)":"transparent",border:t===s.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:t===s.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t===s.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:s.label},s.key,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:342,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:334,columnNumber:7},this),t==="leads"&&y.jsxDEV(Kee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:364,columnNumber:27},this),t==="campaigns"&&y.jsxDEV(Wee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:365,columnNumber:31},this),t==="settings"&&y.jsxDEV(Qee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:366,columnNumber:30},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/EmailView.tsx",lineNumber:312,columnNumber:5},this)}function Os(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,s;n<t.length;n++)(s=Os(t[n]))!==""&&(e+=(e&&" ")+s);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var Jee={value:()=>{}};function bD(){for(var t=0,e=arguments.length,n={},s;t<e;++t){if(!(s=arguments[t]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new NS(n)}function NS(t){this._=t}function ete(t,e){return t.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}NS.prototype=bD.prototype={constructor:NS,on:function(t,e){var n=this._,s=ete(t+"",n),o,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((o=(t=s[l]).type)&&(o=tte(n[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++l<u;)if(o=(t=s[l]).type)n[o]=b3(n[o],t.name,e);else if(e==null)for(o in n)n[o]=b3(n[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new NS(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,l;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(l=this._[t],s=0,o=l.length;s<o;++s)l[s].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],o=0,l=s.length;o<l;++o)s[o].value.apply(e,n)}};function tte(t,e){for(var n=0,s=t.length,o;n<s;++n)if((o=t[n]).name===e)return o.value}function b3(t,e,n){for(var s=0,o=t.length;s<o;++s)if(t[s].name===e){t[s]=Jee,t=t.slice(0,s).concat(t.slice(s+1));break}return n!=null&&t.push({name:e,value:n}),t}var TR="http://www.w3.org/1999/xhtml";const x3={svg:"http://www.w3.org/2000/svg",xhtml:TR,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xD(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),x3.hasOwnProperty(e)?{space:x3[e],local:t}:t}function nte(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===TR&&e.documentElement.namespaceURI===TR?e.createElement(t):e.createElementNS(n,t)}}function rte(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function x6(t){var e=xD(t);return(e.local?rte:nte)(e)}function ste(){}function Oj(t){return t==null?ste:function(){return this.querySelector(t)}}function ite(t){typeof t!="function"&&(t=Oj(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=new Array(u),h,p,g=0;g<u;++g)(h=l[g])&&(p=t.call(h,h.__data__,g,l))&&("__data__"in h&&(p.__data__=h.__data__),f[g]=p);return new dl(s,this._parents)}function ote(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ate(){return[]}function y6(t){return t==null?ate:function(){return this.querySelectorAll(t)}}function lte(t){return function(){return ote(t.apply(this,arguments))}}function ute(t){typeof t=="function"?t=lte(t):t=y6(t);for(var e=this._groups,n=e.length,s=[],o=[],l=0;l<n;++l)for(var u=e[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&(s.push(t.call(h,h.__data__,p,u)),o.push(h));return new dl(s,o)}function v6(t){return function(){return this.matches(t)}}function E6(t){return function(e){return e.matches(t)}}var cte=Array.prototype.find;function dte(t){return function(){return cte.call(this.children,t)}}function fte(){return this.firstElementChild}function hte(t){return this.select(t==null?fte:dte(typeof t=="function"?t:E6(t)))}var mte=Array.prototype.filter;function pte(){return Array.from(this.children)}function gte(t){return function(){return mte.call(this.children,t)}}function bte(t){return this.selectAll(t==null?pte:gte(typeof t=="function"?t:E6(t)))}function xte(t){typeof t!="function"&&(t=v6(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=[],h,p=0;p<u;++p)(h=l[p])&&t.call(h,h.__data__,p,l)&&f.push(h);return new dl(s,this._parents)}function _6(t){return new Array(t.length)}function yte(){return new dl(this._enter||this._groups.map(_6),this._parents)}function GS(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}GS.prototype={constructor:GS,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function vte(t){return function(){return t}}function Ete(t,e,n,s,o,l){for(var u=0,f,h=e.length,p=l.length;u<p;++u)(f=e[u])?(f.__data__=l[u],s[u]=f):n[u]=new GS(t,l[u]);for(;u<h;++u)(f=e[u])&&(o[u]=f)}function _te(t,e,n,s,o,l,u){var f,h,p=new Map,g=e.length,x=l.length,v=new Array(g),E;for(f=0;f<g;++f)(h=e[f])&&(v[f]=E=u.call(h,h.__data__,f,e)+"",p.has(E)?o[f]=h:p.set(E,h));for(f=0;f<x;++f)E=u.call(t,l[f],f,l)+"",(h=p.get(E))?(s[f]=h,h.__data__=l[f],p.delete(E)):n[f]=new GS(t,l[f]);for(f=0;f<g;++f)(h=e[f])&&p.get(v[f])===h&&(o[f]=h)}function wte(t){return t.__data__}function Nte(t,e){if(!arguments.length)return Array.from(this,wte);var n=e?_te:Ete,s=this._parents,o=this._groups;typeof t!="function"&&(t=vte(t));for(var l=o.length,u=new Array(l),f=new Array(l),h=new Array(l),p=0;p<l;++p){var g=s[p],x=o[p],v=x.length,E=Ste(t.call(g,g&&g.__data__,p,s)),S=E.length,T=f[p]=new Array(S),D=u[p]=new Array(S),A=h[p]=new Array(v);n(g,x,T,D,A,E,e);for(var M=0,j=0,U,P;M<S;++M)if(U=T[M]){for(M>=j&&(j=M+1);!(P=D[j])&&++j<S;);U._next=P||null}}return u=new dl(u,s),u._enter=f,u._exit=h,u}function Ste(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dte(){return new dl(this._exit||this._groups.map(_6),this._parents)}function Ate(t,e,n){var s=this.enter(),o=this,l=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),n==null?l.remove():n(l),s&&o?s.merge(o).order():o}function Cte(t){for(var e=t.selection?t.selection():t,n=this._groups,s=e._groups,o=n.length,l=s.length,u=Math.min(o,l),f=new Array(o),h=0;h<u;++h)for(var p=n[h],g=s[h],x=p.length,v=f[h]=new Array(x),E,S=0;S<x;++S)(E=p[S]||g[S])&&(v[S]=E);for(;h<o;++h)f[h]=n[h];return new dl(f,this._parents)}function Tte(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var s=t[e],o=s.length-1,l=s[o],u;--o>=0;)(u=s[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function Rte(t){t||(t=jte);function e(x,v){return x&&v?t(x.__data__,v.__data__):!x-!v}for(var n=this._groups,s=n.length,o=new Array(s),l=0;l<s;++l){for(var u=n[l],f=u.length,h=o[l]=new Array(f),p,g=0;g<f;++g)(p=u[g])&&(h[g]=p);h.sort(e)}return new dl(o,this._parents).order()}function jte(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function kte(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Mte(){return Array.from(this)}function Vte(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],o=0,l=s.length;o<l;++o){var u=s[o];if(u)return u}return null}function Ute(){let t=0;for(const e of this)++t;return t}function Pte(){return!this.node()}function Ote(t){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var o=e[n],l=0,u=o.length,f;l<u;++l)(f=o[l])&&t.call(f,f.__data__,l,o);return this}function zte(t){return function(){this.removeAttribute(t)}}function Lte(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bte(t,e){return function(){this.setAttribute(t,e)}}function Ite(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hte(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function qte(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Fte(t,e){var n=xD(t);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((e==null?n.local?Lte:zte:typeof e=="function"?n.local?qte:Hte:n.local?Ite:Bte)(n,e))}function w6(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Gte(t){return function(){this.style.removeProperty(t)}}function Yte(t,e,n){return function(){this.style.setProperty(t,e,n)}}function $te(t,e,n){return function(){var s=e.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,n)}}function Xte(t,e,n){return arguments.length>1?this.each((e==null?Gte:typeof e=="function"?$te:Yte)(t,e,n??"")):av(this.node(),t)}function av(t,e){return t.style.getPropertyValue(e)||w6(t).getComputedStyle(t,null).getPropertyValue(e)}function Kte(t){return function(){delete this[t]}}function Wte(t,e){return function(){this[t]=e}}function Qte(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Zte(t,e){return arguments.length>1?this.each((e==null?Kte:typeof e=="function"?Qte:Wte)(t,e)):this.node()[t]}function N6(t){return t.trim().split(/^|\s+/)}function zj(t){return t.classList||new S6(t)}function S6(t){this._node=t,this._names=N6(t.getAttribute("class")||"")}S6.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function D6(t,e){for(var n=zj(t),s=-1,o=e.length;++s<o;)n.add(e[s])}function A6(t,e){for(var n=zj(t),s=-1,o=e.length;++s<o;)n.remove(e[s])}function Jte(t){return function(){D6(this,t)}}function ene(t){return function(){A6(this,t)}}function tne(t,e){return function(){(e.apply(this,arguments)?D6:A6)(this,t)}}function nne(t,e){var n=N6(t+"");if(arguments.length<2){for(var s=zj(this.node()),o=-1,l=n.length;++o<l;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?tne:e?Jte:ene)(n,e))}function rne(){this.textContent=""}function sne(t){return function(){this.textContent=t}}function ine(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function one(t){return arguments.length?this.each(t==null?rne:(typeof t=="function"?ine:sne)(t)):this.node().textContent}function ane(){this.innerHTML=""}function lne(t){return function(){this.innerHTML=t}}function une(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function cne(t){return arguments.length?this.each(t==null?ane:(typeof t=="function"?une:lne)(t)):this.node().innerHTML}function dne(){this.nextSibling&&this.parentNode.appendChild(this)}function fne(){return this.each(dne)}function hne(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mne(){return this.each(hne)}function pne(t){var e=typeof t=="function"?t:x6(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function gne(){return null}function bne(t,e){var n=typeof t=="function"?t:x6(t),s=e==null?gne:typeof e=="function"?e:Oj(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function xne(){var t=this.parentNode;t&&t.removeChild(this)}function yne(){return this.each(xne)}function vne(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ene(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _ne(t){return this.select(t?Ene:vne)}function wne(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nne(t){return function(e){t.call(this,e,this.__data__)}}function Sne(t){return t.trim().split(/^|\s+/).map(function(e){var n="",s=e.indexOf(".");return s>=0&&(n=e.slice(s+1),e=e.slice(0,s)),{type:e,name:n}})}function Dne(t){return function(){var e=this.__on;if(e){for(var n=0,s=-1,o=e.length,l;n<o;++n)l=e[n],(!t.type||l.type===t.type)&&l.name===t.name?this.removeEventListener(l.type,l.listener,l.options):e[++s]=l;++s?e.length=s:delete this.__on}}}function Ane(t,e,n){return function(){var s=this.__on,o,l=Nne(e);if(s){for(var u=0,f=s.length;u<f;++u)if((o=s[u]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=n),o.value=e;return}}this.addEventListener(t.type,l,n),o={type:t.type,name:t.name,value:e,listener:l,options:n},s?s.push(o):this.__on=[o]}}function Cne(t,e,n){var s=Sne(t+""),o,l=s.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,p=f.length,g;h<p;++h)for(o=0,g=f[h];o<l;++o)if((u=s[o]).type===g.type&&u.name===g.name)return g.value}return}for(f=e?Ane:Dne,o=0;o<l;++o)this.each(f(s[o],e,n));return this}function C6(t,e,n){var s=w6(t),o=s.CustomEvent;typeof o=="function"?o=new o(e,n):(o=s.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function Tne(t,e){return function(){return C6(this,t,e)}}function Rne(t,e){return function(){return C6(this,t,e.apply(this,arguments))}}function jne(t,e){return this.each((typeof e=="function"?Rne:Tne)(t,e))}function*kne(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var s=t[e],o=0,l=s.length,u;o<l;++o)(u=s[o])&&(yield u)}var T6=[null];function dl(t,e){this._groups=t,this._parents=e}function u_(){return new dl([[document.documentElement]],T6)}function Mne(){return this}dl.prototype=u_.prototype={constructor:dl,select:ite,selectAll:ute,selectChild:hte,selectChildren:bte,filter:xte,data:Nte,enter:yte,exit:Dte,join:Ate,merge:Cte,selection:Mne,order:Tte,sort:Rte,call:kte,nodes:Mte,node:Vte,size:Ute,empty:Pte,each:Ote,attr:Fte,style:Xte,property:Zte,classed:nne,text:one,html:cne,raise:fne,lower:mne,append:pne,insert:bne,remove:yne,clone:_ne,datum:wne,on:Cne,dispatch:jne,[Symbol.iterator]:kne};function ll(t){return typeof t=="string"?new dl([[document.querySelector(t)]],[document.documentElement]):new dl([[t]],T6)}function Vne(t){let e;for(;e=t.sourceEvent;)t=e;return t}function hc(t,e){if(t=Vne(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(e.getScreenCTM().inverse()),[s.x,s.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const Une={passive:!1},F1={capture:!0,passive:!1};function yT(t){t.stopImmediatePropagation()}function Qy(t){t.preventDefault(),t.stopImmediatePropagation()}function R6(t){var e=t.document.documentElement,n=ll(t).on("dragstart.drag",Qy,F1);"onselectstart"in e?n.on("selectstart.drag",Qy,F1):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function j6(t,e){var n=t.document.documentElement,s=ll(t).on("dragstart.drag",null);e&&(s.on("click.drag",Qy,F1),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const uS=t=>()=>t;function RR(t,{sourceEvent:e,subject:n,target:s,identifier:o,active:l,x:u,y:f,dx:h,dy:p,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:g}})}RR.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Pne(t){return!t.ctrlKey&&!t.button}function One(){return this.parentNode}function zne(t,e){return e??{x:t.x,y:t.y}}function Lne(){return navigator.maxTouchPoints||"ontouchstart"in this}function k6(){var t=Pne,e=One,n=zne,s=Lne,o={},l=bD("start","drag","end"),u=0,f,h,p,g,x=0;function v(U){U.on("mousedown.drag",E).filter(s).on("touchstart.drag",D).on("touchmove.drag",A,Une).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function E(U,P){if(!(g||!t.call(this,U,P))){var z=j(this,e.call(this,U,P),U,P,"mouse");z&&(ll(U.view).on("mousemove.drag",S,F1).on("mouseup.drag",T,F1),R6(U.view),yT(U),p=!1,f=U.clientX,h=U.clientY,z("start",U))}}function S(U){if(Qy(U),!p){var P=U.clientX-f,z=U.clientY-h;p=P*P+z*z>x}o.mouse("drag",U)}function T(U){ll(U.view).on("mousemove.drag mouseup.drag",null),j6(U.view,p),Qy(U),o.mouse("end",U)}function D(U,P){if(t.call(this,U,P)){var z=U.changedTouches,K=e.call(this,U,P),te=z.length,H,I;for(H=0;H<te;++H)(I=j(this,K,U,P,z[H].identifier,z[H]))&&(yT(U),I("start",U,z[H]))}}function A(U){var P=U.changedTouches,z=P.length,K,te;for(K=0;K<z;++K)(te=o[P[K].identifier])&&(Qy(U),te("drag",U,P[K]))}function M(U){var P=U.changedTouches,z=P.length,K,te;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),K=0;K<z;++K)(te=o[P[K].identifier])&&(yT(U),te("end",U,P[K]))}function j(U,P,z,K,te,H){var I=l.copy(),F=hc(H||z,P),$,J,X;if((X=n.call(U,new RR("beforestart",{sourceEvent:z,target:v,identifier:te,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),K))!=null)return $=X.x-F[0]||0,J=X.y-F[1]||0,function Q(L,ee,ne){var oe=F,G;switch(L){case"start":o[te]=Q,G=u++;break;case"end":delete o[te],--u;case"drag":F=hc(ne||ee,P),G=u;break}I.call(L,U,new RR(L,{sourceEvent:ee,subject:X,target:v,identifier:te,active:G,x:F[0]+$,y:F[1]+J,dx:F[0]-oe[0],dy:F[1]-oe[1],dispatch:I}),K)}}return v.filter=function(U){return arguments.length?(t=typeof U=="function"?U:uS(!!U),v):t},v.container=function(U){return arguments.length?(e=typeof U=="function"?U:uS(U),v):e},v.subject=function(U){return arguments.length?(n=typeof U=="function"?U:uS(U),v):n},v.touchable=function(U){return arguments.length?(s=typeof U=="function"?U:uS(!!U),v):s},v.on=function(){var U=l.on.apply(l,arguments);return U===l?v:U},v.clickDistance=function(U){return arguments.length?(x=(U=+U)*U,v):Math.sqrt(x)},v}function Lj(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function M6(t,e){var n=Object.create(t.prototype);for(var s in e)n[s]=e[s];return n}function c_(){}var G1=.7,YS=1/G1,Zy="\\s*([+-]?\\d+)\\s*",Y1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bne=/^#([0-9a-f]{3,8})$/,Ine=new RegExp(`^rgb\\(${Zy},${Zy},${Zy}\\)$`),Hne=new RegExp(`^rgb\\(${gd},${gd},${gd}\\)$`),qne=new RegExp(`^rgba\\(${Zy},${Zy},${Zy},${Y1}\\)$`),Fne=new RegExp(`^rgba\\(${gd},${gd},${gd},${Y1}\\)$`),Gne=new RegExp(`^hsl\\(${Y1},${gd},${gd}\\)$`),Yne=new RegExp(`^hsla\\(${Y1},${gd},${gd},${Y1}\\)$`),y3={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Lj(c_,nb,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:v3,formatHex:v3,formatHex8:$ne,formatHsl:Xne,formatRgb:E3,toString:E3});function v3(){return this.rgb().formatHex()}function $ne(){return this.rgb().formatHex8()}function Xne(){return V6(this).formatHsl()}function E3(){return this.rgb().formatRgb()}function nb(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Bne.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?_3(e):n===3?new ma(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?cS(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?cS(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ine.exec(t))?new ma(e[1],e[2],e[3],1):(e=Hne.exec(t))?new ma(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qne.exec(t))?cS(e[1],e[2],e[3],e[4]):(e=Fne.exec(t))?cS(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Gne.exec(t))?S3(e[1],e[2]/100,e[3]/100,1):(e=Yne.exec(t))?S3(e[1],e[2]/100,e[3]/100,e[4]):y3.hasOwnProperty(t)?_3(y3[t]):t==="transparent"?new ma(NaN,NaN,NaN,0):null}function _3(t){return new ma(t>>16&255,t>>8&255,t&255,1)}function cS(t,e,n,s){return s<=0&&(t=e=n=NaN),new ma(t,e,n,s)}function Kne(t){return t instanceof c_||(t=nb(t)),t?(t=t.rgb(),new ma(t.r,t.g,t.b,t.opacity)):new ma}function jR(t,e,n,s){return arguments.length===1?Kne(t):new ma(t,e,n,s??1)}function ma(t,e,n,s){this.r=+t,this.g=+e,this.b=+n,this.opacity=+s}Lj(ma,jR,M6(c_,{brighter(t){return t=t==null?YS:Math.pow(YS,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?G1:Math.pow(G1,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ma(Wg(this.r),Wg(this.g),Wg(this.b),$S(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w3,formatHex:w3,formatHex8:Wne,formatRgb:N3,toString:N3}));function w3(){return`#${Kg(this.r)}${Kg(this.g)}${Kg(this.b)}`}function Wne(){return`#${Kg(this.r)}${Kg(this.g)}${Kg(this.b)}${Kg((isNaN(this.opacity)?1:this.opacity)*255)}`}function N3(){const t=$S(this.opacity);return`${t===1?"rgb(":"rgba("}${Wg(this.r)}, ${Wg(this.g)}, ${Wg(this.b)}${t===1?")":`, ${t})`}`}function $S(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Wg(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Kg(t){return t=Wg(t),(t<16?"0":"")+t.toString(16)}function S3(t,e,n,s){return s<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new pc(t,e,n,s)}function V6(t){if(t instanceof pc)return new pc(t.h,t.s,t.l,t.opacity);if(t instanceof c_||(t=nb(t)),!t)return new pc;if(t instanceof pc)return t;t=t.rgb();var e=t.r/255,n=t.g/255,s=t.b/255,o=Math.min(e,n,s),l=Math.max(e,n,s),u=NaN,f=l-o,h=(l+o)/2;return f?(e===l?u=(n-s)/f+(n<s)*6:n===l?u=(s-e)/f+2:u=(e-n)/f+4,f/=h<.5?l+o:2-l-o,u*=60):f=h>0&&h<1?0:u,new pc(u,f,h,t.opacity)}function Qne(t,e,n,s){return arguments.length===1?V6(t):new pc(t,e,n,s??1)}function pc(t,e,n,s){this.h=+t,this.s=+e,this.l=+n,this.opacity=+s}Lj(pc,Qne,M6(c_,{brighter(t){return t=t==null?YS:Math.pow(YS,t),new pc(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?G1:Math.pow(G1,t),new pc(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*e,o=2*n-s;return new ma(vT(t>=240?t-240:t+120,o,s),vT(t,o,s),vT(t<120?t+240:t-120,o,s),this.opacity)},clamp(){return new pc(D3(this.h),dS(this.s),dS(this.l),$S(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=$S(this.opacity);return`${t===1?"hsl(":"hsla("}${D3(this.h)}, ${dS(this.s)*100}%, ${dS(this.l)*100}%${t===1?")":`, ${t})`}`}}));function D3(t){return t=(t||0)%360,t<0?t+360:t}function dS(t){return Math.max(0,Math.min(1,t||0))}function vT(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Bj=t=>()=>t;function Zne(t,e){return function(n){return t+n*e}}function Jne(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(s){return Math.pow(t+s*e,n)}}function ere(t){return(t=+t)==1?U6:function(e,n){return n-e?Jne(e,n,t):Bj(isNaN(e)?n:e)}}function U6(t,e){var n=e-t;return n?Zne(t,n):Bj(isNaN(t)?e:t)}const XS=(function t(e){var n=ere(e);function s(o,l){var u=n((o=jR(o)).r,(l=jR(l)).r),f=n(o.g,l.g),h=n(o.b,l.b),p=U6(o.opacity,l.opacity);return function(g){return o.r=u(g),o.g=f(g),o.b=h(g),o.opacity=p(g),o+""}}return s.gamma=t,s})(1);function tre(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,s=e.slice(),o;return function(l){for(o=0;o<n;++o)s[o]=t[o]*(1-l)+e[o]*l;return s}}function nre(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function rre(t,e){var n=e?e.length:0,s=t?Math.min(n,t.length):0,o=new Array(s),l=new Array(n),u;for(u=0;u<s;++u)o[u]=M1(t[u],e[u]);for(;u<n;++u)l[u]=e[u];return function(f){for(u=0;u<s;++u)l[u]=o[u](f);return l}}function sre(t,e){var n=new Date;return t=+t,e=+e,function(s){return n.setTime(t*(1-s)+e*s),n}}function hd(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ire(t,e){var n={},s={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?n[o]=M1(t[o],e[o]):s[o]=e[o];return function(l){for(o in n)s[o]=n[o](l);return s}}var kR=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ET=new RegExp(kR.source,"g");function ore(t){return function(){return t}}function are(t){return function(e){return t(e)+""}}function P6(t,e){var n=kR.lastIndex=ET.lastIndex=0,s,o,l,u=-1,f=[],h=[];for(t=t+"",e=e+"";(s=kR.exec(t))&&(o=ET.exec(e));)(l=o.index)>n&&(l=e.slice(n,l),f[u]?f[u]+=l:f[++u]=l),(s=s[0])===(o=o[0])?f[u]?f[u]+=o:f[++u]=o:(f[++u]=null,h.push({i:u,x:hd(s,o)})),n=ET.lastIndex;return n<e.length&&(l=e.slice(n),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?are(h[0].x):ore(e):(e=h.length,function(p){for(var g=0,x;g<e;++g)f[(x=h[g]).i]=x.x(p);return f.join("")})}function M1(t,e){var n=typeof e,s;return e==null||n==="boolean"?Bj(e):(n==="number"?hd:n==="string"?(s=nb(e))?(e=s,XS):P6:e instanceof nb?XS:e instanceof Date?sre:nre(e)?tre:Array.isArray(e)?rre:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ire:hd)(t,e)}var A3=180/Math.PI,MR={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function O6(t,e,n,s,o,l){var u,f,h;return(u=Math.sqrt(t*t+e*e))&&(t/=u,e/=u),(h=t*n+e*s)&&(n-=t*h,s-=e*h),(f=Math.sqrt(n*n+s*s))&&(n/=f,s/=f,h/=f),t*s<e*n&&(t=-t,e=-e,h=-h,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(e,t)*A3,skewX:Math.atan(h)*A3,scaleX:u,scaleY:f}}var fS;function lre(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?MR:O6(e.a,e.b,e.c,e.d,e.e,e.f)}function ure(t){return t==null||(fS||(fS=document.createElementNS("http://www.w3.org/2000/svg","g")),fS.setAttribute("transform",t),!(t=fS.transform.baseVal.consolidate()))?MR:(t=t.matrix,O6(t.a,t.b,t.c,t.d,t.e,t.f))}function z6(t,e,n,s){function o(p){return p.length?p.pop()+" ":""}function l(p,g,x,v,E,S){if(p!==x||g!==v){var T=E.push("translate(",null,e,null,n);S.push({i:T-4,x:hd(p,x)},{i:T-2,x:hd(g,v)})}else(x||v)&&E.push("translate("+x+e+v+n)}function u(p,g,x,v){p!==g?(p-g>180?g+=360:g-p>180&&(p+=360),v.push({i:x.push(o(x)+"rotate(",null,s)-2,x:hd(p,g)})):g&&x.push(o(x)+"rotate("+g+s)}function f(p,g,x,v){p!==g?v.push({i:x.push(o(x)+"skewX(",null,s)-2,x:hd(p,g)}):g&&x.push(o(x)+"skewX("+g+s)}function h(p,g,x,v,E,S){if(p!==x||g!==v){var T=E.push(o(E)+"scale(",null,",",null,")");S.push({i:T-4,x:hd(p,x)},{i:T-2,x:hd(g,v)})}else(x!==1||v!==1)&&E.push(o(E)+"scale("+x+","+v+")")}return function(p,g){var x=[],v=[];return p=t(p),g=t(g),l(p.translateX,p.translateY,g.translateX,g.translateY,x,v),u(p.rotate,g.rotate,x,v),f(p.skewX,g.skewX,x,v),h(p.scaleX,p.scaleY,g.scaleX,g.scaleY,x,v),p=g=null,function(E){for(var S=-1,T=v.length,D;++S<T;)x[(D=v[S]).i]=D.x(E);return x.join("")}}}var cre=z6(lre,"px, ","px)","deg)"),dre=z6(ure,", ",")",")"),fre=1e-12;function C3(t){return((t=Math.exp(t))+1/t)/2}function hre(t){return((t=Math.exp(t))-1/t)/2}function mre(t){return((t=Math.exp(2*t))-1)/(t+1)}const SS=(function t(e,n,s){function o(l,u){var f=l[0],h=l[1],p=l[2],g=u[0],x=u[1],v=u[2],E=g-f,S=x-h,T=E*E+S*S,D,A;if(T<fre)A=Math.log(v/p)/e,D=function(K){return[f+K*E,h+K*S,p*Math.exp(e*K*A)]};else{var M=Math.sqrt(T),j=(v*v-p*p+s*T)/(2*p*n*M),U=(v*v-p*p-s*T)/(2*v*n*M),P=Math.log(Math.sqrt(j*j+1)-j),z=Math.log(Math.sqrt(U*U+1)-U);A=(z-P)/e,D=function(K){var te=K*A,H=C3(P),I=p/(n*M)*(H*mre(e*te+P)-hre(P));return[f+I*E,h+I*S,p*H/C3(e*te+P)]}}return D.duration=A*1e3*e/Math.SQRT2,D}return o.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return t(u,f,h)},o})(Math.SQRT2,2,4);var lv=0,E1=0,m1=0,L6=1e3,KS,_1,WS=0,rb=0,yD=0,$1=typeof performance=="object"&&performance.now?performance:Date,B6=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ij(){return rb||(B6(pre),rb=$1.now()+yD)}function pre(){rb=0}function QS(){this._call=this._time=this._next=null}QS.prototype=I6.prototype={constructor:QS,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ij():+n)+(e==null?0:+e),!this._next&&_1!==this&&(_1?_1._next=this:KS=this,_1=this),this._call=t,this._time=n,VR()},stop:function(){this._call&&(this._call=null,this._time=1/0,VR())}};function I6(t,e,n){var s=new QS;return s.restart(t,e,n),s}function gre(){Ij(),++lv;for(var t=KS,e;t;)(e=rb-t._time)>=0&&t._call.call(void 0,e),t=t._next;--lv}function T3(){rb=(WS=$1.now())+yD,lv=E1=0;try{gre()}finally{lv=0,xre(),rb=0}}function bre(){var t=$1.now(),e=t-WS;e>L6&&(yD-=e,WS=t)}function xre(){for(var t,e=KS,n,s=1/0;e;)e._call?(s>e._time&&(s=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:KS=n);_1=t,VR(s)}function VR(t){if(!lv){E1&&(E1=clearTimeout(E1));var e=t-rb;e>24?(t<1/0&&(E1=setTimeout(T3,t-$1.now()-yD)),m1&&(m1=clearInterval(m1))):(m1||(WS=$1.now(),m1=setInterval(bre,L6)),lv=1,B6(T3))}}function R3(t,e,n){var s=new QS;return e=e==null?0:+e,s.restart(o=>{s.stop(),t(o+e)},e,n),s}var yre=bD("start","end","cancel","interrupt"),vre=[],H6=0,j3=1,UR=2,DS=3,k3=4,PR=5,AS=6;function vD(t,e,n,s,o,l){var u=t.__transition;if(!u)t.__transition={};else if(n in u)return;Ere(t,n,{name:e,index:s,group:o,on:yre,tween:vre,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:H6})}function Hj(t,e){var n=Sc(t,e);if(n.state>H6)throw new Error("too late; already scheduled");return n}function yd(t,e){var n=Sc(t,e);if(n.state>DS)throw new Error("too late; already running");return n}function Sc(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ere(t,e,n){var s=t.__transition,o;s[e]=n,n.timer=I6(l,0,n.time);function l(p){n.state=j3,n.timer.restart(u,n.delay,n.time),n.delay<=p&&u(p-n.delay)}function u(p){var g,x,v,E;if(n.state!==j3)return h();for(g in s)if(E=s[g],E.name===n.name){if(E.state===DS)return R3(u);E.state===k3?(E.state=AS,E.timer.stop(),E.on.call("interrupt",t,t.__data__,E.index,E.group),delete s[g]):+g<e&&(E.state=AS,E.timer.stop(),E.on.call("cancel",t,t.__data__,E.index,E.group),delete s[g])}if(R3(function(){n.state===DS&&(n.state=k3,n.timer.restart(f,n.delay,n.time),f(p))}),n.state=UR,n.on.call("start",t,t.__data__,n.index,n.group),n.state===UR){for(n.state=DS,o=new Array(v=n.tween.length),g=0,x=-1;g<v;++g)(E=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(o[++x]=E);o.length=x+1}}function f(p){for(var g=p<n.duration?n.ease.call(null,p/n.duration):(n.timer.restart(h),n.state=PR,1),x=-1,v=o.length;++x<v;)o[x].call(t,g);n.state===PR&&(n.on.call("end",t,t.__data__,n.index,n.group),h())}function h(){n.state=AS,n.timer.stop(),delete s[e];for(var p in s)return;delete t.__transition}}function CS(t,e){var n=t.__transition,s,o,l=!0,u;if(n){e=e==null?null:e+"";for(u in n){if((s=n[u]).name!==e){l=!1;continue}o=s.state>UR&&s.state<PR,s.state=AS,s.timer.stop(),s.on.call(o?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete n[u]}l&&delete t.__transition}}function _re(t){return this.each(function(){CS(this,t)})}function wre(t,e){var n,s;return function(){var o=yd(this,t),l=o.tween;if(l!==n){s=n=l;for(var u=0,f=s.length;u<f;++u)if(s[u].name===e){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function Nre(t,e,n){var s,o;if(typeof n!="function")throw new Error;return function(){var l=yd(this,t),u=l.tween;if(u!==s){o=(s=u).slice();for(var f={name:e,value:n},h=0,p=o.length;h<p;++h)if(o[h].name===e){o[h]=f;break}h===p&&o.push(f)}l.tween=o}}function Sre(t,e){var n=this._id;if(t+="",arguments.length<2){for(var s=Sc(this.node(),n).tween,o=0,l=s.length,u;o<l;++o)if((u=s[o]).name===t)return u.value;return null}return this.each((e==null?wre:Nre)(n,t,e))}function qj(t,e,n){var s=t._id;return t.each(function(){var o=yd(this,s);(o.value||(o.value={}))[e]=n.apply(this,arguments)}),function(o){return Sc(o,s).value[e]}}function q6(t,e){var n;return(typeof e=="number"?hd:e instanceof nb?XS:(n=nb(e))?(e=n,XS):P6)(t,e)}function Dre(t){return function(){this.removeAttribute(t)}}function Are(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Cre(t,e,n){var s,o=n+"",l;return function(){var u=this.getAttribute(t);return u===o?null:u===s?l:l=e(s=u,n)}}function Tre(t,e,n){var s,o=n+"",l;return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===s?l:l=e(s=u,n)}}function Rre(t,e,n){var s,o,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttribute(t):(u=this.getAttribute(t),h=f+"",u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f)))}}function jre(t,e,n){var s,o,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),h=f+"",u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f)))}}function kre(t,e){var n=xD(t),s=n==="transform"?dre:q6;return this.attrTween(t,typeof e=="function"?(n.local?jre:Rre)(n,s,qj(this,"attr."+t,e)):e==null?(n.local?Are:Dre)(n):(n.local?Tre:Cre)(n,s,e))}function Mre(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Vre(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ure(t,e){var n,s;function o(){var l=e.apply(this,arguments);return l!==s&&(n=(s=l)&&Vre(t,l)),n}return o._value=e,o}function Pre(t,e){var n,s;function o(){var l=e.apply(this,arguments);return l!==s&&(n=(s=l)&&Mre(t,l)),n}return o._value=e,o}function Ore(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var s=xD(t);return this.tween(n,(s.local?Ure:Pre)(s,e))}function zre(t,e){return function(){Hj(this,t).delay=+e.apply(this,arguments)}}function Lre(t,e){return e=+e,function(){Hj(this,t).delay=e}}function Bre(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zre:Lre)(e,t)):Sc(this.node(),e).delay}function Ire(t,e){return function(){yd(this,t).duration=+e.apply(this,arguments)}}function Hre(t,e){return e=+e,function(){yd(this,t).duration=e}}function qre(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ire:Hre)(e,t)):Sc(this.node(),e).duration}function Fre(t,e){if(typeof e!="function")throw new Error;return function(){yd(this,t).ease=e}}function Gre(t){var e=this._id;return arguments.length?this.each(Fre(e,t)):Sc(this.node(),e).ease}function Yre(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;yd(this,t).ease=n}}function $re(t){if(typeof t!="function")throw new Error;return this.each(Yre(this._id,t))}function Xre(t){typeof t!="function"&&(t=v6(t));for(var e=this._groups,n=e.length,s=new Array(n),o=0;o<n;++o)for(var l=e[o],u=l.length,f=s[o]=[],h,p=0;p<u;++p)(h=l[p])&&t.call(h,h.__data__,p,l)&&f.push(h);return new Zf(s,this._parents,this._name,this._id)}function Kre(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,s=e.length,o=n.length,l=Math.min(s,o),u=new Array(s),f=0;f<l;++f)for(var h=e[f],p=n[f],g=h.length,x=u[f]=new Array(g),v,E=0;E<g;++E)(v=h[E]||p[E])&&(x[E]=v);for(;f<s;++f)u[f]=e[f];return new Zf(u,this._parents,this._name,this._id)}function Wre(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Qre(t,e,n){var s,o,l=Wre(e)?Hj:yd;return function(){var u=l(this,t),f=u.on;f!==s&&(o=(s=f).copy()).on(e,n),u.on=o}}function Zre(t,e){var n=this._id;return arguments.length<2?Sc(this.node(),n).on.on(t):this.each(Qre(n,t,e))}function Jre(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ese(){return this.on("end.remove",Jre(this._id))}function tse(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Oj(t));for(var s=this._groups,o=s.length,l=new Array(o),u=0;u<o;++u)for(var f=s[u],h=f.length,p=l[u]=new Array(h),g,x,v=0;v<h;++v)(g=f[v])&&(x=t.call(g,g.__data__,v,f))&&("__data__"in g&&(x.__data__=g.__data__),p[v]=x,vD(p[v],e,n,v,p,Sc(g,n)));return new Zf(l,this._parents,e,n)}function nse(t){var e=this._name,n=this._id;typeof t!="function"&&(t=y6(t));for(var s=this._groups,o=s.length,l=[],u=[],f=0;f<o;++f)for(var h=s[f],p=h.length,g,x=0;x<p;++x)if(g=h[x]){for(var v=t.call(g,g.__data__,x,h),E,S=Sc(g,n),T=0,D=v.length;T<D;++T)(E=v[T])&&vD(E,e,n,T,v,S);l.push(v),u.push(g)}return new Zf(l,u,e,n)}var rse=u_.prototype.constructor;function sse(){return new rse(this._groups,this._parents)}function ise(t,e){var n,s,o;return function(){var l=av(this,t),u=(this.style.removeProperty(t),av(this,t));return l===u?null:l===n&&u===s?o:o=e(n=l,s=u)}}function F6(t){return function(){this.style.removeProperty(t)}}function ose(t,e,n){var s,o=n+"",l;return function(){var u=av(this,t);return u===o?null:u===s?l:l=e(s=u,n)}}function ase(t,e,n){var s,o,l;return function(){var u=av(this,t),f=n(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(t),av(this,t))),u===h?null:u===s&&h===o?l:(o=h,l=e(s=u,f))}}function lse(t,e){var n,s,o,l="style."+e,u="end."+l,f;return function(){var h=yd(this,t),p=h.on,g=h.value[l]==null?f||(f=F6(e)):void 0;(p!==n||o!==g)&&(s=(n=p).copy()).on(u,o=g),h.on=s}}function use(t,e,n){var s=(t+="")=="transform"?cre:q6;return e==null?this.styleTween(t,ise(t,s)).on("end.style."+t,F6(t)):typeof e=="function"?this.styleTween(t,ase(t,s,qj(this,"style."+t,e))).each(lse(this._id,t)):this.styleTween(t,ose(t,s,e),n).on("end.style."+t,null)}function cse(t,e,n){return function(s){this.style.setProperty(t,e.call(this,s),n)}}function dse(t,e,n){var s,o;function l(){var u=e.apply(this,arguments);return u!==o&&(s=(o=u)&&cse(t,u,n)),s}return l._value=e,l}function fse(t,e,n){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(e==null)return this.tween(s,null);if(typeof e!="function")throw new Error;return this.tween(s,dse(t,e,n??""))}function hse(t){return function(){this.textContent=t}}function mse(t){return function(){var e=t(this);this.textContent=e??""}}function pse(t){return this.tween("text",typeof t=="function"?mse(qj(this,"text",t)):hse(t==null?"":t+""))}function gse(t){return function(e){this.textContent=t.call(this,e)}}function bse(t){var e,n;function s(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&gse(o)),e}return s._value=t,s}function xse(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,bse(t))}function yse(){for(var t=this._name,e=this._id,n=G6(),s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],f=u.length,h,p=0;p<f;++p)if(h=u[p]){var g=Sc(h,e);vD(h,t,n,p,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Zf(s,this._parents,t,n)}function vse(){var t,e,n=this,s=n._id,o=n.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--o===0&&l()}};n.each(function(){var p=yd(this,s),g=p.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(f),e._.interrupt.push(f),e._.end.push(h)),p.on=e}),o===0&&l()})}var Ese=0;function Zf(t,e,n,s){this._groups=t,this._parents=e,this._name=n,this._id=s}function G6(){return++Ese}var Hf=u_.prototype;Zf.prototype={constructor:Zf,select:tse,selectAll:nse,selectChild:Hf.selectChild,selectChildren:Hf.selectChildren,filter:Xre,merge:Kre,selection:sse,transition:yse,call:Hf.call,nodes:Hf.nodes,node:Hf.node,size:Hf.size,empty:Hf.empty,each:Hf.each,on:Zre,attr:kre,attrTween:Ore,style:use,styleTween:fse,text:pse,textTween:xse,remove:ese,tween:Sre,delay:Bre,duration:qre,ease:Gre,easeVarying:$re,end:vse,[Symbol.iterator]:Hf[Symbol.iterator]};function _se(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var wse={time:null,delay:0,duration:250,ease:_se};function Nse(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Sse(t){var e,n;t instanceof Zf?(e=t._id,t=t._name):(e=G6(),(n=wse).time=Ij(),t=t==null?null:t+"");for(var s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],f=u.length,h,p=0;p<f;++p)(h=u[p])&&vD(h,t,e,p,u,n||Nse(h,e));return new Zf(s,this._parents,t,e)}u_.prototype.interrupt=_re;u_.prototype.transition=Sse;const hS=t=>()=>t;function Dse(t,{sourceEvent:e,target:n,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Yf(t,e,n){this.k=t,this.x=e,this.y=n}Yf.prototype={constructor:Yf,scale:function(t){return t===1?this:new Yf(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Yf(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ED=new Yf(1,0,0);Y6.prototype=Yf.prototype;function Y6(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ED;return t.__zoom}function _T(t){t.stopImmediatePropagation()}function p1(t){t.preventDefault(),t.stopImmediatePropagation()}function Ase(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Cse(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function M3(){return this.__zoom||ED}function Tse(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Rse(){return navigator.maxTouchPoints||"ontouchstart"in this}function jse(t,e,n){var s=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],l=t.invertY(e[0][1])-n[0][1],u=t.invertY(e[1][1])-n[1][1];return t.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function $6(){var t=Ase,e=Cse,n=jse,s=Tse,o=Rse,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=SS,p=bD("start","zoom","end"),g,x,v,E=500,S=150,T=0,D=10;function A(X){X.property("__zoom",M3).on("wheel.zoom",te,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(X,Q,L,ee){var ne=X.selection?X.selection():X;ne.property("__zoom",M3),X!==ne?P(X,Q,L,ee):ne.interrupt().each(function(){z(this,arguments).event(ee).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},A.scaleBy=function(X,Q,L,ee){A.scaleTo(X,function(){var ne=this.__zoom.k,oe=typeof Q=="function"?Q.apply(this,arguments):Q;return ne*oe},L,ee)},A.scaleTo=function(X,Q,L,ee){A.transform(X,function(){var ne=e.apply(this,arguments),oe=this.__zoom,G=L==null?U(ne):typeof L=="function"?L.apply(this,arguments):L,B=oe.invert(G),ae=typeof Q=="function"?Q.apply(this,arguments):Q;return n(j(M(oe,ae),G,B),ne,u)},L,ee)},A.translateBy=function(X,Q,L,ee){A.transform(X,function(){return n(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof L=="function"?L.apply(this,arguments):L),e.apply(this,arguments),u)},null,ee)},A.translateTo=function(X,Q,L,ee,ne){A.transform(X,function(){var oe=e.apply(this,arguments),G=this.__zoom,B=ee==null?U(oe):typeof ee=="function"?ee.apply(this,arguments):ee;return n(ED.translate(B[0],B[1]).scale(G.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof L=="function"?-L.apply(this,arguments):-L),oe,u)},ee,ne)};function M(X,Q){return Q=Math.max(l[0],Math.min(l[1],Q)),Q===X.k?X:new Yf(Q,X.x,X.y)}function j(X,Q,L){var ee=Q[0]-L[0]*X.k,ne=Q[1]-L[1]*X.k;return ee===X.x&&ne===X.y?X:new Yf(X.k,ee,ne)}function U(X){return[(+X[0][0]+ +X[1][0])/2,(+X[0][1]+ +X[1][1])/2]}function P(X,Q,L,ee){X.on("start.zoom",function(){z(this,arguments).event(ee).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(ee).end()}).tween("zoom",function(){var ne=this,oe=arguments,G=z(ne,oe).event(ee),B=e.apply(ne,oe),ae=L==null?U(B):typeof L=="function"?L.apply(ne,oe):L,Z=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),be=ne.__zoom,Ve=typeof Q=="function"?Q.apply(ne,oe):Q,he=h(be.invert(ae).concat(Z/be.k),Ve.invert(ae).concat(Z/Ve.k));return function(Ne){if(Ne===1)Ne=Ve;else{var De=he(Ne),me=Z/De[2];Ne=new Yf(me,ae[0]-De[0]*me,ae[1]-De[1]*me)}G.zoom(null,Ne)}})}function z(X,Q,L){return!L&&X.__zooming||new K(X,Q)}function K(X,Q){this.that=X,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=e.apply(X,Q),this.taps=0}K.prototype={event:function(X){return X&&(this.sourceEvent=X),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(X,Q){return this.mouse&&X!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&X!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&X!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(X){var Q=ll(this.that).datum();p.call(X,this.that,new Dse(X,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:p}),Q)}};function te(X,...Q){if(!t.apply(this,arguments))return;var L=z(this,Q).event(X),ee=this.__zoom,ne=Math.max(l[0],Math.min(l[1],ee.k*Math.pow(2,s.apply(this,arguments)))),oe=hc(X);if(L.wheel)(L.mouse[0][0]!==oe[0]||L.mouse[0][1]!==oe[1])&&(L.mouse[1]=ee.invert(L.mouse[0]=oe)),clearTimeout(L.wheel);else{if(ee.k===ne)return;L.mouse=[oe,ee.invert(oe)],CS(this),L.start()}p1(X),L.wheel=setTimeout(G,S),L.zoom("mouse",n(j(M(ee,ne),L.mouse[0],L.mouse[1]),L.extent,u));function G(){L.wheel=null,L.end()}}function H(X,...Q){if(v||!t.apply(this,arguments))return;var L=X.currentTarget,ee=z(this,Q,!0).event(X),ne=ll(X.view).on("mousemove.zoom",ae,!0).on("mouseup.zoom",Z,!0),oe=hc(X,L),G=X.clientX,B=X.clientY;R6(X.view),_T(X),ee.mouse=[oe,this.__zoom.invert(oe)],CS(this),ee.start();function ae(be){if(p1(be),!ee.moved){var Ve=be.clientX-G,he=be.clientY-B;ee.moved=Ve*Ve+he*he>T}ee.event(be).zoom("mouse",n(j(ee.that.__zoom,ee.mouse[0]=hc(be,L),ee.mouse[1]),ee.extent,u))}function Z(be){ne.on("mousemove.zoom mouseup.zoom",null),j6(be.view,ee.moved),p1(be),ee.event(be).end()}}function I(X,...Q){if(t.apply(this,arguments)){var L=this.__zoom,ee=hc(X.changedTouches?X.changedTouches[0]:X,this),ne=L.invert(ee),oe=L.k*(X.shiftKey?.5:2),G=n(j(M(L,oe),ee,ne),e.apply(this,Q),u);p1(X),f>0?ll(this).transition().duration(f).call(P,G,ee,X):ll(this).call(A.transform,G,ee,X)}}function F(X,...Q){if(t.apply(this,arguments)){var L=X.touches,ee=L.length,ne=z(this,Q,X.changedTouches.length===ee).event(X),oe,G,B,ae;for(_T(X),G=0;G<ee;++G)B=L[G],ae=hc(B,this),ae=[ae,this.__zoom.invert(ae),B.identifier],ne.touch0?!ne.touch1&&ne.touch0[2]!==ae[2]&&(ne.touch1=ae,ne.taps=0):(ne.touch0=ae,oe=!0,ne.taps=1+!!g);g&&(g=clearTimeout(g)),oe&&(ne.taps<2&&(x=ae[0],g=setTimeout(function(){g=null},E)),CS(this),ne.start())}}function $(X,...Q){if(this.__zooming){var L=z(this,Q).event(X),ee=X.changedTouches,ne=ee.length,oe,G,B,ae;for(p1(X),oe=0;oe<ne;++oe)G=ee[oe],B=hc(G,this),L.touch0&&L.touch0[2]===G.identifier?L.touch0[0]=B:L.touch1&&L.touch1[2]===G.identifier&&(L.touch1[0]=B);if(G=L.that.__zoom,L.touch1){var Z=L.touch0[0],be=L.touch0[1],Ve=L.touch1[0],he=L.touch1[1],Ne=(Ne=Ve[0]-Z[0])*Ne+(Ne=Ve[1]-Z[1])*Ne,De=(De=he[0]-be[0])*De+(De=he[1]-be[1])*De;G=M(G,Math.sqrt(Ne/De)),B=[(Z[0]+Ve[0])/2,(Z[1]+Ve[1])/2],ae=[(be[0]+he[0])/2,(be[1]+he[1])/2]}else if(L.touch0)B=L.touch0[0],ae=L.touch0[1];else return;L.zoom("touch",n(j(G,B,ae),L.extent,u))}}function J(X,...Q){if(this.__zooming){var L=z(this,Q).event(X),ee=X.changedTouches,ne=ee.length,oe,G;for(_T(X),v&&clearTimeout(v),v=setTimeout(function(){v=null},E),oe=0;oe<ne;++oe)G=ee[oe],L.touch0&&L.touch0[2]===G.identifier?delete L.touch0:L.touch1&&L.touch1[2]===G.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(G=hc(G,this),Math.hypot(x[0]-G[0],x[1]-G[1])<D)){var B=ll(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return A.wheelDelta=function(X){return arguments.length?(s=typeof X=="function"?X:hS(+X),A):s},A.filter=function(X){return arguments.length?(t=typeof X=="function"?X:hS(!!X),A):t},A.touchable=function(X){return arguments.length?(o=typeof X=="function"?X:hS(!!X),A):o},A.extent=function(X){return arguments.length?(e=typeof X=="function"?X:hS([[+X[0][0],+X[0][1]],[+X[1][0],+X[1][1]]]),A):e},A.scaleExtent=function(X){return arguments.length?(l[0]=+X[0],l[1]=+X[1],A):[l[0],l[1]]},A.translateExtent=function(X){return arguments.length?(u[0][0]=+X[0][0],u[1][0]=+X[1][0],u[0][1]=+X[0][1],u[1][1]=+X[1][1],A):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},A.constrain=function(X){return arguments.length?(n=X,A):n},A.duration=function(X){return arguments.length?(f=+X,A):f},A.interpolate=function(X){return arguments.length?(h=X,A):h},A.on=function(){var X=p.on.apply(p,arguments);return X===p?A:X},A.clickDistance=function(X){return arguments.length?(T=(X=+X)*X,A):Math.sqrt(T)},A.tapDistance=function(X){return arguments.length?(D=+X,A):D},A}const fl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:s}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},X1=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],X6=["Enter"," ","Escape"],K6={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var uv;(function(t){t.Strict="strict",t.Loose="loose"})(uv||(uv={}));var Qg;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Qg||(Qg={}));var K1;(function(t){t.Partial="partial",t.Full="full"})(K1||(K1={}));const W6={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var jm;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(jm||(jm={}));var W1;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(W1||(W1={}));var Dt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Dt||(Dt={}));const V3={[Dt.Left]:Dt.Right,[Dt.Right]:Dt.Left,[Dt.Top]:Dt.Bottom,[Dt.Bottom]:Dt.Top};function Q6(t){return t===null?null:t?"valid":"invalid"}const Z6=t=>"id"in t&&"source"in t&&"target"in t,kse=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Fj=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),d_=(t,e=[0,0])=>{const{width:n,height:s}=nh(t),o=t.origin??e,l=n*o[0],u=s*o[1];return{x:t.position.x-l,y:t.position.y-u}},Mse=(t,e={nodeOrigin:[0,0]})=>{if(e.nodeLookup||console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((s,o)=>{const l=typeof o=="string";let u=!e.nodeLookup&&!l?o:void 0;e.nodeLookup&&(u=l?e.nodeLookup.get(o):Fj(o)?o:e.nodeLookup.get(o.id));const f=u?ZS(u,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return _D(s,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wD(n)},f_=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(o=>{(e.filter===void 0||e.filter(o))&&(n=_D(n,ZS(o)),s=!0)}),s?wD(n):{x:0,y:0,width:0,height:0}},Gj=(t,e,[n,s,o]=[0,0,1],l=!1,u=!1)=>{const f={...m_(e,[n,s,o]),width:e.width/o,height:e.height/o},h=[];for(const p of t.values()){const{measured:g,selectable:x=!0,hidden:v=!1}=p;if(u&&!x||v)continue;const E=g.width??p.width??p.initialWidth??null,S=g.height??p.height??p.initialHeight??null,T=Q1(f,dv(p)),D=(E??0)*(S??0),A=l&&T>0;(!p.internals.handleBounds||A||T>=D||p.dragging)&&h.push(p)}return h},Vse=(t,e)=>{const n=new Set;return t.forEach(s=>{n.add(s.id)}),e.filter(s=>n.has(s.source)||n.has(s.target))};function Use(t,e){const n=new Map,s=e!=null&&e.nodes?new Set(e.nodes.map(o=>o.id)):null;return t.forEach(o=>{o.measured.width&&o.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function Pse({nodes:t,width:e,height:n,panZoom:s,minZoom:o,maxZoom:l},u){if(t.size===0)return Promise.resolve(!0);const f=Use(t,u),h=f_(f),p=Yj(h,e,n,(u==null?void 0:u.minZoom)??o,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await s.setViewport(p,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function J6({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,onError:l}){const u=n.get(t),f=u.parentId?n.get(u.parentId):void 0,{x:h,y:p}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??s;let x=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!f)l==null||l("005",fl.error005());else{const E=f.measured.width,S=f.measured.height;E&&S&&(x=[[h,p],[h+E,p+S]])}else f&&fv(u.extent)&&(x=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const v=fv(x)?sb(e,x,u.measured):e;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",fl.error015())),{position:{x:v.x-h+(u.measured.width??0)*g[0],y:v.y-p+(u.measured.height??0)*g[1]},positionAbsolute:v}}async function Ose({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:s,onBeforeDelete:o}){const l=new Set(t.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const E=l.has(v.id),S=!E&&v.parentId&&u.find(T=>T.id===v.parentId);(E||S)&&u.push(v)}const f=new Set(e.map(v=>v.id)),h=s.filter(v=>v.deletable!==!1),g=Vse(u,h);for(const v of h)f.has(v.id)&&!g.find(S=>S.id===v.id)&&g.push(v);if(!o)return{edges:g,nodes:u};const x=await o({nodes:u,edges:g});return typeof x=="boolean"?x?{edges:g,nodes:u}:{edges:[],nodes:[]}:x}const cv=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),sb=(t={x:0,y:0},e,n)=>({x:cv(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:cv(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function ez(t,e,n){const{width:s,height:o}=nh(n),{x:l,y:u}=n.internals.positionAbsolute;return sb(t,[[l,u],[l+s,u+o]],e)}const U3=(t,e,n)=>t<e?cv(Math.abs(t-e),1,e)/e:t>n?-cv(Math.abs(t-n),1,e)/e:0,tz=(t,e,n=15,s=40)=>{const o=U3(t.x,s,e.width-s)*n,l=U3(t.y,s,e.height-s)*n;return[o,l]},_D=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),OR=({x:t,y:e,width:n,height:s})=>({x:t,y:e,x2:t+n,y2:e+s}),wD=({x:t,y:e,x2:n,y2:s})=>({x:t,y:e,width:n-t,height:s-e}),dv=(t,e=[0,0])=>{var o,l;const{x:n,y:s}=Fj(t)?t.internals.positionAbsolute:d_(t,e);return{x:n,y:s,width:((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0,height:((l=t.measured)==null?void 0:l.height)??t.height??t.initialHeight??0}},ZS=(t,e=[0,0])=>{var o,l;const{x:n,y:s}=Fj(t)?t.internals.positionAbsolute:d_(t,e);return{x:n,y:s,x2:n+(((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0),y2:s+(((l=t.measured)==null?void 0:l.height)??t.height??t.initialHeight??0)}},nz=(t,e)=>wD(_D(OR(t),OR(e))),Q1=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),s=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*s)},P3=t=>gc(t.width)&&gc(t.height)&&gc(t.x)&&gc(t.y),gc=t=>!isNaN(t)&&isFinite(t),rz=(t,e)=>{console.warn(`[React Flow]: ${e} Help: https://reactflow.dev/error#${t}`)},h_=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),m_=({x:t,y:e},[n,s,o],l=!1,u=[1,1])=>{const f={x:(t-n)/o,y:(e-s)/o};return l?h_(f,u):f},JS=({x:t,y:e},[n,s,o])=>({x:t*o+n,y:e*o+s});function Uy(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function zse(t,e,n){if(typeof t=="string"||typeof t=="number"){const s=Uy(t,n),o=Uy(t,e);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof t=="object"){const s=Uy(t.top??t.y??0,n),o=Uy(t.bottom??t.y??0,n),l=Uy(t.left??t.x??0,e),u=Uy(t.right??t.x??0,e);return{top:s,right:u,bottom:o,left:l,x:l+u,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Lse(t,e,n,s,o,l){const{x:u,y:f}=JS(t,[e,n,s]),{x:h,y:p}=JS({x:t.x+t.width,y:t.y+t.height},[e,n,s]),g=o-h,x=l-p;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(x)}}const Yj=(t,e,n,s,o,l)=>{const u=zse(l,e,n),f=(e-u.x)/t.width,h=(n-u.y)/t.height,p=Math.min(f,h),g=cv(p,s,o),x=t.x+t.width/2,v=t.y+t.height/2,E=e/2-x*g,S=n/2-v*g,T=Lse(t,E,S,g,e,n),D={left:Math.min(T.left-u.left,0),top:Math.min(T.top-u.top,0),right:Math.min(T.right-u.right,0),bottom:Math.min(T.bottom-u.bottom,0)};return{x:E-D.left+D.right,y:S-D.top+D.bottom,zoom:g}},Z1=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function fv(t){return t!=null&&t!=="parent"}function nh(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function sz(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function iz(t,e={width:0,height:0},n,s,o){const l={...t},u=s.get(n);if(u){const f=u.origin||o;l.x+=u.internals.positionAbsolute.x-(e.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(e.height??0)*f[1]}return l}function O3(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Bse(){let t,e;return{promise:new Promise((s,o)=>{t=s,e=o}),resolve:t,reject:e}}function Ise(t){return{...K6,...t||{}}}function V1(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:l,y:u}=bc(t),f=m_({x:l-((o==null?void 0:o.left)??0),y:u-((o==null?void 0:o.top)??0)},s),{x:h,y:p}=n?h_(f,e):f;return{xSnapped:h,ySnapped:p,...f}}const $j=t=>({width:t.offsetWidth,height:t.offsetHeight}),oz=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},Hse=["INPUT","SELECT","TEXTAREA"];function az(t){var s,o;const e=((o=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:o[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:Hse.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const lz=t=>"clientX"in t,bc=(t,e)=>{var l,u;const n=lz(t),s=n?t.clientX:(l=t.touches)==null?void 0:l[0].clientX,o=n?t.clientY:(u=t.touches)==null?void 0:u[0].clientY;return{x:s-((e==null?void 0:e.left)??0),y:o-((e==null?void 0:e.top)??0)}},z3=(t,e,n,s,o)=>{const l=e.querySelectorAll(`.${t}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:o,position:u.getAttribute("data-handlepos"),x:(f.left-n.left)/s,y:(f.top-n.top)/s,...$j(u)}})};function uz({sourceX:t,sourceY:e,targetX:n,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=t*.125+o*.375+u*.375+n*.125,p=e*.125+l*.375+f*.375+s*.125,g=Math.abs(h-t),x=Math.abs(p-e);return[h,p,g,x]}function mS(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function L3({pos:t,x1:e,y1:n,x2:s,y2:o,c:l}){switch(t){case Dt.Left:return[e-mS(e-s,l),n];case Dt.Right:return[e+mS(s-e,l),n];case Dt.Top:return[e,n-mS(n-o,l)];case Dt.Bottom:return[e,n+mS(o-n,l)]}}function cz({sourceX:t,sourceY:e,sourcePosition:n=Dt.Bottom,targetX:s,targetY:o,targetPosition:l=Dt.Top,curvature:u=.25}){const[f,h]=L3({pos:n,x1:t,y1:e,x2:s,y2:o,c:u}),[p,g]=L3({pos:l,x1:s,y1:o,x2:t,y2:e,c:u}),[x,v,E,S]=uz({sourceX:t,sourceY:e,targetX:s,targetY:o,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:g});return[`M${t},${e} C${f},${h} ${p},${g} ${s},${o}`,x,v,E,S]}function dz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const o=Math.abs(n-t)/2,l=n<t?n+o:n-o,u=Math.abs(s-e)/2,f=s<e?s+u:s-u;return[l,f,o,u]}function qse({sourceNode:t,targetNode:e,selected:n=!1,zIndex:s=0,elevateOnSelect:o=!1,zIndexMode:l="basic"}){if(l==="manual")return s;const u=o&&n?s+1e3:s,f=Math.max(t.parentId||o&&t.selected?t.internals.z:0,e.parentId||o&&e.selected?e.internals.z:0);return u+f}function Fse({sourceNode:t,targetNode:e,width:n,height:s,transform:o}){const l=_D(ZS(t),ZS(e));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return Q1(u,wD(l))>0}const Gse=({source:t,sourceHandle:e,target:n,targetHandle:s})=>`xy-edge__${t}${e||""}-${n}${s||""}`,Yse=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),$se=(t,e,n={})=>{if(!t.source||!t.target)return rz("006",fl.error006()),e;const s=n.getEdgeId||Gse;let o;return Z6(t)?o={...t}:o={...t,id:s(t)},Yse(o,e)?e:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,e.concat(o))};function fz({sourceX:t,sourceY:e,targetX:n,targetY:s}){const[o,l,u,f]=dz({sourceX:t,sourceY:e,targetX:n,targetY:s});return[`M ${t},${e}L ${n},${s}`,o,l,u,f]}const B3={[Dt.Left]:{x:-1,y:0},[Dt.Right]:{x:1,y:0},[Dt.Top]:{x:0,y:-1},[Dt.Bottom]:{x:0,y:1}},Xse=({source:t,sourcePosition:e=Dt.Bottom,target:n})=>e===Dt.Left||e===Dt.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},I3=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function Kse({source:t,sourcePosition:e=Dt.Bottom,target:n,targetPosition:s=Dt.Top,center:o,offset:l,stepPosition:u}){const f=B3[e],h=B3[s],p={x:t.x+f.x*l,y:t.y+f.y*l},g={x:n.x+h.x*l,y:n.y+h.y*l},x=Xse({source:p,sourcePosition:e,target:g}),v=x.x!==0?"x":"y",E=x[v];let S=[],T,D;const A={x:0,y:0},M={x:0,y:0},[,,j,U]=dz({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(f[v]*h[v]===-1){v==="x"?(T=o.x??p.x+(g.x-p.x)*u,D=o.y??(p.y+g.y)/2):(T=o.x??(p.x+g.x)/2,D=o.y??p.y+(g.y-p.y)*u);const z=[{x:T,y:p.y},{x:T,y:g.y}],K=[{x:p.x,y:D},{x:g.x,y:D}];f[v]===E?S=v==="x"?z:K:S=v==="x"?K:z}else{const z=[{x:p.x,y:g.y}],K=[{x:g.x,y:p.y}];if(v==="x"?S=f.x===E?K:z:S=f.y===E?z:K,e===s){const $=Math.abs(t[v]-n[v]);if($<=l){const J=Math.min(l-1,l-$);f[v]===E?A[v]=(p[v]>t[v]?-1:1)*J:M[v]=(g[v]>n[v]?-1:1)*J}}if(e!==s){const $=v==="x"?"y":"x",J=f[v]===h[$],X=p[$]>g[$],Q=p[$]<g[$];(f[v]===1&&(!J&&X||J&&Q)||f[v]!==1&&(!J&&Q||J&&X))&&(S=v==="x"?z:K)}const te={x:p.x+A.x,y:p.y+A.y},H={x:g.x+M.x,y:g.y+M.y},I=Math.max(Math.abs(te.x-S[0].x),Math.abs(H.x-S[0].x)),F=Math.max(Math.abs(te.y-S[0].y),Math.abs(H.y-S[0].y));I>=F?(T=(te.x+H.x)/2,D=S[0].y):(T=S[0].x,D=(te.y+H.y)/2)}return[[t,{x:p.x+A.x,y:p.y+A.y},...S,{x:g.x+M.x,y:g.y+M.y},n],T,D,j,U]}function Wse(t,e,n,s){const o=Math.min(I3(t,e)/2,I3(e,n)/2,s),{x:l,y:u}=e;if(t.x===l&&l===n.x||t.y===u&&u===n.y)return`L${l} ${u}`;if(t.y===u){const p=t.x<n.x?-1:1,g=t.y<n.y?1:-1;return`L ${l+o*p},${u}Q ${l},${u} ${l},${u+o*g}`}const f=t.x<n.x?1:-1,h=t.y<n.y?-1:1;return`L ${l},${u+o*h}Q ${l},${u} ${l+o*f},${u}`}function zR({sourceX:t,sourceY:e,sourcePosition:n=Dt.Bottom,targetX:s,targetY:o,targetPosition:l=Dt.Top,borderRadius:u=5,centerX:f,centerY:h,offset:p=20,stepPosition:g=.5}){const[x,v,E,S,T]=Kse({source:{x:t,y:e},sourcePosition:n,target:{x:s,y:o},targetPosition:l,center:{x:f,y:h},offset:p,stepPosition:g});return[x.reduce((A,M,j)=>{let U="";return j>0&&j<x.length-1?U=Wse(x[j-1],M,x[j+1],u):U=`${j===0?"M":"L"}${M.x} ${M.y}`,A+=U,A},""),v,E,S,T]}function H3(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function Qse(t){var x;const{sourceNode:e,targetNode:n}=t;if(!H3(e)||!H3(n))return null;const s=e.internals.handleBounds||q3(e.handles),o=n.internals.handleBounds||q3(n.handles),l=F3((s==null?void 0:s.source)??[],t.sourceHandle),u=F3(t.connectionMode===uv.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),t.targetHandle);if(!l||!u)return(x=t.onError)==null||x.call(t,"008",fl.error008(l?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const f=(l==null?void 0:l.position)||Dt.Bottom,h=(u==null?void 0:u.position)||Dt.Top,p=ib(e,l,f),g=ib(n,u,h);return{sourceX:p.x,sourceY:p.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function q3(t){if(!t)return null;const e=[],n=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?e.push(s):s.type==="target"&&n.push(s);return{source:e,target:n}}function ib(t,e,n=Dt.Left,s=!1){const o=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,l=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:u,height:f}=e??nh(t);if(s)return{x:o+u/2,y:l+f/2};switch((e==null?void 0:e.position)??n){case Dt.Top:return{x:o+u/2,y:l};case Dt.Right:return{x:o+u,y:l+f/2};case Dt.Bottom:return{x:o+u/2,y:l+f};case Dt.Left:return{x:o,y:l+f/2}}}function F3(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function LR(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function Zse(t,{id:e,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const l=new Set;return t.reduce((u,f)=>([f.markerStart||s,f.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=LR(h,e);l.has(p)||(u.push({id:p,color:h.color||n,...h}),l.add(p))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const hz=1e3,Jse=10,Xj={nodeOrigin:[0,0],nodeExtent:X1,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},eie={...Xj,checkEquality:!0};function Kj(t,e){const n={...t};for(const s in e)e[s]!==void 0&&(n[s]=e[s]);return n}function tie(t,e,n){const s=Kj(Xj,n);for(const o of t.values())if(o.parentId)Qj(o,t,e,s);else{const l=d_(o,s.nodeOrigin),u=fv(o.extent)?o.extent:s.nodeExtent,f=sb(l,u,nh(o));o.internals.positionAbsolute=f}}function nie(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],s=[];for(const o of t.handles){const l={id:o.id,width:o.width??1,height:o.height??1,nodeId:t.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(l):o.type==="target"&&s.push(l)}return{source:n,target:s}}function Wj(t){return t==="manual"}function BR(t,e,n,s={}){var p,g;const o=Kj(eie,s),l={i:0},u=new Map(e),f=o!=null&&o.elevateNodesOnSelect&&!Wj(o.zIndexMode)?hz:0;let h=t.length>0;e.clear(),n.clear();for(const x of t){let v=u.get(x.id);if(o.checkEquality&&x===(v==null?void 0:v.internals.userNode))e.set(x.id,v);else{const E=d_(x,o.nodeOrigin),S=fv(x.extent)?x.extent:o.nodeExtent,T=sb(E,S,nh(x));v={...o.defaults,...x,measured:{width:(p=x.measured)==null?void 0:p.width,height:(g=x.measured)==null?void 0:g.height},internals:{positionAbsolute:T,handleBounds:nie(x,v),z:mz(x,f,o.zIndexMode),userNode:x}},e.set(x.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(h=!1),x.parentId&&Qj(v,e,n,s,l)}return h}function rie(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Qj(t,e,n,s,o){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Kj(Xj,s),p=t.parentId,g=e.get(p);if(!g){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}rie(t,n),o&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++o.i,g.internals.z=g.internals.z+o.i*Jse),o&&g.internals.rootParentIndex!==void 0&&(o.i=g.internals.rootParentIndex);const x=l&&!Wj(h)?hz:0,{x:v,y:E,z:S}=sie(t,g,u,f,x,h),{positionAbsolute:T}=t.internals,D=v!==T.x||E!==T.y;(D||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:D?{x:v,y:E}:T,z:S}})}function mz(t,e,n){const s=gc(t.zIndex)?t.zIndex:0;return Wj(n)?s:s+(t.selected?e:0)}function sie(t,e,n,s,o,l){const{x:u,y:f}=e.internals.positionAbsolute,h=nh(t),p=d_(t,n),g=fv(t.extent)?sb(p,t.extent,h):p;let x=sb({x:u+g.x,y:f+g.y},s,h);t.extent==="parent"&&(x=ez(x,h,e));const v=mz(t,o,l),E=e.internals.z??0;return{x:x.x,y:x.y,z:E>=v?E+1:v}}function Zj(t,e,n,s=[0,0]){var u;const o=[],l=new Map;for(const f of t){const h=e.get(f.parentId);if(!h)continue;const p=((u=l.get(f.parentId))==null?void 0:u.expandedRect)??dv(h),g=nz(p,f.rect);l.set(f.parentId,{expandedRect:g,parent:h})}return l.size>0&&l.forEach(({expandedRect:f,parent:h},p)=>{var j;const g=h.internals.positionAbsolute,x=nh(h),v=h.origin??s,E=f.x<g.x?Math.round(Math.abs(g.x-f.x)):0,S=f.y<g.y?Math.round(Math.abs(g.y-f.y)):0,T=Math.max(x.width,Math.round(f.width)),D=Math.max(x.height,Math.round(f.height)),A=(T-x.width)*v[0],M=(D-x.height)*v[1];(E>0||S>0||A||M)&&(o.push({id:p,type:"position",position:{x:h.position.x-E+A,y:h.position.y-S+M}}),(j=n.get(p))==null||j.forEach(U=>{t.some(P=>P.id===U.id)||o.push({id:U.id,type:"position",position:{x:U.position.x+E,y:U.position.y+S}})})),(x.width<f.width||x.height<f.height||E||S)&&o.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:T+(E?v[0]*E-A:0),height:D+(S?v[1]*S-M:0)}})}),o}function iie(t,e,n,s,o,l,u){const f=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const p=[],g=window.getComputedStyle(f),{m22:x}=new window.DOMMatrixReadOnly(g.transform),v=[];for(const E of t.values()){const S=e.get(E.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const T=$j(E.nodeElement),D=S.measured.width!==T.width||S.measured.height!==T.height;if(!!(T.width&&T.height&&(D||!S.internals.handleBounds||E.force))){const M=E.nodeElement.getBoundingClientRect(),j=fv(S.extent)?S.extent:l;let{positionAbsolute:U}=S.internals;S.parentId&&S.extent==="parent"?U=ez(U,T,e.get(S.parentId)):j&&(U=sb(U,j,T));const P={...S,measured:T,internals:{...S.internals,positionAbsolute:U,handleBounds:{source:z3("source",E.nodeElement,M,x,S.id),target:z3("target",E.nodeElement,M,x,S.id)}}};e.set(S.id,P),S.parentId&&Qj(P,e,n,{nodeOrigin:o,zIndexMode:u}),h=!0,D&&(p.push({id:S.id,type:"dimensions",dimensions:T}),S.expandParent&&S.parentId&&v.push({id:S.id,parentId:S.parentId,rect:dv(P,o)}))}}if(v.length>0){const E=Zj(v,e,n,o);p.push(...E)}return{changes:p,updatedInternals:h}}async function oie({delta:t,panZoom:e,transform:n,translateExtent:s,width:o,height:l}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const u=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[o,l]],s),f=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(f)}function G3(t,e,n,s,o,l){let u=o;const f=s.get(u)||new Map;s.set(u,f.set(n,e)),u=`${o}-${t}`;const h=s.get(u)||new Map;if(s.set(u,h.set(n,e)),l){u=`${o}-${t}-${l}`;const p=s.get(u)||new Map;s.set(u,p.set(n,e))}}function pz(t,e,n){t.clear(),e.clear();for(const s of n){const{source:o,target:l,sourceHandle:u=null,targetHandle:f=null}=s,h={edgeId:s.id,source:o,target:l,sourceHandle:u,targetHandle:f},p=`${o}-${u}--${l}-${f}`,g=`${l}-${f}--${o}-${u}`;G3("source",h,g,t,o,u),G3("target",h,p,t,l,f),e.set(s.id,s)}}function gz(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:gz(n,e):!1}function Y3(t,e,n){var o;let s=t;do{if((o=s==null?void 0:s.matches)!=null&&o.call(s,e))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function aie(t,e,n,s){const o=new Map;for(const[l,u]of t)if((u.selected||u.id===s)&&(!u.parentId||!gz(u,t))&&(u.draggable||e&&typeof u.draggable>"u")){const f=t.get(l);f&&o.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return o}function wT({nodeId:t,dragItems:e,nodeLookup:n,dragging:s=!0}){var u,f,h;const o=[];for(const[p,g]of e){const x=(u=n.get(p))==null?void 0:u.internals.userNode;x&&o.push({...x,position:g.position,dragging:s})}if(!t)return[o[0],o];const l=(f=n.get(t))==null?void 0:f.internals.userNode;return[l?{...l,position:((h=e.get(t))==null?void 0:h.position)||l.position,dragging:s}:o[0],o]}function lie({dragItems:t,snapGrid:e,x:n,y:s}){const o=t.values().next().value;if(!o)return null;const l={x:n-o.distance.x,y:s-o.distance.y},u=h_(l,e);return{x:u.x-l.x,y:u.y-l.y}}function uie({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:s,onDragStop:o}){let l={x:null,y:null},u=0,f=new Map,h=!1,p={x:0,y:0},g=null,x=!1,v=null,E=!1,S=!1,T=null;function D({noDragClassName:M,handleSelector:j,domNode:U,isSelectable:P,nodeId:z,nodeClickDistance:K=0}){v=ll(U);function te({x:$,y:J}){const{nodeLookup:X,nodeExtent:Q,snapGrid:L,snapToGrid:ee,nodeOrigin:ne,onNodeDrag:oe,onSelectionDrag:G,onError:B,updateNodePositions:ae}=e();l={x:$,y:J};let Z=!1;const be=f.size>1,Ve=be&&Q?OR(f_(f)):null,he=be&&ee?lie({dragItems:f,snapGrid:L,x:$,y:J}):null;for(const[Ne,De]of f){if(!X.has(Ne))continue;let me={x:$-De.distance.x,y:J-De.distance.y};ee&&(me=he?{x:Math.round(me.x+he.x),y:Math.round(me.y+he.y)}:h_(me,L));let qe=null;if(be&&Q&&!De.extent&&Ve){const{positionAbsolute:et}=De.internals,Ct=et.x-Ve.x+Q[0][0],kt=et.x+De.measured.width-Ve.x2+Q[1][0],Fe=et.y-Ve.y+Q[0][1],Ut=et.y+De.measured.height-Ve.y2+Q[1][1];qe=[[Ct,Fe],[kt,Ut]]}const{position:Te,positionAbsolute:Ke}=J6({nodeId:Ne,nextPosition:me,nodeLookup:X,nodeExtent:qe||Q,nodeOrigin:ne,onError:B});Z=Z||De.position.x!==Te.x||De.position.y!==Te.y,De.position=Te,De.internals.positionAbsolute=Ke}if(S=S||Z,!!Z&&(ae(f,!0),T&&(s||oe||!z&&G))){const[Ne,De]=wT({nodeId:z,dragItems:f,nodeLookup:X});s==null||s(T,f,Ne,De),oe==null||oe(T,Ne,De),z||G==null||G(T,De)}}async function H(){if(!g)return;const{transform:$,panBy:J,autoPanSpeed:X,autoPanOnNodeDrag:Q}=e();if(!Q){h=!1,cancelAnimationFrame(u);return}const[L,ee]=tz(p,g,X);(L!==0||ee!==0)&&(l.x=(l.x??0)-L/$[2],l.y=(l.y??0)-ee/$[2],await J({x:L,y:ee})&&te(l)),u=requestAnimationFrame(H)}function I($){var be;const{nodeLookup:J,multiSelectionActive:X,nodesDraggable:Q,transform:L,snapGrid:ee,snapToGrid:ne,selectNodesOnDrag:oe,onNodeDragStart:G,onSelectionDragStart:B,unselectNodesAndEdges:ae}=e();x=!0,(!oe||!P)&&!X&&z&&((be=J.get(z))!=null&&be.selected||ae()),P&&oe&&z&&(t==null||t(z));const Z=V1($.sourceEvent,{transform:L,snapGrid:ee,snapToGrid:ne,containerBounds:g});if(l=Z,f=aie(J,Q,Z,z),f.size>0&&(n||G||!z&&B)){const[Ve,he]=wT({nodeId:z,dragItems:f,nodeLookup:J});n==null||n($.sourceEvent,f,Ve,he),G==null||G($.sourceEvent,Ve,he),z||B==null||B($.sourceEvent,he)}}const F=k6().clickDistance(K).on("start",$=>{const{domNode:J,nodeDragThreshold:X,transform:Q,snapGrid:L,snapToGrid:ee}=e();g=(J==null?void 0:J.getBoundingClientRect())||null,E=!1,S=!1,T=$.sourceEvent,X===0&&I($),l=V1($.sourceEvent,{transform:Q,snapGrid:L,snapToGrid:ee,containerBounds:g}),p=bc($.sourceEvent,g)}).on("drag",$=>{const{autoPanOnNodeDrag:J,transform:X,snapGrid:Q,snapToGrid:L,nodeDragThreshold:ee,nodeLookup:ne}=e(),oe=V1($.sourceEvent,{transform:X,snapGrid:Q,snapToGrid:L,containerBounds:g});if(T=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||z&&!ne.has(z))&&(E=!0),!E){if(!h&&J&&x&&(h=!0,H()),!x){const G=bc($.sourceEvent,g),B=G.x-p.x,ae=G.y-p.y;Math.sqrt(B*B+ae*ae)>ee&&I($)}(l.x!==oe.xSnapped||l.y!==oe.ySnapped)&&f&&x&&(p=bc($.sourceEvent,g),te(oe))}}).on("end",$=>{if(!(!x||E)&&(h=!1,x=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:J,updateNodePositions:X,onNodeDragStop:Q,onSelectionDragStop:L}=e();if(S&&(X(f,!1),S=!1),o||Q||!z&&L){const[ee,ne]=wT({nodeId:z,dragItems:f,nodeLookup:J,dragging:!1});o==null||o($.sourceEvent,f,ee,ne),Q==null||Q($.sourceEvent,ee,ne),z||L==null||L($.sourceEvent,ne)}}}).filter($=>{const J=$.target;return!$.button&&(!M||!Y3(J,`.${M}`,U))&&(!j||Y3(J,j,U))});v.call(F)}function A(){v==null||v.on(".drag",null)}return{update:D,destroy:A}}function cie(t,e,n){const s=[],o={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const l of e.values())Q1(o,dv(l))>0&&s.push(l);return s}const die=250;function fie(t,e,n,s){var f,h;let o=[],l=1/0;const u=cie(t,n,e+die);for(const p of u){const g=[...((f=p.internals.handleBounds)==null?void 0:f.source)??[],...((h=p.internals.handleBounds)==null?void 0:h.target)??[]];for(const x of g){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:v,y:E}=ib(p,x,x.position,!0),S=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(E-t.y,2));S>e||(S<l?(o=[{...x,x:v,y:E}],l=S):S===l&&o.push({...x,x:v,y:E}))}}if(!o.length)return null;if(o.length>1){const p=s.type==="source"?"target":"source";return o.find(g=>g.type===p)??o[0]}return o[0]}function bz(t,e,n,s,o,l=!1){var p,g,x;const u=s.get(t);if(!u)return null;const f=o==="strict"?(p=u.internals.handleBounds)==null?void 0:p[e]:[...((g=u.internals.handleBounds)==null?void 0:g.source)??[],...((x=u.internals.handleBounds)==null?void 0:x.target)??[]],h=(n?f==null?void 0:f.find(v=>v.id===n):f==null?void 0:f[0])??null;return h&&l?{...h,...ib(u,h,h.position,!0)}:h}function xz(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function hie(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const yz=()=>!0;function mie(t,{connectionMode:e,connectionRadius:n,handleId:s,nodeId:o,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:p,autoPanOnConnect:g,flowId:x,panBy:v,cancelConnection:E,onConnectStart:S,onConnect:T,onConnectEnd:D,isValidConnection:A=yz,onReconnectEnd:M,updateConnection:j,getTransform:U,getFromHandle:P,autoPanSpeed:z,dragThreshold:K=1,handleDomNode:te}){const H=oz(t.target);let I=0,F;const{x:$,y:J}=bc(t),X=xz(l,te),Q=f==null?void 0:f.getBoundingClientRect();let L=!1;if(!Q||!X)return;const ee=bz(o,X,s,h,e);if(!ee)return;let ne=bc(t,Q),oe=!1,G=null,B=!1,ae=null;function Z(){if(!g||!Q)return;const[Te,Ke]=tz(ne,Q,z);v({x:Te,y:Ke}),I=requestAnimationFrame(Z)}const be={...ee,nodeId:o,type:X,position:ee.position},Ve=h.get(o);let Ne={inProgress:!0,isValid:null,from:ib(Ve,be,Dt.Left,!0),fromHandle:be,fromPosition:be.position,fromNode:Ve,to:ne,toHandle:null,toPosition:V3[be.position],toNode:null,pointer:ne};function De(){L=!0,j(Ne),S==null||S(t,{nodeId:o,handleId:s,handleType:X})}K===0&&De();function me(Te){if(!L){const{x:Ut,y:Bn}=bc(Te),wr=Ut-$,rt=Bn-J;if(!(wr*wr+rt*rt>K*K))return;De()}if(!P()||!be){qe(Te);return}const Ke=U();ne=bc(Te,Q),F=fie(m_(ne,Ke,!1,[1,1]),n,h,be),oe||(Z(),oe=!0);const et=vz(Te,{handle:F,connectionMode:e,fromNodeId:o,fromHandleId:s,fromType:u?"target":"source",isValidConnection:A,doc:H,lib:p,flowId:x,nodeLookup:h});ae=et.handleDomNode,G=et.connection,B=hie(!!F,et.isValid);const Ct=h.get(o),kt=Ct?ib(Ct,be,Dt.Left,!0):Ne.from,Fe={...Ne,from:kt,isValid:B,to:et.toHandle&&B?JS({x:et.toHandle.x,y:et.toHandle.y},Ke):ne,toHandle:et.toHandle,toPosition:B&&et.toHandle?et.toHandle.position:V3[be.position],toNode:et.toHandle?h.get(et.toHandle.nodeId):null,pointer:ne};j(Fe),Ne=Fe}function qe(Te){if(!("touches"in Te&&Te.touches.length>0)){if(L){(F||ae)&&G&&B&&(T==null||T(G));const{inProgress:Ke,...et}=Ne,Ct={...et,toPosition:Ne.toHandle?Ne.toPosition:null};D==null||D(Te,Ct),l&&(M==null||M(Te,Ct))}E(),cancelAnimationFrame(I),oe=!1,B=!1,G=null,ae=null,H.removeEventListener("mousemove",me),H.removeEventListener("mouseup",qe),H.removeEventListener("touchmove",me),H.removeEventListener("touchend",qe)}}H.addEventListener("mousemove",me),H.addEventListener("mouseup",qe),H.addEventListener("touchmove",me),H.addEventListener("touchend",qe)}function vz(t,{handle:e,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:p=yz,nodeLookup:g}){const x=l==="target",v=e?u.querySelector(`.${f}-flow__handle[data-id="${h}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:E,y:S}=bc(t),T=u.elementFromPoint(E,S),D=T!=null&&T.classList.contains(`${f}-flow__handle`)?T:v,A={handleDomNode:D,isValid:!1,connection:null,toHandle:null};if(D){const M=xz(void 0,D),j=D.getAttribute("data-nodeid"),U=D.getAttribute("data-handleid"),P=D.classList.contains("connectable"),z=D.classList.contains("connectableend");if(!j||!M)return A;const K={source:x?j:s,sourceHandle:x?U:o,target:x?s:j,targetHandle:x?o:U};A.connection=K;const H=P&&z&&(n===uv.Strict?x&&M==="source"||!x&&M==="target":j!==s||U!==o);A.isValid=H&&p(K),A.toHandle=bz(j,M,U,g,n,!0)}return A}const IR={onPointerDown:mie,isValid:vz};function pie({domNode:t,panZoom:e,getTransform:n,getViewScale:s}){const o=ll(t);function l({translateExtent:f,width:h,height:p,zoomStep:g=1,pannable:x=!0,zoomable:v=!0,inversePan:E=!1}){const S=j=>{if(j.sourceEvent.type!=="wheel"||!e)return;const U=n(),P=j.sourceEvent.ctrlKey&&Z1()?10:1,z=-j.sourceEvent.deltaY*(j.sourceEvent.deltaMode===1?.05:j.sourceEvent.deltaMode?1:.002)*g,K=U[2]*Math.pow(2,z*P);e.scaleTo(K)};let T=[0,0];const D=j=>{(j.sourceEvent.type==="mousedown"||j.sourceEvent.type==="touchstart")&&(T=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY])},A=j=>{const U=n();if(j.sourceEvent.type!=="mousemove"&&j.sourceEvent.type!=="touchmove"||!e)return;const P=[j.sourceEvent.clientX??j.sourceEvent.touches[0].clientX,j.sourceEvent.clientY??j.sourceEvent.touches[0].clientY],z=[P[0]-T[0],P[1]-T[1]];T=P;const K=s()*Math.max(U[2],Math.log(U[2]))*(E?-1:1),te={x:U[0]-z[0]*K,y:U[1]-z[1]*K},H=[[0,0],[h,p]];e.setViewportConstrained({x:te.x,y:te.y,zoom:U[2]},H,f)},M=$6().on("start",D).on("zoom",x?A:null).on("zoom.wheel",v?S:null);o.call(M,{})}function u(){o.on("zoom",null)}return{update:l,destroy:u,pointer:hc}}const ND=t=>({x:t.x,y:t.y,zoom:t.k}),NT=({x:t,y:e,zoom:n})=>ED.translate(t,e).scale(n),$y=(t,e)=>t.target.closest(`.${e}`),Ez=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),gie=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,ST=(t,e=0,n=gie,s=()=>{})=>{const o=typeof e=="number"&&e>0;return o||s(),o?t.transition().duration(e).ease(n).on("end",s):t},_z=t=>{const e=t.ctrlKey&&Z1()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function bie({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:p}){return g=>{if($y(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const x=n.property("__zoom").k||1;if(g.ctrlKey&&u){const D=hc(g),A=_z(g),M=x*Math.pow(2,A);s.scaleTo(n,M,D,g);return}const v=g.deltaMode===1?20:1;let E=o===Qg.Vertical?0:g.deltaX*v,S=o===Qg.Horizontal?0:g.deltaY*v;!Z1()&&g.shiftKey&&o!==Qg.Vertical&&(E=g.deltaY*v,S=0),s.translateBy(n,-(E/x)*l,-(S/x)*l,{internal:!0});const T=ND(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h==null||h(g,T),t.panScrollTimeout=setTimeout(()=>{p==null||p(g,T),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,f==null||f(g,T))}}function xie({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(s,o){const l=s.type==="wheel",u=!e&&l&&!s.ctrlKey,f=$y(s,t);if(s.ctrlKey&&l&&f&&s.preventDefault(),u||f)return null;s.preventDefault(),n.call(this,s,o)}}function yie({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return s=>{var l,u,f;if((l=s.sourceEvent)!=null&&l.internal)return;const o=ND(s.transform);t.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=o,((f=s.sourceEvent)==null?void 0:f.type)==="mousedown"&&e(!0),n&&(n==null||n(s.sourceEvent,o))}}function vie({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return l=>{var u,f;t.usedRightMouseButton=!!(n&&Ez(e,t.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||s([l.transform.x,l.transform.y,l.transform.k]),o&&!((f=l.sourceEvent)!=null&&f.internal)&&(o==null||o(l.sourceEvent,ND(l.transform)))}}function Eie({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:l}){return u=>{var f;if(!((f=u.sourceEvent)!=null&&f.internal)&&(t.isZoomingOrPanning=!1,l&&Ez(e,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),o)){const h=ND(u.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{o==null||o(u.sourceEvent,h)},n?150:0)}}}function _ie({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:p,connectionInProgress:g}){return x=>{var D;const v=t||e,E=n&&x.ctrlKey,S=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&($y(x,`${p}-flow__node`)||$y(x,`${p}-flow__edge`)))return!0;if(!s&&!v&&!o&&!l&&!n||u||g&&!S||$y(x,f)&&S||$y(x,h)&&(!S||o&&S&&!t)||!n&&x.ctrlKey&&S)return!1;if(!n&&x.type==="touchstart"&&((D=x.touches)==null?void 0:D.length)>1)return x.preventDefault(),!1;if(!v&&!o&&!E&&S||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const T=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||S)&&T}}function wie({domNode:t,minZoom:e,maxZoom:n,translateExtent:s,viewport:o,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),x=$6().scaleExtent([e,n]).translateExtent(s),v=ll(t).call(x);M({x:o.x,y:o.y,zoom:cv(o.zoom,e,n)},[[0,0],[g.width,g.height]],s);const E=v.on("wheel.zoom"),S=v.on("dblclick.zoom");x.wheelDelta(_z);function T(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).transform(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function D({noWheelClassName:F,noPanClassName:$,onPaneContextMenu:J,userSelectionActive:X,panOnScroll:Q,panOnDrag:L,panOnScrollMode:ee,panOnScrollSpeed:ne,preventScrolling:oe,zoomOnPinch:G,zoomOnScroll:B,zoomOnDoubleClick:ae,zoomActivationKeyPressed:Z,lib:be,onTransformChange:Ve,connectionInProgress:he,paneClickDistance:Ne,selectionOnDrag:De}){X&&!p.isZoomingOrPanning&&A();const me=Q&&!Z&&!X;x.clickDistance(De?1/0:!gc(Ne)||Ne<0?0:Ne);const qe=me?bie({zoomPanValues:p,noWheelClassName:F,d3Selection:v,d3Zoom:x,panOnScrollMode:ee,panOnScrollSpeed:ne,zoomOnPinch:G,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):xie({noWheelClassName:F,preventScrolling:oe,d3ZoomHandler:E});if(v.on("wheel.zoom",qe,{passive:!1}),!X){const Ke=yie({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});x.on("start",Ke);const et=vie({zoomPanValues:p,panOnDrag:L,onPaneContextMenu:!!J,onPanZoom:l,onTransformChange:Ve});x.on("zoom",et);const Ct=Eie({zoomPanValues:p,panOnDrag:L,panOnScroll:Q,onPaneContextMenu:J,onPanZoomEnd:f,onDraggingChange:h});x.on("end",Ct)}const Te=_ie({zoomActivationKeyPressed:Z,panOnDrag:L,zoomOnScroll:B,panOnScroll:Q,zoomOnDoubleClick:ae,zoomOnPinch:G,userSelectionActive:X,noPanClassName:$,noWheelClassName:F,lib:be,connectionInProgress:he});x.filter(Te),ae?v.on("dblclick.zoom",S):v.on("dblclick.zoom",null)}function A(){x.on("zoom",null)}async function M(F,$,J){const X=NT(F),Q=x==null?void 0:x.constrain()(X,$,J);return Q&&await T(Q),new Promise(L=>L(Q))}async function j(F,$){const J=NT(F);return await T(J,$),new Promise(X=>X(J))}function U(F){if(v){const $=NT(F),J=v.property("__zoom");(J.k!==F.zoom||J.x!==F.x||J.y!==F.y)&&(x==null||x.transform(v,$,null,{sync:!0}))}}function P(){const F=v?Y6(v.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function z(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).scaleTo(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function K(F,$){return v?new Promise(J=>{x==null||x.interpolate(($==null?void 0:$.interpolate)==="linear"?M1:SS).scaleBy(ST(v,$==null?void 0:$.duration,$==null?void 0:$.ease,()=>J(!0)),F)}):Promise.resolve(!1)}function te(F){x==null||x.scaleExtent(F)}function H(F){x==null||x.translateExtent(F)}function I(F){const $=!gc(F)||F<0?0:F;x==null||x.clickDistance($)}return{update:D,destroy:A,setViewport:j,setViewportConstrained:M,getViewport:P,scaleTo:z,scaleBy:K,setScaleExtent:te,setTranslateExtent:H,syncViewport:U,setClickDistance:I}}var hv;(function(t){t.Line="line",t.Handle="handle"})(hv||(hv={}));function Nie({width:t,prevWidth:e,height:n,prevHeight:s,affectsX:o,affectsY:l}){const u=t-e,f=n-s,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&o&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function $3(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),s=t.includes("left"),o=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:s,affectsY:o}}function Dm(t,e){return Math.max(0,e-t)}function Am(t,e){return Math.max(0,t-e)}function pS(t,e,n){return Math.max(0,e-t,t-n)}function X3(t,e){return t?!e:e}function Sie(t,e,n,s,o,l,u,f){let{affectsX:h,affectsY:p}=e;const{isHorizontal:g,isVertical:x}=e,v=g&&x,{xSnapped:E,ySnapped:S}=n,{minWidth:T,maxWidth:D,minHeight:A,maxHeight:M}=s,{x:j,y:U,width:P,height:z,aspectRatio:K}=t;let te=Math.floor(g?E-t.pointerX:0),H=Math.floor(x?S-t.pointerY:0);const I=P+(h?-te:te),F=z+(p?-H:H),$=-l[0]*P,J=-l[1]*z;let X=pS(I,T,D),Q=pS(F,A,M);if(u){let ne=0,oe=0;h&&te<0?ne=Dm(j+te+$,u[0][0]):!h&&te>0&&(ne=Am(j+I+$,u[1][0])),p&&H<0?oe=Dm(U+H+J,u[0][1]):!p&&H>0&&(oe=Am(U+F+J,u[1][1])),X=Math.max(X,ne),Q=Math.max(Q,oe)}if(f){let ne=0,oe=0;h&&te>0?ne=Am(j+te,f[0][0]):!h&&te<0&&(ne=Dm(j+I,f[1][0])),p&&H>0?oe=Am(U+H,f[0][1]):!p&&H<0&&(oe=Dm(U+F,f[1][1])),X=Math.max(X,ne),Q=Math.max(Q,oe)}if(o){if(g){const ne=pS(I/K,A,M)*K;if(X=Math.max(X,ne),u){let oe=0;!h&&!p||h&&!p&&v?oe=Am(U+J+I/K,u[1][1])*K:oe=Dm(U+J+(h?te:-te)/K,u[0][1])*K,X=Math.max(X,oe)}if(f){let oe=0;!h&&!p||h&&!p&&v?oe=Dm(U+I/K,f[1][1])*K:oe=Am(U+(h?te:-te)/K,f[0][1])*K,X=Math.max(X,oe)}}if(x){const ne=pS(F*K,T,D)/K;if(Q=Math.max(Q,ne),u){let oe=0;!h&&!p||p&&!h&&v?oe=Am(j+F*K+$,u[1][0])/K:oe=Dm(j+(p?H:-H)*K+$,u[0][0])/K,Q=Math.max(Q,oe)}if(f){let oe=0;!h&&!p||p&&!h&&v?oe=Dm(j+F*K,f[1][0])/K:oe=Am(j+(p?H:-H)*K,f[0][0])/K,Q=Math.max(Q,oe)}}}H=H+(H<0?Q:-Q),te=te+(te<0?X:-X),o&&(v?I>F*K?H=(X3(h,p)?-te:te)/K:te=(X3(h,p)?-H:H)*K:g?(H=te/K,p=h):(te=H*K,h=p));const L=h?j+te:j,ee=p?U+H:U;return{width:P+(h?-te:te),height:z+(p?-H:H),x:l[0]*te*(h?-1:1)+L,y:l[1]*H*(p?-1:1)+ee}}const wz={width:0,height:0,x:0,y:0},Die={...wz,pointerX:0,pointerY:0,aspectRatio:1};function Aie(t){return[[0,0],[t.measured.width,t.measured.height]]}function Cie(t,e,n){const s=e.position.x+t.position.x,o=e.position.y+t.position.y,l=t.measured.width??0,u=t.measured.height??0,f=n[0]*l,h=n[1]*u;return[[s-f,o-h],[s+l-f,o+u-h]]}function Tie({domNode:t,nodeId:e,getStoreItems:n,onChange:s,onEnd:o}){const l=ll(t);let u={controlDirection:$3("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:p,boundaries:g,keepAspectRatio:x,resizeDirection:v,onResizeStart:E,onResize:S,onResizeEnd:T,shouldResize:D}){let A={...wz},M={...Die};u={boundaries:g,resizeDirection:v,keepAspectRatio:x,controlDirection:$3(p)};let j,U=null,P=[],z,K,te,H=!1;const I=k6().on("start",F=>{const{nodeLookup:$,transform:J,snapGrid:X,snapToGrid:Q,nodeOrigin:L,paneDomNode:ee}=n();if(j=$.get(e),!j)return;U=(ee==null?void 0:ee.getBoundingClientRect())??null;const{xSnapped:ne,ySnapped:oe}=V1(F.sourceEvent,{transform:J,snapGrid:X,snapToGrid:Q,containerBounds:U});A={width:j.measured.width??0,height:j.measured.height??0,x:j.position.x??0,y:j.position.y??0},M={...A,pointerX:ne,pointerY:oe,aspectRatio:A.width/A.height},z=void 0,j.parentId&&(j.extent==="parent"||j.expandParent)&&(z=$.get(j.parentId),K=z&&j.extent==="parent"?Aie(z):void 0),P=[],te=void 0;for(const[G,B]of $)if(B.parentId===e&&(P.push({id:G,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const ae=Cie(B,j,B.origin??L);te?te=[[Math.min(ae[0][0],te[0][0]),Math.min(ae[0][1],te[0][1])],[Math.max(ae[1][0],te[1][0]),Math.max(ae[1][1],te[1][1])]]:te=ae}E==null||E(F,{...A})}).on("drag",F=>{const{transform:$,snapGrid:J,snapToGrid:X,nodeOrigin:Q}=n(),L=V1(F.sourceEvent,{transform:$,snapGrid:J,snapToGrid:X,containerBounds:U}),ee=[];if(!j)return;const{x:ne,y:oe,width:G,height:B}=A,ae={},Z=j.origin??Q,{width:be,height:Ve,x:he,y:Ne}=Sie(M,u.controlDirection,L,u.boundaries,u.keepAspectRatio,Z,K,te),De=be!==G,me=Ve!==B,qe=he!==ne&&De,Te=Ne!==oe&&me;if(!qe&&!Te&&!De&&!me)return;if((qe||Te||Z[0]===1||Z[1]===1)&&(ae.x=qe?he:A.x,ae.y=Te?Ne:A.y,A.x=ae.x,A.y=ae.y,P.length>0)){const kt=he-ne,Fe=Ne-oe;for(const Ut of P)Ut.position={x:Ut.position.x-kt+Z[0]*(be-G),y:Ut.position.y-Fe+Z[1]*(Ve-B)},ee.push(Ut)}if((De||me)&&(ae.width=De&&(!u.resizeDirection||u.resizeDirection==="horizontal")?be:A.width,ae.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?Ve:A.height,A.width=ae.width,A.height=ae.height),z&&j.expandParent){const kt=Z[0]*(ae.width??0);ae.x&&ae.x<kt&&(A.x=kt,M.x=M.x-(ae.x-kt));const Fe=Z[1]*(ae.height??0);ae.y&&ae.y<Fe&&(A.y=Fe,M.y=M.y-(ae.y-Fe))}const Ke=Nie({width:A.width,prevWidth:G,height:A.height,prevHeight:B,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),et={...A,direction:Ke};(D==null?void 0:D(F,et))!==!1&&(H=!0,S==null||S(F,et),s(ae,ee))}).on("end",F=>{H&&(T==null||T(F,{...A}),o==null||o({...A}),H=!1)});l.call(I)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}var DT={exports:{}},AT={},CT={exports:{}},TT={},K3;function Rie(){if(K3)return TT;K3=1;/**
795
795
  * @license React
796
796
  * use-sync-external-store-shim.development.js
797
797
  *
@@ -1192,4 +1192,4 @@ DASHBOARD_DIST=../dashboard/dist # Path para os assets do dashboard`},void 0,!1
1192
1192
  This will create the squad in your local squads directory.`)){v(j.id);try{const P=await fetch(`/api/registry/squads/${encodeURIComponent(j.fullName)}/install`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(P.ok){const z=await P.json();alert(`✅ Squad installed to:
1193
1193
  ${z.installedTo}
1194
1194
 
1195
- Refresh the page to see it in your squads list.`)}else{const z=await P.json();alert(`Failed to install: ${z.error}`)}}catch{alert("Failed to install squad")}finally{v(null)}}}function M(j){j.preventDefault(),D()}return y.jsxDEV("div",{style:{padding:"var(--sp-6)",maxWidth:1200,margin:"0 auto"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-6)"},children:[y.jsxDEV("h1",{style:{fontFamily:"var(--font-display)",fontSize:"1.5rem",fontWeight:700,marginBottom:"var(--sp-2)"},children:"🏪 Squad Marketplace"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:121,columnNumber:9},this),y.jsxDEV("p",{style:{color:"var(--text-muted)",fontSize:"0.9rem"},children:"Discover, share, and install AI agent squads from the community."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:129,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:120,columnNumber:7},this),y.jsxDEV("form",{onSubmit:M,style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Search squads...",value:f,onChange:j=>h(j.target.value),style:{flex:1,padding:"8px 12px",borderRadius:6,border:"1px solid var(--border-subtle)",background:"var(--surface-2)",color:"var(--text-primary)",fontSize:"0.9rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:140,columnNumber:9},this),y.jsxDEV("button",{type:"submit",style:{padding:"8px 16px",borderRadius:6,border:"none",background:"var(--accent)",color:"var(--text-inverse)",cursor:"pointer",fontWeight:600},children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:155,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:135,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("button",{onClick:()=>{g(null),D()},style:{padding:"6px 12px",borderRadius:20,border:p===null?"2px solid var(--accent)":"1px solid var(--border-subtle)",background:p===null?"var(--accent-dim)":"transparent",color:p===null?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontSize:"0.8rem",fontWeight:p===null?600:400},children:"All"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:178,columnNumber:9},this),e.map(j=>y.jsxDEV("button",{onClick:()=>{g(j.id),D()},style:{padding:"6px 12px",borderRadius:20,border:p===j.id?"2px solid var(--accent)":"1px solid var(--border-subtle)",background:p===j.id?"var(--accent-dim)":"transparent",color:p===j.id?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontSize:"0.8rem",fontWeight:p===j.id?600:400},children:[j.icon," ",j.name]},j.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:194,columnNumber:11},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:172,columnNumber:7},this),l?y.jsxDEV("div",{style:{textAlign:"center",padding:40,color:"var(--text-muted)"},children:"Loading squads..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:215,columnNumber:9},this):s.length===0?y.jsxDEV("div",{style:{textAlign:"center",padding:60,color:"var(--text-muted)",border:"2px dashed var(--border-subtle)",borderRadius:12},children:[y.jsxDEV("div",{style:{fontSize:"3rem",marginBottom:"var(--sp-3)"},children:"📦"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:226,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"1rem",marginBottom:"var(--sp-2)"},children:"No squads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:227,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"0.85rem"},children:"Be the first to publish a squad to the marketplace!"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:228,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:219,columnNumber:9},this):y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:"var(--sp-4)"},children:s.map(j=>y.jsxDEV(_le,{squad:j,onInstall:()=>A(j),installing:x===j.id},j.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:239,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:233,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:114,columnNumber:5},this)}function _le({squad:t,onInstall:e,installing:n}){return y.jsxDEV("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:12,padding:"var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{width:40,height:40,borderRadius:8,background:"var(--accent-dim)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem"},children:wle(t.icon||"default")},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:273,columnNumber:9},this),y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontWeight:600,fontSize:"0.95rem",marginBottom:2},children:t.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:286,columnNumber:11},this),y.jsxDEV("code",{style:{fontSize:"0.7rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:4},children:t.fullName},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:289,columnNumber:11},this),t.latestVersion&&y.jsxDEV("span",{style:{fontSize:"0.65rem",padding:"2px 6px",borderRadius:4,background:"var(--accent-dim)",color:"var(--accent)",marginLeft:4},children:["v",t.latestVersion]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:299,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:285,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:272,columnNumber:7},this),y.jsxDEV("p",{style:{fontSize:"0.85rem",color:"var(--text-secondary)",lineHeight:1.5,flex:1,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:314,columnNumber:7},this),t.tags.length>0&&y.jsxDEV("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.tags.slice(0,3).map(s=>y.jsxDEV("span",{style:{fontSize:"0.65rem",padding:"2px 6px",borderRadius:4,background:"var(--surface-3)",color:"var(--text-muted)"},children:s},s,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:331,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:329,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--text-muted)",paddingTop:"var(--sp-2)",borderTop:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{children:["📥 ",t.downloads]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:356,columnNumber:9},this),y.jsxDEV("span",{children:["⭐ ",t.rating.toFixed(1)," (",t.ratingCount,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:357,columnNumber:9},this),y.jsxDEV("span",{children:["@",t.scope]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:358,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:348,columnNumber:7},this),y.jsxDEV("button",{onClick:e,disabled:n,style:{padding:"8px 16px",borderRadius:6,border:"none",background:n?"var(--surface-3)":"var(--accent)",color:n?"var(--text-muted)":"var(--text-inverse)",cursor:n?"not-allowed":"pointer",fontWeight:600,fontSize:"0.85rem"},children:n?"Installing...":"Install Squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:362,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:262,columnNumber:5},this)}function wle(t){const e={rocket:"🚀",folder:"📁",code:"💻",chat:"💬",search:"🔍",chart:"📊",users:"👥",tools:"🔧",default:"📦"};return e[t]??e.default}const Nle=Object.freeze(Object.defineProperty({__proto__:null,MarketplaceView:a8},Symbol.toStringTag,{value:"Module"})),Sle={display:"flex",gap:"var(--sp-1)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"};function Dle(t){return{padding:"6px 16px",border:"none",borderBottom:t?"2px solid var(--accent)":"2px solid transparent",background:"none",color:t?"var(--accent)":"var(--text-secondary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t?600:400,cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"}}const md={background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)"},Zg={background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"6px 10px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",outline:"none",width:"100%"},RD={padding:"6px 14px",background:"var(--accent)",color:"var(--text-inverse)",border:"none",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-display)",fontSize:"0.8rem",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},Ale={...RD,background:"var(--status-error)",fontSize:"0.7rem",padding:"3px 8px"},xc={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4};function Cle(){const[t,e]=O.useState(""),[n,s]=O.useState("auto"),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(null),[g,x]=O.useState(!1),[v,E]=O.useState(""),S=O.useCallback(async()=>{try{const D=await fetch("/api/knowledge/stats",{credentials:"include"});if(D.ok){const A=await D.json();p(A)}}catch{}},[]);O.useEffect(()=>{S()},[S]);const T=async()=>{if(t.trim()){x(!0),E("");try{const D=new URLSearchParams({q:t,mode:n,limit:"10"});o.trim()&&D.set("squad",o.trim());const A=await fetch(`/api/knowledge/query?${D}`,{credentials:"include"});if(!A.ok)throw new Error(`Search failed: ${A.status}`);const M=await A.json();f(M.results||M)}catch(D){E(D.message||"Search failed"),f([])}finally{x(!1)}}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:md,children:y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-end",flexWrap:"wrap"},children:[y.jsxDEV("div",{style:{flex:1,minWidth:200},children:[y.jsxDEV("div",{style:xc,children:"Search Query"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:166,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:t,onChange:D=>e(D.target.value),placeholder:"Search knowledge base...",onKeyDown:D=>D.key==="Enter"&&T()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:167,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:165,columnNumber:11},this),y.jsxDEV("div",{style:{minWidth:100},children:[y.jsxDEV("div",{style:xc,children:"Mode"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:176,columnNumber:13},this),y.jsxDEV("select",{style:{...Zg,width:"auto",minWidth:100},value:n,onChange:D=>s(D.target.value),children:[y.jsxDEV("option",{value:"auto",children:"Auto"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:182,columnNumber:15},this),y.jsxDEV("option",{value:"search",children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:183,columnNumber:15},this),y.jsxDEV("option",{value:"graph",children:"Graph"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:184,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:177,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:175,columnNumber:11},this),y.jsxDEV("div",{style:{minWidth:120},children:[y.jsxDEV("div",{style:xc,children:"Squad (optional)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:188,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:o,onChange:D=>l(D.target.value),placeholder:"filter by squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:189,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:187,columnNumber:11},this),y.jsxDEV("button",{style:RD,onClick:T,disabled:g,children:g?"Searching...":"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:196,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:164,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:163,columnNumber:7},this),h&&y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:[["Documents",h.documents],["Chunks",h.chunks],["Entities",h.entities],["Relations",h.relations]].map(([D,A])=>y.jsxDEV("div",{style:{...md,flex:"1 1 120px",textAlign:"center",padding:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.2rem",fontWeight:700,color:"var(--accent)"},children:A??0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:217,columnNumber:15},this),y.jsxDEV("div",{style:xc,children:D},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:223,columnNumber:15},this)]},D,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:211,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:204,columnNumber:9},this),v&&y.jsxDEV("div",{style:{...md,borderColor:"var(--status-error)",color:"var(--status-error)",fontSize:"0.8rem"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:231,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[u.length===0&&!g&&!v&&y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-4)",color:"var(--text-muted)",fontSize:"0.85rem"},children:"Enter a query to search the knowledge base."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:244,columnNumber:11},this),u.map((D,A)=>{var M;return y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-1)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,background:"var(--accent)",color:"var(--text-inverse)",padding:"2px 6px",borderRadius:"var(--radius-xs)",minWidth:38,textAlign:"center"},children:typeof D.score=="number"?D.score.toFixed(2):"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:256,columnNumber:15},this),y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:D.document_title||"Untitled"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:269,columnNumber:15},this),D.source_type&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)"},children:D.source_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:277,columnNumber:17},this),D.squad_name&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["squad:",D.squad_name]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:289,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:255,columnNumber:13},this),y.jsxDEV("div",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",lineHeight:1.5},children:((M=D.content)==null?void 0:M.length)>200?D.content.slice(0,200)+"...":D.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:298,columnNumber:13},this)]},A,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:254,columnNumber:11},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:242,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:161,columnNumber:5},this)}function Tle(){const[t,e]=O.useState(""),[n,s]=O.useState(""),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(!1),[g,x]=O.useState(""),[v,E]=O.useState(""),S=O.useCallback(async()=>{try{const A=await fetch("/api/knowledge/documents",{credentials:"include"});if(A.ok){const M=await A.json();f(M.documents||M)}}catch{}},[]);O.useEffect(()=>{S()},[S]);const T=async()=>{if(o.trim()){p(!0),x(""),E("");try{const A={content:o};t.trim()&&(A.title=t.trim()),n.trim()&&(A.squad_name=n.trim());const M=await fetch("/api/knowledge/ingest-text",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(!M.ok)throw new Error(`Ingest failed: ${M.status}`);E("Content ingested successfully."),e(""),l(""),s(""),S()}catch(A){x(A.message||"Ingest failed")}finally{p(!1)}}},D=async A=>{if(confirm("Delete this document?"))try{const M=await fetch(`/api/knowledge/documents/${A}`,{method:"DELETE",credentials:"include"});if(!M.ok)throw new Error(`Delete failed: ${M.status}`);S()}catch(M){x(M.message||"Delete failed")}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{flex:1},children:[y.jsxDEV("div",{style:xc,children:"Title"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:387,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:t,onChange:A=>e(A.target.value),placeholder:"Document title"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:388,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:386,columnNumber:11},this),y.jsxDEV("div",{style:{flex:1},children:[y.jsxDEV("div",{style:xc,children:"Squad (optional)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:396,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:n,onChange:A=>s(A.target.value),placeholder:"squad name"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:397,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:395,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:385,columnNumber:9},this),y.jsxDEV("div",{style:xc,children:"Content"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:405,columnNumber:9},this),y.jsxDEV("textarea",{style:{...Zg,minHeight:100,resize:"vertical",fontFamily:"var(--font-mono)"},value:o,onChange:A=>l(A.target.value),placeholder:"Paste content to ingest..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:406,columnNumber:9},this),y.jsxDEV("div",{style:{marginTop:"var(--sp-2)",display:"flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("button",{style:RD,onClick:T,disabled:h,children:h?"Ingesting...":"Ingest"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:418,columnNumber:11},this),v&&y.jsxDEV("span",{style:{fontSize:"0.8rem",color:"var(--status-active)"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:421,columnNumber:23},this),g&&y.jsxDEV("span",{style:{fontSize:"0.8rem",color:"var(--status-error)"},children:g},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:422,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:417,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:384,columnNumber:7},this),y.jsxDEV("div",{style:{...md,flex:1,overflow:"auto",padding:0},children:[y.jsxDEV("div",{style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("span",{style:xc,children:["Documents (",u.length,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:432,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:428,columnNumber:9},this),y.jsxDEV("div",{style:{overflow:"auto"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["ID","Title","Source","Extraction","Ingested",""].map(A=>y.jsxDEV("th",{style:{textAlign:"left",padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:500},children:A},A,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:439,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:437,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:436,columnNumber:13},this),y.jsxDEV("tbody",{children:[u.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:6,style:{padding:"var(--sp-3)",textAlign:"center",color:"var(--text-muted)"},children:"No documents ingested yet."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:455,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:454,columnNumber:17},this),u.map(A=>{var M;return y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:[(M=A.id)==null?void 0:M.slice(0,8),"..."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:466,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",color:"var(--text-primary)"},children:A.title||"Untitled"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:474,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)"},children:A.source_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:477,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:A.extraction_status==="done"?"var(--status-active)":"var(--status-warning)"},children:A.extraction_status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:485,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:A.ingested_at?new Date(A.ingested_at).toLocaleString():"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:493,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)"},children:y.jsxDEV("button",{style:Ale,onClick:()=>D(A.id),children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:502,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:501,columnNumber:19},this)]},A.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:465,columnNumber:17},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:452,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:435,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:434,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:427,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:382,columnNumber:5},this)}function Rle(){const[t,e]=O.useState(""),[n,s]=O.useState([]),[o,l]=O.useState(null),[u,f]=O.useState([]),[h,p]=O.useState(!1),[g,x]=O.useState(!1),[v,E]=O.useState(""),S=O.useCallback(async()=>{p(!0),E("");try{const D=new URLSearchParams({limit:"50"});t.trim()&&D.set("type",t.trim());const A=await fetch(`/api/knowledge/entities?${D}`,{credentials:"include"});if(!A.ok)throw new Error(`Failed to load entities: ${A.status}`);const M=await A.json();s(M.entities||M)}catch(D){E(D.message||"Failed to load entities"),s([])}finally{p(!1)}},[t]);O.useEffect(()=>{S()},[S]);const T=async D=>{l(D),x(!0),f([]);try{const A=await fetch(`/api/knowledge/entities/${D.id}/relations`,{credentials:"include"});if(!A.ok)throw new Error(`Failed to load relations: ${A.status}`);const M=await A.json();f(M.relations||M)}catch(A){E(A.message||"Failed to load relations")}finally{x(!1)}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:{...md,display:"flex",gap:"var(--sp-2)",alignItems:"flex-end"},children:[y.jsxDEV("div",{style:{minWidth:160},children:[y.jsxDEV("div",{style:xc,children:"Entity Type Filter"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:570,columnNumber:11},this),y.jsxDEV("input",{style:Zg,value:t,onChange:D=>e(D.target.value),placeholder:"e.g. person, concept"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:571,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:569,columnNumber:9},this),y.jsxDEV("button",{style:RD,onClick:S,disabled:h,children:h?"Loading...":"Filter"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:578,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:568,columnNumber:7},this),v&&y.jsxDEV("div",{style:{...md,borderColor:"var(--status-error)",color:"var(--status-error)",fontSize:"0.8rem"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:584,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:0},children:y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{...xc,marginBottom:"var(--sp-2)"},children:["Entities (",n.length,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:597,columnNumber:11},this),n.length===0&&!h&&y.jsxDEV("div",{style:{color:"var(--text-muted)",fontSize:"0.85rem",textAlign:"center",padding:"var(--sp-3)"},children:"No entities found."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:601,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:n.map(D=>y.jsxDEV("div",{onClick:()=>T(D),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px var(--sp-2)",borderRadius:"var(--radius-xs)",cursor:"pointer",background:(o==null?void 0:o.id)===D.id?"var(--accent-glow)":"transparent",border:(o==null?void 0:o.id)===D.id?"1px solid var(--accent)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.85rem",color:(o==null?void 0:o.id)===D.id?"var(--accent)":"var(--text-primary)",flex:1},children:D.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:622,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 6px",borderRadius:"var(--radius-xs)"},children:D.type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:630,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",minWidth:30,textAlign:"right"},children:D.mention_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:640,columnNumber:17},this)]},D.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:607,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:605,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:596,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:595,columnNumber:7},this),o&&y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{...xc,marginBottom:"var(--sp-2)"},children:['Relations for "',o.name,'"',g&&y.jsxDEV("span",{style:{marginLeft:8,color:"var(--text-muted)"},children:"loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:660,columnNumber:34},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:658,columnNumber:11},this),u.length===0&&!g&&y.jsxDEV("div",{style:{color:"var(--text-muted)",fontSize:"0.8rem"},children:"No relations found."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:663,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:u.map((D,A)=>y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px var(--sp-2)",fontSize:"0.8rem",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{style:{color:"var(--accent)",fontWeight:600},children:D.source_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:677,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 6px",borderRadius:"var(--radius-xs)"},children:D.relation_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:678,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-primary)",fontWeight:600},children:D.target_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:688,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",marginLeft:"auto"},children:["w:",typeof D.weight=="number"?D.weight.toFixed(2):"—"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:689,columnNumber:17},this)]},D.id||A,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:669,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:667,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:657,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:566,columnNumber:5},this)}function jle(){const[t,e]=O.useState("explorer");return y.jsxDEV("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"var(--surface-1)",color:"var(--text-primary)"},children:[y.jsxDEV("div",{style:Sle,children:[["explorer","Explorer"],["ingest","Ingest"],["graph","Graph"]].map(([n,s])=>y.jsxDEV("button",{style:Dle(t===n),onClick:()=>e(n),children:s},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:726,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:720,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",padding:"var(--sp-3)"},children:[t==="explorer"&&y.jsxDEV(Cle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:742,columnNumber:32},this),t==="ingest"&&y.jsxDEV(Tle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:743,columnNumber:30},this),t==="graph"&&y.jsxDEV(Rle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:744,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:737,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:712,columnNumber:5},this)}const kle={info:{color:"#3b82f6",label:"INFO"},warn:{color:"#f59e0b",label:"WARN"},error:{color:"#ef4444",label:"ERROR"}};function Mle(t){return new Date(t).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Vle(){const t=al(g=>g.entries),e=al(g=>g.filter),n=al(g=>g.pinToBottom),s=al(g=>g.setFilter),o=al(g=>g.setPinToBottom),l=al(g=>g.fetchLogs),u=al(g=>g.clear),f=Ps(g=>g.squads),h=O.useRef(null);O.useEffect(()=>{l()},[l]),O.useEffect(()=>{n&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[t,n]);const p=O.useMemo(()=>t.filter(g=>{var x;if(e.level!=="all"&&g.level!==e.level||e.squad&&g.squadCode!==e.squad)return!1;if(e.search){const v=e.search.toLowerCase();if(!g.message.toLowerCase().includes(v)&&!((x=g.detail)!=null&&x.toLowerCase().includes(v)))return!1}return!0}),[t,e]);return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--font-mono)"},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0,flexWrap:"wrap"},children:[y.jsxDEV("select",{value:e.level,onChange:g=>s({level:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"all",children:"All Levels"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:65,columnNumber:11},this),y.jsxDEV("option",{value:"info",children:"Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:66,columnNumber:11},this),y.jsxDEV("option",{value:"warn",children:"Warning"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:67,columnNumber:11},this),y.jsxDEV("option",{value:"error",children:"Error"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:68,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:56,columnNumber:9},this),y.jsxDEV("select",{value:e.squad,onChange:g=>s({squad:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"",children:"All Squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:80,columnNumber:11},this),f.map(g=>y.jsxDEV("option",{value:g.code,children:g.name},g.code,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:82,columnNumber:13},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:71,columnNumber:9},this),y.jsxDEV("input",{type:"text",placeholder:"Search...",value:e.search,onChange:g=>s({search:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:86,columnNumber:9},this),y.jsxDEV("label",{style:{display:"flex",alignItems:"center",gap:4,fontSize:"0.7rem",color:"var(--text-muted)",cursor:"pointer"},children:[y.jsxDEV("input",{type:"checkbox",checked:n,onChange:g=>o(g.target.checked),style:{accentColor:"var(--accent)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:99,columnNumber:11},this),"Auto-scroll"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:98,columnNumber:9},this),y.jsxDEV("button",{onClick:()=>u(),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 10px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"Clear"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:108,columnNumber:9},this),y.jsxDEV("span",{style:{fontSize:"0.65rem",color:"var(--text-muted)"},children:[p.length," entries"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:117,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:52,columnNumber:7},this),y.jsxDEV("div",{ref:h,style:{flex:1,overflow:"auto",padding:"4px 0"},children:p.length===0?y.jsxDEV("div",{style:{padding:40,textAlign:"center",color:"var(--text-muted)",fontSize:"0.8rem"},children:"No log entries yet. Events will appear here as pipelines run."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:125,columnNumber:11},this):p.map(g=>{const x=kle[g.level];return y.jsxDEV("div",{style:{display:"flex",gap:8,padding:"3px 16px",fontSize:"0.73rem",borderBottom:"1px solid var(--surface-3)",alignItems:"flex-start"},children:[y.jsxDEV("span",{style:{color:"var(--text-muted)",flexShrink:0,width:60},children:Mle(g.createdAt)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:137,columnNumber:17},this),y.jsxDEV("span",{style:{color:x.color,fontWeight:700,flexShrink:0,width:40,fontSize:"0.65rem",marginTop:1},children:x.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:140,columnNumber:17},this),g.squadCode&&y.jsxDEV("span",{style:{color:"var(--accent)",flexShrink:0,maxWidth:100,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.squadCode},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:145,columnNumber:19},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",flexShrink:0},children:["[",g.source,"]"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:150,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-primary)",flex:1,wordBreak:"break-word"},children:[g.message,g.detail&&y.jsxDEV("span",{style:{color:"var(--text-muted)",marginLeft:6},children:g.detail},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:154,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:151,columnNumber:17},this)]},g.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:132,columnNumber:15},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:123,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:50,columnNumber:5},this)}const Ule=localStorage.getItem("expx-theme")||"dark";document.documentElement.setAttribute("data-theme",Ule);const Ple=O.lazy(()=>$f(()=>import("./JarvisView-BdZ-LyU8.js"),[]).then(t=>({default:t.JarvisView})));tL.createRoot(document.getElementById("root")).render(y.jsxDEV(O.StrictMode,{children:y.jsxDEV(SB,{children:y.jsxDEV(tB,{children:[y.jsxDEV(ri,{path:"/login",element:y.jsxDEV(w7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:33,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:33,columnNumber:9},void 0),y.jsxDEV(ri,{path:"/",element:y.jsxDEV(E7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:34,columnNumber:34},void 0),children:[y.jsxDEV(ri,{index:!0,element:y.jsxDEV(JL,{to:"/office",replace:!0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:35,columnNumber:33},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:35,columnNumber:11},void 0),y.jsxDEV(ri,{path:"office",element:y.jsxDEV(QG,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:36,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:36,columnNumber:11},void 0),y.jsxDEV(ri,{path:"chat",element:y.jsxDEV(Tee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:37,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:37,columnNumber:11},void 0),y.jsxDEV(ri,{path:"kanban",element:y.jsxDEV(Vee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:38,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:38,columnNumber:11},void 0),y.jsxDEV(ri,{path:"settings",element:y.jsxDEV(Fee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:39,columnNumber:43},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:39,columnNumber:11},void 0),y.jsxDEV(ri,{path:"scheduler",element:y.jsxDEV(Xee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:40,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:40,columnNumber:11},void 0),y.jsxDEV(ri,{path:"email",element:y.jsxDEV(Zee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:41,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:41,columnNumber:11},void 0),y.jsxDEV(ri,{path:"orgchart",element:y.jsxDEV(dle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:42,columnNumber:43},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:42,columnNumber:11},void 0),y.jsxDEV(ri,{path:"graph",element:y.jsxDEV(ple,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:43,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:43,columnNumber:11},void 0),y.jsxDEV(ri,{path:"files",element:y.jsxDEV(gle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:44,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:44,columnNumber:11},void 0),y.jsxDEV(ri,{path:"dashboard",element:y.jsxDEV(yle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:45,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:45,columnNumber:11},void 0),y.jsxDEV(ri,{path:"docs",element:y.jsxDEV(Ele,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:46,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:46,columnNumber:11},void 0),y.jsxDEV(ri,{path:"knowledge",element:y.jsxDEV(jle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:47,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:47,columnNumber:11},void 0),y.jsxDEV(ri,{path:"marketplace",element:y.jsxDEV(a8,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:48,columnNumber:46},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:48,columnNumber:11},void 0),y.jsxDEV(ri,{path:"logs",element:y.jsxDEV(Vle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:49,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:49,columnNumber:11},void 0),y.jsxDEV(ri,{path:"jarvis",element:y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(Ple,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:67},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:11},void 0)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:34,columnNumber:9},void 0)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:32,columnNumber:7},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:31,columnNumber:5},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:30,columnNumber:3},void 0));export{gH as $,Q5 as A,B1 as B,si as C,ul as D,bd as E,Qf as F,ha as G,M9 as H,sj as I,l7 as J,s_ as K,sU as L,Sn as M,_S as N,nj as O,ao as P,X5 as Q,QT as R,P9 as S,ur as T,MS as U,du as V,I5 as W,uR as X,cH as Y,fH as Z,yH as _,zle as a,aD as a0,ob as a1,q7 as a2,r_ as a3,rj as a4,_H as a5,pa as a6,p5 as a7,cu as a8,iD as a9,IV as aa,rv as ab,nF as ac,vI as ad,qV as ae,yC as af,FV as ag,_I as ah,tv as ai,ws as aj,x5 as ak,Sq as al,Z5 as am,Ln as an,n_ as ao,ps as ap,S9 as aq,v9 as ar,Y9 as as,L9 as at,dH as au,hH as av,vH as aw,xH as ax,EH as ay,lC as b,au as c,Ps as d,n9 as e,fa as f,GI as g,gs as h,pr as i,y as j,ES as k,hn as l,b5 as m,zH as n,lD as o,TH as p,uD as q,O as r,QO as s,A5 as t,jS as u,Zr as v,qo as w,Fy as x,rI as y,Pi as z};
1195
+ Refresh the page to see it in your squads list.`)}else{const z=await P.json();alert(`Failed to install: ${z.error}`)}}catch{alert("Failed to install squad")}finally{v(null)}}}function M(j){j.preventDefault(),D()}return y.jsxDEV("div",{style:{padding:"var(--sp-6)",maxWidth:1200,margin:"0 auto"},children:[y.jsxDEV("div",{style:{marginBottom:"var(--sp-6)"},children:[y.jsxDEV("h1",{style:{fontFamily:"var(--font-display)",fontSize:"1.5rem",fontWeight:700,marginBottom:"var(--sp-2)"},children:"🏪 Squad Marketplace"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:121,columnNumber:9},this),y.jsxDEV("p",{style:{color:"var(--text-muted)",fontSize:"0.9rem"},children:"Discover, share, and install AI agent squads from the community."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:129,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:120,columnNumber:7},this),y.jsxDEV("form",{onSubmit:M,style:{display:"flex",gap:"var(--sp-3)",marginBottom:"var(--sp-4)"},children:[y.jsxDEV("input",{type:"text",placeholder:"Search squads...",value:f,onChange:j=>h(j.target.value),style:{flex:1,padding:"8px 12px",borderRadius:6,border:"1px solid var(--border-subtle)",background:"var(--surface-2)",color:"var(--text-primary)",fontSize:"0.9rem"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:140,columnNumber:9},this),y.jsxDEV("button",{type:"submit",style:{padding:"8px 16px",borderRadius:6,border:"none",background:"var(--accent)",color:"var(--text-inverse)",cursor:"pointer",fontWeight:600},children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:155,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:135,columnNumber:7},this),y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-4)",flexWrap:"wrap"},children:[y.jsxDEV("button",{onClick:()=>{g(null),D()},style:{padding:"6px 12px",borderRadius:20,border:p===null?"2px solid var(--accent)":"1px solid var(--border-subtle)",background:p===null?"var(--accent-dim)":"transparent",color:p===null?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontSize:"0.8rem",fontWeight:p===null?600:400},children:"All"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:178,columnNumber:9},this),e.map(j=>y.jsxDEV("button",{onClick:()=>{g(j.id),D()},style:{padding:"6px 12px",borderRadius:20,border:p===j.id?"2px solid var(--accent)":"1px solid var(--border-subtle)",background:p===j.id?"var(--accent-dim)":"transparent",color:p===j.id?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontSize:"0.8rem",fontWeight:p===j.id?600:400},children:[j.icon," ",j.name]},j.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:194,columnNumber:11},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:172,columnNumber:7},this),l?y.jsxDEV("div",{style:{textAlign:"center",padding:40,color:"var(--text-muted)"},children:"Loading squads..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:215,columnNumber:9},this):s.length===0?y.jsxDEV("div",{style:{textAlign:"center",padding:60,color:"var(--text-muted)",border:"2px dashed var(--border-subtle)",borderRadius:12},children:[y.jsxDEV("div",{style:{fontSize:"3rem",marginBottom:"var(--sp-3)"},children:"📦"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:226,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"1rem",marginBottom:"var(--sp-2)"},children:"No squads found"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:227,columnNumber:11},this),y.jsxDEV("p",{style:{fontSize:"0.85rem"},children:"Be the first to publish a squad to the marketplace!"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:228,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:219,columnNumber:9},this):y.jsxDEV("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:"var(--sp-4)"},children:s.map(j=>y.jsxDEV(_le,{squad:j,onInstall:()=>A(j),installing:x===j.id},j.id,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:239,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:233,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:114,columnNumber:5},this)}function _le({squad:t,onInstall:e,installing:n}){return y.jsxDEV("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:12,padding:"var(--sp-4)",display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[y.jsxDEV("div",{style:{width:40,height:40,borderRadius:8,background:"var(--accent-dim)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem"},children:wle(t.icon||"default")},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:273,columnNumber:9},this),y.jsxDEV("div",{children:[y.jsxDEV("h3",{style:{fontWeight:600,fontSize:"0.95rem",marginBottom:2},children:t.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:286,columnNumber:11},this),y.jsxDEV("code",{style:{fontSize:"0.7rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:4},children:t.fullName},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:289,columnNumber:11},this),t.latestVersion&&y.jsxDEV("span",{style:{fontSize:"0.65rem",padding:"2px 6px",borderRadius:4,background:"var(--accent-dim)",color:"var(--accent)",marginLeft:4},children:["v",t.latestVersion]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:299,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:285,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:272,columnNumber:7},this),y.jsxDEV("p",{style:{fontSize:"0.85rem",color:"var(--text-secondary)",lineHeight:1.5,flex:1,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:t.description},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:314,columnNumber:7},this),t.tags.length>0&&y.jsxDEV("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.tags.slice(0,3).map(s=>y.jsxDEV("span",{style:{fontSize:"0.65rem",padding:"2px 6px",borderRadius:4,background:"var(--surface-3)",color:"var(--text-muted)"},children:s},s,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:331,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:329,columnNumber:9},this),y.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--text-muted)",paddingTop:"var(--sp-2)",borderTop:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{children:["📥 ",t.downloads]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:356,columnNumber:9},this),y.jsxDEV("span",{children:["⭐ ",t.rating.toFixed(1)," (",t.ratingCount,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:357,columnNumber:9},this),y.jsxDEV("span",{children:["@",t.scope]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:358,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:348,columnNumber:7},this),y.jsxDEV("button",{onClick:e,disabled:n,style:{padding:"8px 16px",borderRadius:6,border:"none",background:n?"var(--surface-3)":"var(--accent)",color:n?"var(--text-muted)":"var(--text-inverse)",cursor:n?"not-allowed":"pointer",fontWeight:600,fontSize:"0.85rem"},children:n?"Installing...":"Install Squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:362,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/MarketplaceView.tsx",lineNumber:262,columnNumber:5},this)}function wle(t){const e={rocket:"🚀",folder:"📁",code:"💻",chat:"💬",search:"🔍",chart:"📊",users:"👥",tools:"🔧",default:"📦"};return e[t]??e.default}const Nle=Object.freeze(Object.defineProperty({__proto__:null,MarketplaceView:a8},Symbol.toStringTag,{value:"Module"})),Sle={display:"flex",gap:"var(--sp-1)",padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"};function Dle(t){return{padding:"6px 16px",border:"none",borderBottom:t?"2px solid var(--accent)":"2px solid transparent",background:"none",color:t?"var(--accent)":"var(--text-secondary)",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:t?600:400,cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"}}const md={background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)"},Zg={background:"var(--surface-0)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-xs)",padding:"6px 10px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",outline:"none",width:"100%"},RD={padding:"6px 14px",background:"var(--accent)",color:"var(--text-inverse)",border:"none",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-display)",fontSize:"0.8rem",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},Ale={...RD,background:"var(--status-error)",fontSize:"0.7rem",padding:"3px 8px"},xc={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:4};function Cle(){const[t,e]=O.useState(""),[n,s]=O.useState("auto"),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(null),[g,x]=O.useState(!1),[v,E]=O.useState(""),S=O.useCallback(async()=>{try{const D=await fetch("/api/knowledge/stats",{credentials:"include"});if(D.ok){const A=await D.json();p(A)}}catch{}},[]);O.useEffect(()=>{S()},[S]);const T=async()=>{if(t.trim()){x(!0),E("");try{const D=new URLSearchParams({q:t,mode:n,limit:"10"});o.trim()&&D.set("squad",o.trim());const A=await fetch(`/api/knowledge/query?${D}`,{credentials:"include"});if(!A.ok)throw new Error(`Search failed: ${A.status}`);const M=await A.json();f(M.results||M)}catch(D){E(D.message||"Search failed"),f([])}finally{x(!1)}}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:md,children:y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",alignItems:"flex-end",flexWrap:"wrap"},children:[y.jsxDEV("div",{style:{flex:1,minWidth:200},children:[y.jsxDEV("div",{style:xc,children:"Search Query"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:166,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:t,onChange:D=>e(D.target.value),placeholder:"Search knowledge base...",onKeyDown:D=>D.key==="Enter"&&T()},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:167,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:165,columnNumber:11},this),y.jsxDEV("div",{style:{minWidth:100},children:[y.jsxDEV("div",{style:xc,children:"Mode"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:176,columnNumber:13},this),y.jsxDEV("select",{style:{...Zg,width:"auto",minWidth:100},value:n,onChange:D=>s(D.target.value),children:[y.jsxDEV("option",{value:"auto",children:"Auto"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:182,columnNumber:15},this),y.jsxDEV("option",{value:"search",children:"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:183,columnNumber:15},this),y.jsxDEV("option",{value:"graph",children:"Graph"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:184,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:177,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:175,columnNumber:11},this),y.jsxDEV("div",{style:{minWidth:120},children:[y.jsxDEV("div",{style:xc,children:"Squad (optional)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:188,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:o,onChange:D=>l(D.target.value),placeholder:"filter by squad"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:189,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:187,columnNumber:11},this),y.jsxDEV("button",{style:RD,onClick:T,disabled:g,children:g?"Searching...":"Search"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:196,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:164,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:163,columnNumber:7},this),h&&y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:[["Documents",h.documents],["Chunks",h.chunks],["Entities",h.entities],["Relations",h.relations]].map(([D,A])=>y.jsxDEV("div",{style:{...md,flex:"1 1 120px",textAlign:"center",padding:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{fontFamily:"var(--font-mono)",fontSize:"1.2rem",fontWeight:700,color:"var(--accent)"},children:A??0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:217,columnNumber:15},this),y.jsxDEV("div",{style:xc,children:D},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:223,columnNumber:15},this)]},D,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:211,columnNumber:13},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:204,columnNumber:9},this),v&&y.jsxDEV("div",{style:{...md,borderColor:"var(--status-error)",color:"var(--status-error)",fontSize:"0.8rem"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:231,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:[u.length===0&&!g&&!v&&y.jsxDEV("div",{style:{textAlign:"center",padding:"var(--sp-4)",color:"var(--text-muted)",fontSize:"0.85rem"},children:"Enter a query to search the knowledge base."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:244,columnNumber:11},this),u.map((D,A)=>{var M;return y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-1)"},children:[y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:700,background:"var(--accent)",color:"var(--text-inverse)",padding:"2px 6px",borderRadius:"var(--radius-xs)",minWidth:38,textAlign:"center"},children:typeof D.score=="number"?D.score.toFixed(2):"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:256,columnNumber:15},this),y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--text-primary)"},children:D.document_title||"Untitled"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:269,columnNumber:15},this),D.source_type&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)"},children:D.source_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:277,columnNumber:17},this),D.squad_name&&y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:["squad:",D.squad_name]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:289,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:255,columnNumber:13},this),y.jsxDEV("div",{style:{fontSize:"0.8rem",color:"var(--text-secondary)",lineHeight:1.5},children:((M=D.content)==null?void 0:M.length)>200?D.content.slice(0,200)+"...":D.content},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:298,columnNumber:13},this)]},A,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:254,columnNumber:11},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:242,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:161,columnNumber:5},this)}function Tle(){const[t,e]=O.useState(""),[n,s]=O.useState(""),[o,l]=O.useState(""),[u,f]=O.useState([]),[h,p]=O.useState(!1),[g,x]=O.useState(""),[v,E]=O.useState(""),S=O.useCallback(async()=>{try{const A=await fetch("/api/knowledge/documents",{credentials:"include"});if(A.ok){const M=await A.json();f(M.documents||M)}}catch{}},[]);O.useEffect(()=>{S()},[S]);const T=async()=>{if(o.trim()){p(!0),x(""),E("");try{const A={content:o};t.trim()&&(A.title=t.trim()),n.trim()&&(A.squad_name=n.trim());const M=await fetch("/api/knowledge/ingest-text",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)});if(!M.ok)throw new Error(`Ingest failed: ${M.status}`);E("Content ingested successfully."),e(""),l(""),s(""),S()}catch(A){x(A.message||"Ingest failed")}finally{p(!1)}}},D=async A=>{if(confirm("Delete this document?"))try{const M=await fetch(`/api/knowledge/documents/${A}`,{method:"DELETE",credentials:"include"});if(!M.ok)throw new Error(`Delete failed: ${M.status}`);S()}catch(M){x(M.message||"Delete failed")}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-2)"},children:[y.jsxDEV("div",{style:{flex:1},children:[y.jsxDEV("div",{style:xc,children:"Title"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:387,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:t,onChange:A=>e(A.target.value),placeholder:"Document title"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:388,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:386,columnNumber:11},this),y.jsxDEV("div",{style:{flex:1},children:[y.jsxDEV("div",{style:xc,children:"Squad (optional)"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:396,columnNumber:13},this),y.jsxDEV("input",{style:Zg,value:n,onChange:A=>s(A.target.value),placeholder:"squad name"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:397,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:395,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:385,columnNumber:9},this),y.jsxDEV("div",{style:xc,children:"Content"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:405,columnNumber:9},this),y.jsxDEV("textarea",{style:{...Zg,minHeight:100,resize:"vertical",fontFamily:"var(--font-mono)"},value:o,onChange:A=>l(A.target.value),placeholder:"Paste content to ingest..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:406,columnNumber:9},this),y.jsxDEV("div",{style:{marginTop:"var(--sp-2)",display:"flex",gap:"var(--sp-2)",alignItems:"center"},children:[y.jsxDEV("button",{style:RD,onClick:T,disabled:h,children:h?"Ingesting...":"Ingest"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:418,columnNumber:11},this),v&&y.jsxDEV("span",{style:{fontSize:"0.8rem",color:"var(--status-active)"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:421,columnNumber:23},this),g&&y.jsxDEV("span",{style:{fontSize:"0.8rem",color:"var(--status-error)"},children:g},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:422,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:417,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:384,columnNumber:7},this),y.jsxDEV("div",{style:{...md,flex:1,overflow:"auto",padding:0},children:[y.jsxDEV("div",{style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"1px solid var(--border-subtle)"},children:y.jsxDEV("span",{style:xc,children:["Documents (",u.length,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:432,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:428,columnNumber:9},this),y.jsxDEV("div",{style:{overflow:"auto"},children:y.jsxDEV("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.8rem"},children:[y.jsxDEV("thead",{children:y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["ID","Title","Source","Extraction","Ingested",""].map(A=>y.jsxDEV("th",{style:{textAlign:"left",padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:500},children:A},A,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:439,columnNumber:19},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:437,columnNumber:15},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:436,columnNumber:13},this),y.jsxDEV("tbody",{children:[u.length===0&&y.jsxDEV("tr",{children:y.jsxDEV("td",{colSpan:6,style:{padding:"var(--sp-3)",textAlign:"center",color:"var(--text-muted)"},children:"No documents ingested yet."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:455,columnNumber:19},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:454,columnNumber:17},this),u.map(A=>{var M;return y.jsxDEV("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:[(M=A.id)==null?void 0:M.slice(0,8),"..."]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:466,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",color:"var(--text-primary)"},children:A.title||"Untitled"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:474,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)"},children:A.source_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:477,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:A.extraction_status==="done"?"var(--status-active)":"var(--status-warning)"},children:A.extraction_status},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:485,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:A.ingested_at?new Date(A.ingested_at).toLocaleString():"—"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:493,columnNumber:19},this),y.jsxDEV("td",{style:{padding:"6px var(--sp-2)"},children:y.jsxDEV("button",{style:Ale,onClick:()=>D(A.id),children:"Delete"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:502,columnNumber:21},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:501,columnNumber:19},this)]},A.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:465,columnNumber:17},this)})]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:452,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:435,columnNumber:11},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:434,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:427,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:382,columnNumber:5},this)}function Rle(){const[t,e]=O.useState(""),[n,s]=O.useState([]),[o,l]=O.useState(null),[u,f]=O.useState([]),[h,p]=O.useState(!1),[g,x]=O.useState(!1),[v,E]=O.useState(""),S=O.useCallback(async()=>{p(!0),E("");try{const D=new URLSearchParams({limit:"50"});t.trim()&&D.set("type",t.trim());const A=await fetch(`/api/knowledge/entities?${D}`,{credentials:"include"});if(!A.ok)throw new Error(`Failed to load entities: ${A.status}`);const M=await A.json();s(M.entities||M)}catch(D){E(D.message||"Failed to load entities"),s([])}finally{p(!1)}},[t]);O.useEffect(()=>{S()},[S]);const T=async D=>{l(D),x(!0),f([]);try{const A=await fetch(`/api/knowledge/entities/${D.id}/relations`,{credentials:"include"});if(!A.ok)throw new Error(`Failed to load relations: ${A.status}`);const M=await A.json();f(M.relations||M)}catch(A){E(A.message||"Failed to load relations")}finally{x(!1)}};return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)",height:"100%"},children:[y.jsxDEV("div",{style:{...md,display:"flex",gap:"var(--sp-2)",alignItems:"flex-end"},children:[y.jsxDEV("div",{style:{minWidth:160},children:[y.jsxDEV("div",{style:xc,children:"Entity Type Filter"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:570,columnNumber:11},this),y.jsxDEV("input",{style:Zg,value:t,onChange:D=>e(D.target.value),placeholder:"e.g. person, concept"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:571,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:569,columnNumber:9},this),y.jsxDEV("button",{style:RD,onClick:S,disabled:h,children:h?"Loading...":"Filter"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:578,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:568,columnNumber:7},this),v&&y.jsxDEV("div",{style:{...md,borderColor:"var(--status-error)",color:"var(--status-error)",fontSize:"0.8rem"},children:v},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:584,columnNumber:9},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:0},children:y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{...xc,marginBottom:"var(--sp-2)"},children:["Entities (",n.length,")"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:597,columnNumber:11},this),n.length===0&&!h&&y.jsxDEV("div",{style:{color:"var(--text-muted)",fontSize:"0.85rem",textAlign:"center",padding:"var(--sp-3)"},children:"No entities found."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:601,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:n.map(D=>y.jsxDEV("div",{onClick:()=>T(D),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"6px var(--sp-2)",borderRadius:"var(--radius-xs)",cursor:"pointer",background:(o==null?void 0:o.id)===D.id?"var(--accent-glow)":"transparent",border:(o==null?void 0:o.id)===D.id?"1px solid var(--accent)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"},children:[y.jsxDEV("span",{style:{fontWeight:600,fontSize:"0.85rem",color:(o==null?void 0:o.id)===D.id?"var(--accent)":"var(--text-primary)",flex:1},children:D.name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:622,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 6px",borderRadius:"var(--radius-xs)"},children:D.type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:630,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",minWidth:30,textAlign:"right"},children:D.mention_count},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:640,columnNumber:17},this)]},D.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:607,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:605,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:596,columnNumber:9},this)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:595,columnNumber:7},this),o&&y.jsxDEV("div",{style:md,children:[y.jsxDEV("div",{style:{...xc,marginBottom:"var(--sp-2)"},children:['Relations for "',o.name,'"',g&&y.jsxDEV("span",{style:{marginLeft:8,color:"var(--text-muted)"},children:"loading..."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:660,columnNumber:34},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:658,columnNumber:11},this),u.length===0&&!g&&y.jsxDEV("div",{style:{color:"var(--text-muted)",fontSize:"0.8rem"},children:"No relations found."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:663,columnNumber:13},this),y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-1)"},children:u.map((D,A)=>y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"4px var(--sp-2)",fontSize:"0.8rem",borderBottom:"1px solid var(--border-subtle)"},children:[y.jsxDEV("span",{style:{color:"var(--accent)",fontWeight:600},children:D.source_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:677,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"1px 6px",borderRadius:"var(--radius-xs)"},children:D.relation_type},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:678,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-primary)",fontWeight:600},children:D.target_name},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:688,columnNumber:17},this),y.jsxDEV("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",marginLeft:"auto"},children:["w:",typeof D.weight=="number"?D.weight.toFixed(2):"—"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:689,columnNumber:17},this)]},D.id||A,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:669,columnNumber:15},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:667,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:657,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:566,columnNumber:5},this)}function jle(){const[t,e]=O.useState("explorer");return y.jsxDEV("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"var(--surface-1)",color:"var(--text-primary)"},children:[y.jsxDEV("div",{style:Sle,children:[["explorer","Explorer"],["ingest","Ingest"],["graph","Graph"]].map(([n,s])=>y.jsxDEV("button",{style:Dle(t===n),onClick:()=>e(n),children:s},n,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:726,columnNumber:11},this))},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:720,columnNumber:7},this),y.jsxDEV("div",{style:{flex:1,overflow:"auto",padding:"var(--sp-3)"},children:[t==="explorer"&&y.jsxDEV(Cle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:742,columnNumber:32},this),t==="ingest"&&y.jsxDEV(Tle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:743,columnNumber:30},this),t==="graph"&&y.jsxDEV(Rle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:744,columnNumber:29},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:737,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/KnowledgeView.tsx",lineNumber:712,columnNumber:5},this)}const kle={info:{color:"#3b82f6",label:"INFO"},warn:{color:"#f59e0b",label:"WARN"},error:{color:"#ef4444",label:"ERROR"}};function Mle(t){return new Date(t).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Vle(){const t=al(g=>g.entries),e=al(g=>g.filter),n=al(g=>g.pinToBottom),s=al(g=>g.setFilter),o=al(g=>g.setPinToBottom),l=al(g=>g.fetchLogs),u=al(g=>g.clear),f=Ps(g=>g.squads),h=O.useRef(null);O.useEffect(()=>{l()},[l]),O.useEffect(()=>{n&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[t,n]);const p=O.useMemo(()=>t.filter(g=>{var x;if(e.level!=="all"&&g.level!==e.level||e.squad&&g.squadCode!==e.squad)return!1;if(e.search){const v=e.search.toLowerCase();if(!g.message.toLowerCase().includes(v)&&!((x=g.detail)!=null&&x.toLowerCase().includes(v)))return!1}return!0}),[t,e]);return y.jsxDEV("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--font-mono)"},children:[y.jsxDEV("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 16px",borderBottom:"1px solid var(--border-subtle)",flexShrink:0,flexWrap:"wrap"},children:[y.jsxDEV("select",{value:e.level,onChange:g=>s({level:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"all",children:"All Levels"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:65,columnNumber:11},this),y.jsxDEV("option",{value:"info",children:"Info"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:66,columnNumber:11},this),y.jsxDEV("option",{value:"warn",children:"Warning"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:67,columnNumber:11},this),y.jsxDEV("option",{value:"error",children:"Error"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:68,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:56,columnNumber:9},this),y.jsxDEV("select",{value:e.squad,onChange:g=>s({squad:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:[y.jsxDEV("option",{value:"",children:"All Squads"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:80,columnNumber:11},this),f.map(g=>y.jsxDEV("option",{value:g.code,children:g.name},g.code,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:82,columnNumber:13},this))]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:71,columnNumber:9},this),y.jsxDEV("input",{type:"text",placeholder:"Search...",value:e.search,onChange:g=>s({search:g.target.value}),style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 8px",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",flex:1,minWidth:120}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:86,columnNumber:9},this),y.jsxDEV("label",{style:{display:"flex",alignItems:"center",gap:4,fontSize:"0.7rem",color:"var(--text-muted)",cursor:"pointer"},children:[y.jsxDEV("input",{type:"checkbox",checked:n,onChange:g=>o(g.target.checked),style:{accentColor:"var(--accent)"}},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:99,columnNumber:11},this),"Auto-scroll"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:98,columnNumber:9},this),y.jsxDEV("button",{onClick:()=>u(),style:{background:"none",border:"1px solid var(--border-subtle)",borderRadius:4,padding:"4px 10px",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer"},children:"Clear"},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:108,columnNumber:9},this),y.jsxDEV("span",{style:{fontSize:"0.65rem",color:"var(--text-muted)"},children:[p.length," entries"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:117,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:52,columnNumber:7},this),y.jsxDEV("div",{ref:h,style:{flex:1,overflow:"auto",padding:"4px 0"},children:p.length===0?y.jsxDEV("div",{style:{padding:40,textAlign:"center",color:"var(--text-muted)",fontSize:"0.8rem"},children:"No log entries yet. Events will appear here as pipelines run."},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:125,columnNumber:11},this):p.map(g=>{const x=kle[g.level];return y.jsxDEV("div",{style:{display:"flex",gap:8,padding:"3px 16px",fontSize:"0.73rem",borderBottom:"1px solid var(--surface-3)",alignItems:"flex-start"},children:[y.jsxDEV("span",{style:{color:"var(--text-muted)",flexShrink:0,width:60},children:Mle(g.createdAt)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:137,columnNumber:17},this),y.jsxDEV("span",{style:{color:x.color,fontWeight:700,flexShrink:0,width:40,fontSize:"0.65rem",marginTop:1},children:x.label},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:140,columnNumber:17},this),g.squadCode&&y.jsxDEV("span",{style:{color:"var(--accent)",flexShrink:0,maxWidth:100,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g.squadCode},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:145,columnNumber:19},this),y.jsxDEV("span",{style:{color:"var(--text-muted)",flexShrink:0},children:["[",g.source,"]"]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:150,columnNumber:17},this),y.jsxDEV("span",{style:{color:"var(--text-primary)",flex:1,wordBreak:"break-word"},children:[g.message,g.detail&&y.jsxDEV("span",{style:{color:"var(--text-muted)",marginLeft:6},children:g.detail},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:154,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:151,columnNumber:17},this)]},g.id,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:132,columnNumber:15},this)})},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:123,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/views/LogsView.tsx",lineNumber:50,columnNumber:5},this)}const Ule=localStorage.getItem("expx-theme")||"dark";document.documentElement.setAttribute("data-theme",Ule);const Ple=O.lazy(()=>$f(()=>import("./JarvisView-Dmq_aalx.js"),[]).then(t=>({default:t.JarvisView})));tL.createRoot(document.getElementById("root")).render(y.jsxDEV(O.StrictMode,{children:y.jsxDEV(SB,{children:y.jsxDEV(tB,{children:[y.jsxDEV(ri,{path:"/login",element:y.jsxDEV(w7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:33,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:33,columnNumber:9},void 0),y.jsxDEV(ri,{path:"/",element:y.jsxDEV(E7,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:34,columnNumber:34},void 0),children:[y.jsxDEV(ri,{index:!0,element:y.jsxDEV(JL,{to:"/office",replace:!0},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:35,columnNumber:33},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:35,columnNumber:11},void 0),y.jsxDEV(ri,{path:"office",element:y.jsxDEV(QG,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:36,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:36,columnNumber:11},void 0),y.jsxDEV(ri,{path:"chat",element:y.jsxDEV(Tee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:37,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:37,columnNumber:11},void 0),y.jsxDEV(ri,{path:"kanban",element:y.jsxDEV(Vee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:38,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:38,columnNumber:11},void 0),y.jsxDEV(ri,{path:"settings",element:y.jsxDEV(Fee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:39,columnNumber:43},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:39,columnNumber:11},void 0),y.jsxDEV(ri,{path:"scheduler",element:y.jsxDEV(Xee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:40,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:40,columnNumber:11},void 0),y.jsxDEV(ri,{path:"email",element:y.jsxDEV(Zee,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:41,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:41,columnNumber:11},void 0),y.jsxDEV(ri,{path:"orgchart",element:y.jsxDEV(dle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:42,columnNumber:43},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:42,columnNumber:11},void 0),y.jsxDEV(ri,{path:"graph",element:y.jsxDEV(ple,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:43,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:43,columnNumber:11},void 0),y.jsxDEV(ri,{path:"files",element:y.jsxDEV(gle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:44,columnNumber:40},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:44,columnNumber:11},void 0),y.jsxDEV(ri,{path:"dashboard",element:y.jsxDEV(yle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:45,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:45,columnNumber:11},void 0),y.jsxDEV(ri,{path:"docs",element:y.jsxDEV(Ele,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:46,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:46,columnNumber:11},void 0),y.jsxDEV(ri,{path:"knowledge",element:y.jsxDEV(jle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:47,columnNumber:44},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:47,columnNumber:11},void 0),y.jsxDEV(ri,{path:"marketplace",element:y.jsxDEV(a8,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:48,columnNumber:46},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:48,columnNumber:11},void 0),y.jsxDEV(ri,{path:"logs",element:y.jsxDEV(Vle,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:49,columnNumber:39},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:49,columnNumber:11},void 0),y.jsxDEV(ri,{path:"jarvis",element:y.jsxDEV(O.Suspense,{fallback:null,children:y.jsxDEV(Ple,{},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:67},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:41},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:50,columnNumber:11},void 0)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:34,columnNumber:9},void 0)]},void 0,!0,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:32,columnNumber:7},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:31,columnNumber:5},void 0)},void 0,!1,{fileName:"/Users/thuliobittencourt/Documents/Projetos/ExpxAgents_2/dashboard/src/main.tsx",lineNumber:30,columnNumber:3},void 0));export{gH as $,Q5 as A,B1 as B,si as C,ul as D,bd as E,Qf as F,ha as G,M9 as H,sj as I,l7 as J,s_ as K,sU as L,Sn as M,_S as N,nj as O,ao as P,X5 as Q,QT as R,P9 as S,ur as T,MS as U,du as V,I5 as W,uR as X,cH as Y,fH as Z,yH as _,zle as a,aD as a0,ob as a1,q7 as a2,r_ as a3,rj as a4,_H as a5,pa as a6,p5 as a7,cu as a8,iD as a9,IV as aa,rv as ab,nF as ac,vI as ad,qV as ae,yC as af,FV as ag,_I as ah,tv as ai,ws as aj,x5 as ak,Sq as al,Z5 as am,Ln as an,n_ as ao,ps as ap,S9 as aq,v9 as ar,Y9 as as,L9 as at,dH as au,hH as av,vH as aw,xH as ax,EH as ay,lC as b,au as c,Ps as d,n9 as e,fa as f,GI as g,gs as h,pr as i,y as j,ES as k,hn as l,b5 as m,zH as n,lD as o,TH as p,uD as q,O as r,QO as s,A5 as t,jS as u,Zr as v,qo as w,Fy as x,rI as y,Pi as z};