@meridianjs/admin-dashboard 1.24.0 → 1.26.0

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,625 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-B-dYvsY6.js","assets/vendor-query-CaIGp3JB.js","assets/vendor-react-Lycsri1F.js","assets/vendor-radix-C5JVua-j.js","assets/vendor-dnd-DuI-3XLF.js","assets/vendor-editor-CaXF3wWe.js","assets/WorkspaceReportingPage-DMV616MH.js"])))=>i.map(i=>d[i]);
2
- var yO=Object.defineProperty;var bO=(e,t,r)=>t in e?yO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fm=(e,t,r)=>bO(e,typeof t!="symbol"?t+"":t,r);import{j as a,u as Le,a as Ne,b as ge,R as wO,Q as jO,c as NO}from"./vendor-query-CaIGp3JB.js";import{a as $p,c as W,r as h,b as kO,u as zt,d as Ul,N as Nn,e as pt,L as Mr,O as ql,f as Hl,h as Zn,g as Ua,R as SO,i as Ec,j as CO,k as Ye,B as _O}from"./vendor-react-Lycsri1F.js";import{C as Cj,R as MO,T as PO,P as OO,S as zp,a as _j,O as yi,b as Kl,c as bi,d as Eu,e as ho,D as po,f as Yl,g as Mj,h as Pj,i as EO,j as Oj,I as Ej,k as Aj,l as Dj,m as Tj,L as Ij,n as Rj,o as AO,p as DO,q as $j,r as zj,F as Lj,u as qi,t as Cs,s as TO,v as Fj,w as IO,x as Bj,y as RO,z as $O,A as Wj,B as zO,E as Uj,G as qj,H as LO,J as Hj,V as FO,K as Kj,M as Yj,N as BO,Q as WO,U as Gj,W as UO,X as qO,Y as Au,Z as HO,_ as Ws,$ as Vj,a0 as KO,a1 as Xj,a2 as YO,a3 as GO,a4 as VO,a5 as Qj,a6 as XO,a7 as QO,a8 as Zj,a9 as ZO,aa as JO,ab as eE,ac as tE,ad as rE,ae as nE,af as aE,ag as sE,ah as iE,ai as oE,aj as lE,ak as Jj,al as cE,am as dE,an as uE,ao as fE,ap as mE,aq as hE}from"./vendor-radix-C5JVua-j.js";import{u as e1,a as Lp,P as t1,D as yl,S as Fp,h as r1,b as fd,c as Bp,C as Wp,d as pE,v as xE,r as gE,p as vE,e as yE,f as bE,M as wE,g as n1}from"./vendor-dnd-DuI-3XLF.js";import{P as a1,a as jE,D as NE,b as kE,e as SE,N as CE,c as _E,d as ME,m as Ac,E as PE,u as s1,i as i1,f as o1,g as l1,h as c1,j as OE,k as EE,w as AE}from"./vendor-editor-CaXF3wWe.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var d1,Rv=$p;d1=Rv.createRoot,Rv.hydrateRoot;const DE="modulepreload",TE=function(e){return"/"+e},$v={},u1=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=TE(c),c in $v)return;$v[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":DE,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};var IE=function(){return null},RE=e=>{switch(e){case"success":return LE;case"info":return BE;case"warning":return FE;case"error":return WE;default:return null}},$E=Array(12).fill(0),zE=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},$E.map((r,n)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),LE=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),FE=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),BE=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),WE=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),UE=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qE=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},gh=1,HE=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:gh++,i=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],W.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(YE(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||gh++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Br=new HE,KE=(e,t)=>{let r=(t==null?void 0:t.id)||gh++;return Br.addToast({title:e,...t,id:r}),r},YE=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",GE=KE,VE=()=>Br.toasts,XE=()=>Br.getActiveToasts(),U=Object.assign(GE,{success:Br.success,info:Br.info,warning:Br.warning,error:Br.error,custom:Br.custom,message:Br.message,promise:Br.promise,dismiss:Br.dismiss,loading:Br.loading},{getHistory:VE,getToasts:XE});function QE(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}QE(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
3
- `);function Dc(e){return e.label!==void 0}var ZE=3,JE="32px",eA="16px",zv=4e3,tA=356,rA=14,nA=20,aA=200;function wn(...e){return e.filter(Boolean).join(" ")}function sA(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var iA=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:m,toast:p,unstyled:x,interacting:g,setHeights:v,visibleToasts:y,heights:w,index:N,toasts:j,expanded:k,removeToast:b,defaultRichColors:S,closeButton:_,style:C,cancelButtonStyle:P,actionButtonStyle:D,className:E="",descriptionClassName:I="",duration:F,position:Q,gap:Y,loadingIcon:X,expandByDefault:re,classNames:ee,icons:T,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:$}=e,[K,z]=W.useState(null),[G,A]=W.useState(null),[O,J]=W.useState(!1),[B,ae]=W.useState(!1),[R,q]=W.useState(!1),[se,V]=W.useState(!1),[ie,pe]=W.useState(!1),[ue,ve]=W.useState(0),[be,Z]=W.useState(0),Ae=W.useRef(p.duration||F||zv),Te=W.useRef(null),Fe=W.useRef(null),$e=N===0,et=N+1<=y,Ke=p.type,Ze=p.dismissible!==!1,rr=p.className||"",$r=p.descriptionClassName||"",nr=W.useMemo(()=>w.findIndex(de=>de.toastId===p.id)||0,[w,p.id]),br=W.useMemo(()=>{var de;return(de=p.closeButton)!=null?de:_},[p.closeButton,_]),ar=W.useMemo(()=>p.duration||F||zv,[p.duration,F]),yt=W.useRef(0),Lt=W.useRef(0),Kt=W.useRef(0),sr=W.useRef(null),[Ln,pa]=Q.split("-"),Oe=W.useMemo(()=>w.reduce((de,_e,Re)=>Re>=nr?de:de+_e.height,0),[w,nr]),xe=qE(),je=p.invert||m,he=Ke==="loading";Lt.current=W.useMemo(()=>nr*Y+Oe,[nr,Oe]),W.useEffect(()=>{Ae.current=ar},[ar]),W.useEffect(()=>{J(!0)},[]),W.useEffect(()=>{let de=Fe.current;if(de){let _e=de.getBoundingClientRect().height;return Z(_e),v(Re=>[{toastId:p.id,height:_e,position:p.position},...Re]),()=>v(Re=>Re.filter(bt=>bt.toastId!==p.id))}},[v,p.id]),W.useLayoutEffect(()=>{if(!O)return;let de=Fe.current,_e=de.style.height;de.style.height="auto";let Re=de.getBoundingClientRect().height;de.style.height=_e,Z(Re),v(bt=>bt.find(nt=>nt.toastId===p.id)?bt.map(nt=>nt.toastId===p.id?{...nt,height:Re}:nt):[{toastId:p.id,height:Re,position:p.position},...bt])},[O,p.title,p.description,v,p.id]);let ye=W.useCallback(()=>{ae(!0),ve(Lt.current),v(de=>de.filter(_e=>_e.toastId!==p.id)),setTimeout(()=>{b(p)},aA)},[p,b,v,Lt]);W.useEffect(()=>{if(p.promise&&Ke==="loading"||p.duration===1/0||p.type==="loading")return;let de;return k||g||$&&xe?(()=>{if(Kt.current<yt.current){let _e=new Date().getTime()-yt.current;Ae.current=Ae.current-_e}Kt.current=new Date().getTime()})():Ae.current!==1/0&&(yt.current=new Date().getTime(),de=setTimeout(()=>{var _e;(_e=p.onAutoClose)==null||_e.call(p,p),ye()},Ae.current)),()=>clearTimeout(de)},[k,g,p,Ke,$,xe,ye]),W.useEffect(()=>{p.delete&&ye()},[ye,p.delete]);function Ve(){var de,_e,Re;return T!=null&&T.loading?W.createElement("div",{className:wn(ee==null?void 0:ee.loader,(de=p==null?void 0:p.classNames)==null?void 0:de.loader,"sonner-loader"),"data-visible":Ke==="loading"},T.loading):X?W.createElement("div",{className:wn(ee==null?void 0:ee.loader,(_e=p==null?void 0:p.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":Ke==="loading"},X):W.createElement(zE,{className:wn(ee==null?void 0:ee.loader,(Re=p==null?void 0:p.classNames)==null?void 0:Re.loader),visible:Ke==="loading"})}return W.createElement("li",{tabIndex:0,ref:Fe,className:wn(E,rr,ee==null?void 0:ee.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,ee==null?void 0:ee.default,ee==null?void 0:ee[Ke],(r=p==null?void 0:p.classNames)==null?void 0:r[Ke]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:S,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":O,"data-promise":!!p.promise,"data-swiped":ie,"data-removed":B,"data-visible":et,"data-y-position":Ln,"data-x-position":pa,"data-index":N,"data-front":$e,"data-swiping":R,"data-dismissible":Ze,"data-type":Ke,"data-invert":je,"data-swipe-out":se,"data-swipe-direction":G,"data-expanded":!!(k||re&&O),style:{"--index":N,"--toasts-before":N,"--z-index":j.length-N,"--offset":`${B?ue:Lt.current}px`,"--initial-height":re?"auto":`${be}px`,...C,...p.style},onDragEnd:()=>{q(!1),z(null),sr.current=null},onPointerDown:de=>{he||!Ze||(Te.current=new Date,ve(Lt.current),de.target.setPointerCapture(de.pointerId),de.target.tagName!=="BUTTON"&&(q(!0),sr.current={x:de.clientX,y:de.clientY}))},onPointerUp:()=>{var de,_e,Re,bt;if(se||!Ze)return;sr.current=null;let nt=Number(((de=Fe.current)==null?void 0:de.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),at=Number(((_e=Fe.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),wr=new Date().getTime()-((Re=Te.current)==null?void 0:Re.getTime()),ir=K==="x"?nt:at,Fn=Math.abs(ir)/wr;if(Math.abs(ir)>=nA||Fn>.11){ve(Lt.current),(bt=p.onDismiss)==null||bt.call(p,p),A(K==="x"?nt>0?"right":"left":at>0?"down":"up"),ye(),V(!0),pe(!1);return}q(!1),z(null)},onPointerMove:de=>{var _e,Re,bt,nt;if(!sr.current||!Ze||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let at=de.clientY-sr.current.y,wr=de.clientX-sr.current.x,ir=(Re=e.swipeDirections)!=null?Re:sA(Q);!K&&(Math.abs(wr)>1||Math.abs(at)>1)&&z(Math.abs(wr)>Math.abs(at)?"x":"y");let Fn={x:0,y:0};K==="y"?(ir.includes("top")||ir.includes("bottom"))&&(ir.includes("top")&&at<0||ir.includes("bottom")&&at>0)&&(Fn.y=at):K==="x"&&(ir.includes("left")||ir.includes("right"))&&(ir.includes("left")&&wr<0||ir.includes("right")&&wr>0)&&(Fn.x=wr),(Math.abs(Fn.x)>0||Math.abs(Fn.y)>0)&&pe(!0),(bt=Fe.current)==null||bt.style.setProperty("--swipe-amount-x",`${Fn.x}px`),(nt=Fe.current)==null||nt.style.setProperty("--swipe-amount-y",`${Fn.y}px`)}},br&&!p.jsx?W.createElement("button",{"aria-label":M,"data-disabled":he,"data-close-button":!0,onClick:he||!Ze?()=>{}:()=>{var de;ye(),(de=p.onDismiss)==null||de.call(p,p)},className:wn(ee==null?void 0:ee.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=T==null?void 0:T.close)!=null?i:UE):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:W.createElement(W.Fragment,null,Ke||p.icon||p.promise?W.createElement("div",{"data-icon":"",className:wn(ee==null?void 0:ee.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ve():null,p.type!=="loading"?p.icon||(T==null?void 0:T[Ke])||RE(Ke):null):null,W.createElement("div",{"data-content":"",className:wn(ee==null?void 0:ee.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},W.createElement("div",{"data-title":"",className:wn(ee==null?void 0:ee.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?W.createElement("div",{"data-description":"",className:wn(I,$r,ee==null?void 0:ee.description,(d=p==null?void 0:p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),h.isValidElement(p.cancel)?p.cancel:p.cancel&&Dc(p.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||P,onClick:de=>{var _e,Re;Dc(p.cancel)&&Ze&&((Re=(_e=p.cancel).onClick)==null||Re.call(_e,de),ye())},className:wn(ee==null?void 0:ee.cancelButton,(u=p==null?void 0:p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,h.isValidElement(p.action)?p.action:p.action&&Dc(p.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||D,onClick:de=>{var _e,Re;Dc(p.action)&&((Re=(_e=p.action).onClick)==null||Re.call(_e,de),!de.defaultPrevented&&ye())},className:wn(ee==null?void 0:ee.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function Lv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function oA(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?eA:JE;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}var lA=h.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:m,style:p,visibleToasts:x=ZE,toastOptions:g,dir:v=Lv(),gap:y=rA,loadingIcon:w,icons:N,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[b,S]=W.useState([]),_=W.useMemo(()=>Array.from(new Set([n].concat(b.filter($=>$.position).map($=>$.position)))),[b,n]),[C,P]=W.useState([]),[D,E]=W.useState(!1),[I,F]=W.useState(!1),[Q,Y]=W.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=W.useRef(null),re=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=W.useRef(null),T=W.useRef(!1),M=W.useCallback($=>{S(K=>{var z;return(z=K.find(G=>G.id===$.id))!=null&&z.delete||Br.dismiss($.id),K.filter(({id:G})=>G!==$.id)})},[]);return W.useEffect(()=>Br.subscribe($=>{if($.dismiss){S(K=>K.map(z=>z.id===$.id?{...z,delete:!0}:z));return}setTimeout(()=>{kO.flushSync(()=>{S(K=>{let z=K.findIndex(G=>G.id===$.id);return z!==-1?[...K.slice(0,z),{...K[z],...$},...K.slice(z+1)]:[$,...K]})})})}),[]),W.useEffect(()=>{if(u!=="system"){Y(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:K})=>{Y(K?"dark":"light")})}catch{$.addListener(({matches:z})=>{try{Y(z?"dark":"light")}catch(G){console.error(G)}})}},[u]),W.useEffect(()=>{b.length<=1&&E(!1)},[b]),W.useEffect(()=>{let $=K=>{var z,G;s.every(A=>K[A]||K.code===A)&&(E(!0),(z=X.current)==null||z.focus()),K.code==="Escape"&&(document.activeElement===X.current||(G=X.current)!=null&&G.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),W.useEffect(()=>{if(X.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,T.current=!1)}},[X.current]),W.createElement("section",{ref:t,"aria-label":`${j} ${re}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map(($,K)=>{var z;let[G,A]=$.split("-");return b.length?W.createElement("ol",{key:$,dir:v==="auto"?Lv():v,tabIndex:-1,ref:X,className:l,"data-sonner-toaster":!0,"data-theme":Q,"data-y-position":G,"data-lifted":D&&b.length>1&&!i,"data-x-position":A,style:{"--front-toast-height":`${((z=C[0])==null?void 0:z.height)||0}px`,"--width":`${tA}px`,"--gap":`${y}px`,...p,...oA(c,d)},onBlur:O=>{T.current&&!O.currentTarget.contains(O.relatedTarget)&&(T.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||T.current||(T.current=!0,ee.current=O.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{I||E(!1)},onDragEnd:()=>E(!1),onPointerDown:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},b.filter(O=>!O.position&&K===0||O.position===$).map((O,J)=>{var B,ae;return W.createElement(iA,{key:O.id,icons:N,index:J,toast:O,defaultRichColors:f,duration:(B=g==null?void 0:g.duration)!=null?B:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:x,closeButton:(ae=g==null?void 0:g.closeButton)!=null?ae:o,interacting:I,position:$,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:M,toasts:b.filter(R=>R.position==O.position),heights:C.filter(R=>R.position==O.position),setHeights:P,expandByDefault:i,gap:y,loadingIcon:w,expanded:D,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),cA=(e,t,r,n,s,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&i?s.map(y=>i[y]||y):s;g?(c.classList.remove(...v),c.classList.add(i&&i[p]?i[p]:p)):c.setAttribute(x,p)}),f(p)}function f(p){l&&d.includes(p)&&(c.style.colorScheme=p)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)u(n);else try{let p=localStorage.getItem(t)||r,x=o&&p==="system"?m():p;u(x)}catch{}},Fv=["light","dark"],f1="(prefers-color-scheme: dark)",dA=typeof window>"u",Up=h.createContext(void 0),uA={setTheme:e=>{},themes:[]},fA=()=>{var e;return(e=h.useContext(Up))!=null?e:uA},mA=e=>h.useContext(Up)?h.createElement(h.Fragment,null,e.children):h.createElement(pA,{...e}),hA=["light","dark"],pA=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=hA,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,p]=h.useState(()=>gA(s,o)),[x,g]=h.useState(()=>m==="system"?mm():m),v=c?Object.values(c):i,y=h.useCallback(k=>{let b=k;if(!b)return;k==="system"&&r&&(b=mm());let S=c?c[b]:b,_=t?vA(u):null,C=document.documentElement,P=D=>{D==="class"?(C.classList.remove(...v),S&&C.classList.add(S)):D.startsWith("data-")&&(S?C.setAttribute(D,S):C.removeAttribute(D))};if(Array.isArray(l)?l.forEach(P):P(l),n){let D=Fv.includes(o)?o:null,E=Fv.includes(b)?b:D;C.style.colorScheme=E}_==null||_()},[u]),w=h.useCallback(k=>{let b=typeof k=="function"?k(m):k;p(b);try{localStorage.setItem(s,b)}catch{}},[m]),N=h.useCallback(k=>{let b=mm(k);g(b),m==="system"&&r&&!e&&y("system")},[m,e]);h.useEffect(()=>{let k=window.matchMedia(f1);return k.addListener(N),N(k),()=>k.removeListener(N)},[N]),h.useEffect(()=>{let k=b=>{b.key===s&&(b.newValue?p(b.newValue):w(o))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[w]),h.useEffect(()=>{y(e??m)},[e,m]);let j=h.useMemo(()=>({theme:m,setTheme:w,forcedTheme:e,resolvedTheme:m==="system"?x:m,themes:r?[...i,"system"]:i,systemTheme:r?x:void 0}),[m,w,e,x,r,i]);return h.createElement(Up.Provider,{value:j},h.createElement(xA,{forcedTheme:e,storageKey:s,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},xA=h.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,themes:l,nonce:c,scriptProps:d})=>{let u=JSON.stringify([r,t,i,e,l,o,n,s]).slice(1,-1);return h.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${cA.toString()})(${u})`}})}),gA=(e,t)=>{if(dA)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},vA=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},mm=e=>(e||(e=window.matchMedia(f1)),e.matches?"dark":"light");function yA({children:e}){return a.jsx(mA,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const m1=h.createContext(null),As="meridian_token",Wo="meridian_user",Tc="meridian_workspace";function Bv(e){try{const t=e.split(".")[1],r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return{roles:Array.isArray(n.roles)?n.roles:[],permissions:Array.isArray(n.permissions)?n.permissions:[]}}catch{return{roles:[],permissions:[]}}}function bA({children:e}){const[t,r]=h.useState(()=>{try{const f=localStorage.getItem(Wo),m=localStorage.getItem(As);if(!f)return null;const p=JSON.parse(f),{roles:x,permissions:g}=m?Bv(m):{roles:[],permissions:[]};return p.roles=x,p.permissions=g,p}catch{return null}}),[n,s]=h.useState(()=>{const f=localStorage.getItem(As),m=localStorage.getItem(Wo);return f&&!m?(localStorage.removeItem(As),null):f}),[i,o]=h.useState(()=>{try{const f=localStorage.getItem(Tc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const{roles:p,permissions:x}=Bv(m),g={...f,roles:p,permissions:x};r(g),s(m),localStorage.setItem(As,m),localStorage.setItem(Wo,JSON.stringify(g))},c=()=>{const f=localStorage.getItem(As);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),s(null),o(null),localStorage.removeItem(As),localStorage.removeItem(Wo),localStorage.removeItem(Tc)};h.useEffect(()=>{const f=()=>{localStorage.getItem(As)&&c()};return window.addEventListener("meridian:unauthorized",f),()=>window.removeEventListener("meridian:unauthorized",f)},[]);const d=f=>{o(f),f?localStorage.setItem(Tc,JSON.stringify(f)):localStorage.removeItem(Tc)},u=f=>{r(m=>{if(!m)return m;const p={...m,...f};return localStorage.setItem(Wo,JSON.stringify(p)),p})};return a.jsx(m1.Provider,{value:{user:t,token:n,workspace:i,isAuthenticated:!!n&&!!t,login:l,logout:c,setWorkspace:d,updateLocalUser:u},children:e})}function Ie(){const e=h.useContext(m1);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const h1=h.createContext(null);function wA({children:e}){const[t,r]=h.useState(!1);return h.useEffect(()=>{const n=s=>{(s.metaKey||s.ctrlKey)&&s.key==="k"&&(s.preventDefault(),r(i=>!i))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),a.jsx(h1.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function qp(){const e=h.useContext(h1);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function p1(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=p1(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ot(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=p1(e))&&(n&&(n+=" "),n+=t);return n}const Hp="-",jA=e=>{const t=kA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Hp);return l[0]===""&&l.length!==1&&l.shift(),x1(l,t)||NA(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},x1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?x1(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Hp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Wv=/^\[(.+)\]$/,NA=e=>{if(Wv.test(e)){const t=Wv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},kA=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return CA(Object.entries(e.classGroups),r).forEach(([i,o])=>{vh(o,n,i,t)}),n},vh=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Uv(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(SA(s)){vh(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{vh(o,Uv(t,i),r,n)})})},Uv=(e,t)=>{let r=e;return t.split(Hp).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},SA=e=>e.isThemeGetter,CA=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,s]}):e,_A=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},g1="!",MA=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,o=l=>{const c=[];let d=0,u=0,f;for(let v=0;v<l.length;v++){let y=l[v];if(d===0){if(y===s&&(n||l.slice(v,v+i)===t)){c.push(l.slice(u,v)),u=v+i;continue}if(y==="/"){f=v;continue}}y==="["?d++:y==="]"&&d--}const m=c.length===0?l:l.substring(u),p=m.startsWith(g1),x=p?m.substring(1):m,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},PA=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},OA=e=>({cache:_A(e.cacheSize),parseClassName:MA(e),...jA(e)}),EA=/\s+/,AA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(EA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}=r(d);let x=!!p,g=n(x?m.substring(0,p):m);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=n(m),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const v=PA(u).join(":"),y=f?v+g1:v,w=y+g;if(i.includes(w))continue;i.push(w);const N=s(g,x);for(let j=0;j<N.length;++j){const k=N[j];i.push(y+k)}l=d+(l.length>0?" "+l:l)}return l};function DA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=v1(t))&&(n&&(n+=" "),n+=r);return n}const v1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=v1(e[n]))&&(r&&(r+=" "),r+=t);return r};function TA(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=OA(d),n=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=AA(c,r);return s(c,u),u}return function(){return i(DA.apply(null,arguments))}}const ft=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},y1=/^\[(?:([a-z-]+):)?(.+)\]$/i,IA=/^\d+\/\d+$/,RA=new Set(["px","full","screen"]),$A=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,LA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,FA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,va=e=>Hi(e)||RA.has(e)||IA.test(e),ss=e=>xo(e,"length",VA),Hi=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>xo(e,"number",Hi),Uo=e=>!!e&&Number.isInteger(Number(e)),WA=e=>e.endsWith("%")&&Hi(e.slice(0,-1)),ze=e=>y1.test(e),is=e=>$A.test(e),UA=new Set(["length","size","percentage"]),qA=e=>xo(e,UA,b1),HA=e=>xo(e,"position",b1),KA=new Set(["image","url"]),YA=e=>xo(e,KA,QA),GA=e=>xo(e,"",XA),qo=()=>!0,xo=(e,t,r)=>{const n=y1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},VA=e=>zA.test(e)&&!LA.test(e),b1=()=>!1,XA=e=>FA.test(e),QA=e=>BA.test(e),ZA=()=>{const e=ft("colors"),t=ft("spacing"),r=ft("blur"),n=ft("brightness"),s=ft("borderColor"),i=ft("borderRadius"),o=ft("borderSpacing"),l=ft("borderWidth"),c=ft("contrast"),d=ft("grayscale"),u=ft("hueRotate"),f=ft("invert"),m=ft("gap"),p=ft("gradientColorStops"),x=ft("gradientColorStopPositions"),g=ft("inset"),v=ft("margin"),y=ft("opacity"),w=ft("padding"),N=ft("saturate"),j=ft("scale"),k=ft("sepia"),b=ft("skew"),S=ft("space"),_=ft("translate"),C=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ze,t],E=()=>[ze,t],I=()=>["",va,ss],F=()=>["auto",Hi,ze],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",ze],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Hi,ze];return{cacheSize:500,separator:":",theme:{colors:[qo],spacing:[va,ss],blur:["none","",is,ze],brightness:M(),borderColor:[e],borderRadius:["none","","full",is,ze],borderSpacing:E(),borderWidth:I(),contrast:M(),grayscale:ee(),hueRotate:M(),invert:ee(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[WA,ss],inset:D(),margin:D(),opacity:M(),padding:E(),saturate:M(),scale:M(),sepia:ee(),skew:M(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[is]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Q(),ze]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Uo,ze]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",Uo,ze]}],"grid-cols":[{"grid-cols":[qo]}],"col-start-end":[{col:["auto",{span:["full",Uo,ze]},ze]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[qo]}],"row-start-end":[{row:["auto",{span:[Uo,ze]},ze]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[is]},is]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",is,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[qo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ze]}],"line-clamp":[{"line-clamp":["none",Hi,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",va,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",va,ss]}],"underline-offset":[{"underline-offset":["auto",va,ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),HA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[va,ze]}],"outline-w":[{outline:[va,ss]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[va,ss]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",is,GA]}],"shadow-color":[{shadow:[qo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",is,ze]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[N]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Uo,ze]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[va,ss,hm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},JA=TA(ZA);function L(...e){return JA(ot(e))}const Du=OO,Jn=MO,ea=PO,Pn=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(Cj,{ref:n,sideOffset:t,className:L("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Pn.displayName=Cj.displayName;const w1=h.createContext([]);function e5({widgets:e,children:t}){return W.createElement(w1.Provider,{value:e},t)}function t5(e){return h.useContext(w1).filter(r=>r.zone===e).map(r=>r.component)}var kj;const Xi=((kj=window.__MERIDIAN_CONFIG__)==null?void 0:kj.apiUrl)??void 0??"";class Kp extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function j1(){return localStorage.getItem("meridian_token")}async function Ho(e,t={}){var i;const r=j1(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Xi}${e}`,{...t,headers:n});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new Kp(s.status,l,o)}if(s.status!==204)return s.json()}const oe={get:e=>Ho(e,{method:"GET"}),post:(e,t)=>Ho(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Ho(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Ho(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Ho(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=j1(),n={};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Xi}${e}`,{method:"POST",headers:n,body:t});if(!s.ok){let o;try{o=await s.json()}catch{o=null}const l=((i=o==null?void 0:o.error)==null?void 0:i.message)??`HTTP ${s.status}`;throw s.status===401&&window.dispatchEvent(new CustomEvent("meridian:unauthorized")),new Kp(s.status,l,o)}if(s.status!==204)return s.json()}},Tt={all:["issues"],byProject:(e,t)=>[...Tt.all,"project",e,...t?[t]:[]],detail:e=>[...Tt.all,e],comments:e=>[...Tt.all,e,"comments"],activities:e=>[...Tt.all,e,"activities"]};function Gl(e,t){return Le({queryKey:e?Tt.byProject(e,t):Tt.all,queryFn:async()=>{var u,f,m;const r=new URLSearchParams;e&&(r.set("project_id",e),r.set("limit","1000")),(u=t==null?void 0:t.priority)!=null&&u.length&&r.set("priority",t.priority.join(",")),t!=null&&t.assignee_id&&r.set("assignee_id",t.assignee_id),(f=t==null?void 0:t.type)!=null&&f.length&&r.set("type",t.type.join(",")),(m=t==null?void 0:t.status)!=null&&m.length&&r.set("status",t.status.join(","));const n=await oe.get(`/admin/issues?${r}`);if(n.count<=n.issues.length)return n;const s=n.issues.length,i=n.count-s,o=Math.ceil(i/s),l=Array.from({length:o},(p,x)=>{const g=new URLSearchParams(r);return g.set("offset",String(s*(x+1))),oe.get(`/admin/issues?${g}`)}),c=await Promise.all(l);return{issues:n.issues.concat(...c.map(p=>p.issues)),count:n.count}},select:r=>r.issues,enabled:e!==void 0?!!e:!0})}function N1(e){return Le({queryKey:Tt.detail(e),queryFn:()=>oe.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function r5(e){return Le({queryKey:Tt.comments(e),queryFn:()=>oe.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function k1(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Tt.byProject(r.project_id)})}})}function Tu(e,t){const r=Ne();return ge({mutationFn:n=>oe.put(`/admin/issues/${e}`,n),onMutate:async n=>{await r.cancelQueries({queryKey:Tt.byProject(t)});const s=r.getQueryData(Tt.byProject(t));return r.setQueryData(Tt.byProject(t),i=>i&&{...i,issues:i.issues.map(o=>o.id===e?{...o,...n}:o)}),{previous:s}},onError:(n,s,i)=>{i!=null&&i.previous&&r.setQueryData(Tt.byProject(t),i.previous)},onSettled:()=>{r.invalidateQueries({queryKey:Tt.byProject(t)}),r.invalidateQueries({queryKey:Tt.detail(e)})}})}function n5(e){return Le({queryKey:Tt.activities(e),queryFn:()=>oe.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function a5(e){const t=Ne();return ge({mutationFn:({body:r,metadata:n})=>oe.post(`/admin/issues/${e}/comments`,{body:r,metadata:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Tt.comments(e)})}})}const qv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hv=ot,Vl=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Hv(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],f=i==null?void 0:i[d];if(u===null)return null;const m=qv(u)||qv(f);return s[d][m]}),l=r&&Object.entries(r).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:f,className:m,...p}=u;return Object.entries(p).every(x=>{let[g,v]=x;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...d,f,m]:d},[]);return Hv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},Ki=Vl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",indigo:"bg-indigo text-indigo-foreground hover:opacity-90"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),ne=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?zp:"button";return a.jsx(o,{className:L(Ki({variant:t,size:r,className:e})),ref:i,...s})});ne.displayName="Button";const Me=h.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:L("flex h-9 w-full rounded-lg border border-input bg-transparent px-3 py-1 text-sm shadow-none transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[#9ca3af] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));Me.displayName="Input";/**
4
- * @license lucide-react v0.468.0 - ISC
5
- *
6
- * This source code is licensed under the ISC license.
7
- * See the LICENSE file in the root directory of this source tree.
8
- */const s5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S1=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
9
- * @license lucide-react v0.468.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */var i5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
14
- * @license lucide-react v0.468.0 - ISC
15
- *
16
- * This source code is licensed under the ISC license.
17
- * See the LICENSE file in the root directory of this source tree.
18
- */const o5=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...i5,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:S1("lucide",s),...l},[...o.map(([d,u])=>h.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
19
- * @license lucide-react v0.468.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */const ce=(e,t)=>{const r=h.forwardRef(({className:n,...s},i)=>h.createElement(o5,{ref:i,iconNode:t,className:S1(`lucide-${s5(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
24
- * @license lucide-react v0.468.0 - ISC
25
- *
26
- * This source code is licensed under the ISC license.
27
- * See the LICENSE file in the root directory of this source tree.
28
- */const Iu=ce("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
29
- * @license lucide-react v0.468.0 - ISC
30
- *
31
- * This source code is licensed under the ISC license.
32
- * See the LICENSE file in the root directory of this source tree.
33
- */const wi=ce("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
34
- * @license lucide-react v0.468.0 - ISC
35
- *
36
- * This source code is licensed under the ISC license.
37
- * See the LICENSE file in the root directory of this source tree.
38
- */const go=ce("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
39
- * @license lucide-react v0.468.0 - ISC
40
- *
41
- * This source code is licensed under the ISC license.
42
- * See the LICENSE file in the root directory of this source tree.
43
- */const Yp=ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
44
- * @license lucide-react v0.468.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */const ji=ce("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
49
- * @license lucide-react v0.468.0 - ISC
50
- *
51
- * This source code is licensed under the ISC license.
52
- * See the LICENSE file in the root directory of this source tree.
53
- */const si=ce("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
54
- * @license lucide-react v0.468.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */const C1=ce("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
59
- * @license lucide-react v0.468.0 - ISC
60
- *
61
- * This source code is licensed under the ISC license.
62
- * See the LICENSE file in the root directory of this source tree.
63
- */const _1=ce("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
64
- * @license lucide-react v0.468.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */const M1=ce("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
69
- * @license lucide-react v0.468.0 - ISC
70
- *
71
- * This source code is licensed under the ISC license.
72
- * See the LICENSE file in the root directory of this source tree.
73
- */const P1=ce("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
74
- * @license lucide-react v0.468.0 - ISC
75
- *
76
- * This source code is licensed under the ISC license.
77
- * See the LICENSE file in the root directory of this source tree.
78
- */const ii=ce("CalendarRange",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]]);/**
79
- * @license lucide-react v0.468.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const Wt=ce("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
84
- * @license lucide-react v0.468.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */const l5=ce("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
89
- * @license lucide-react v0.468.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const js=ce("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
94
- * @license lucide-react v0.468.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const Kv=ce("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/**
99
- * @license lucide-react v0.468.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const Xt=ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
104
- * @license lucide-react v0.468.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const ca=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
109
- * @license lucide-react v0.468.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const na=ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
114
- * @license lucide-react v0.468.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const hr=ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
119
- * @license lucide-react v0.468.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const Gp=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
124
- * @license lucide-react v0.468.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const vo=ce("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
129
- * @license lucide-react v0.468.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const aa=ce("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
134
- * @license lucide-react v0.468.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const O1=ce("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
139
- * @license lucide-react v0.468.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const Vp=ce("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
144
- * @license lucide-react v0.468.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const Pr=ce("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
149
- * @license lucide-react v0.468.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const c5=ce("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
154
- * @license lucide-react v0.468.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const Rn=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
159
- * @license lucide-react v0.468.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const E1=ce("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
164
- * @license lucide-react v0.468.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const A1=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
169
- * @license lucide-react v0.468.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const Xp=ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
174
- * @license lucide-react v0.468.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const d5=ce("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
179
- * @license lucide-react v0.468.0 - ISC
180
- *
181
- * This source code is licensed under the ISC license.
182
- * See the LICENSE file in the root directory of this source tree.
183
- */const Qp=ce("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
184
- * @license lucide-react v0.468.0 - ISC
185
- *
186
- * This source code is licensed under the ISC license.
187
- * See the LICENSE file in the root directory of this source tree.
188
- */const Ea=ce("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
189
- * @license lucide-react v0.468.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */const Zp=ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
194
- * @license lucide-react v0.468.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const Xl=ce("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
199
- * @license lucide-react v0.468.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const Ni=ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
204
- * @license lucide-react v0.468.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const u5=ce("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
209
- * @license lucide-react v0.468.0 - ISC
210
- *
211
- * This source code is licensed under the ISC license.
212
- * See the LICENSE file in the root directory of this source tree.
213
- */const f5=ce("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
214
- * @license lucide-react v0.468.0 - ISC
215
- *
216
- * This source code is licensed under the ISC license.
217
- * See the LICENSE file in the root directory of this source tree.
218
- */const m5=ce("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
219
- * @license lucide-react v0.468.0 - ISC
220
- *
221
- * This source code is licensed under the ISC license.
222
- * See the LICENSE file in the root directory of this source tree.
223
- */const h5=ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
224
- * @license lucide-react v0.468.0 - ISC
225
- *
226
- * This source code is licensed under the ISC license.
227
- * See the LICENSE file in the root directory of this source tree.
228
- */const p5=ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
229
- * @license lucide-react v0.468.0 - ISC
230
- *
231
- * This source code is licensed under the ISC license.
232
- * See the LICENSE file in the root directory of this source tree.
233
- */const Jp=ce("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
234
- * @license lucide-react v0.468.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const ta=ce("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
239
- * @license lucide-react v0.468.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const yh=ce("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
244
- * @license lucide-react v0.468.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const D1=ce("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
249
- * @license lucide-react v0.468.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const x5=ce("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
254
- * @license lucide-react v0.468.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const g5=ce("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
259
- * @license lucide-react v0.468.0 - ISC
260
- *
261
- * This source code is licensed under the ISC license.
262
- * See the LICENSE file in the root directory of this source tree.
263
- */const v5=ce("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
264
- * @license lucide-react v0.468.0 - ISC
265
- *
266
- * This source code is licensed under the ISC license.
267
- * See the LICENSE file in the root directory of this source tree.
268
- */const T1=ce("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
269
- * @license lucide-react v0.468.0 - ISC
270
- *
271
- * This source code is licensed under the ISC license.
272
- * See the LICENSE file in the root directory of this source tree.
273
- */const y5=ce("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
274
- * @license lucide-react v0.468.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */const Kr=ce("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
279
- * @license lucide-react v0.468.0 - ISC
280
- *
281
- * This source code is licensed under the ISC license.
282
- * See the LICENSE file in the root directory of this source tree.
283
- */const jd=ce("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
284
- * @license lucide-react v0.468.0 - ISC
285
- *
286
- * This source code is licensed under the ISC license.
287
- * See the LICENSE file in the root directory of this source tree.
288
- */const I1=ce("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
289
- * @license lucide-react v0.468.0 - ISC
290
- *
291
- * This source code is licensed under the ISC license.
292
- * See the LICENSE file in the root directory of this source tree.
293
- */const b5=ce("Link2Off",[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
294
- * @license lucide-react v0.468.0 - ISC
295
- *
296
- * This source code is licensed under the ISC license.
297
- * See the LICENSE file in the root directory of this source tree.
298
- */const oi=ce("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
299
- * @license lucide-react v0.468.0 - ISC
300
- *
301
- * This source code is licensed under the ISC license.
302
- * See the LICENSE file in the root directory of this source tree.
303
- */const w5=ce("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
304
- * @license lucide-react v0.468.0 - ISC
305
- *
306
- * This source code is licensed under the ISC license.
307
- * See the LICENSE file in the root directory of this source tree.
308
- */const R1=ce("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
309
- * @license lucide-react v0.468.0 - ISC
310
- *
311
- * This source code is licensed under the ISC license.
312
- * See the LICENSE file in the root directory of this source tree.
313
- */const On=ce("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
314
- * @license lucide-react v0.468.0 - ISC
315
- *
316
- * This source code is licensed under the ISC license.
317
- * See the LICENSE file in the root directory of this source tree.
318
- */const ex=ce("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
319
- * @license lucide-react v0.468.0 - ISC
320
- *
321
- * This source code is licensed under the ISC license.
322
- * See the LICENSE file in the root directory of this source tree.
323
- */const Aa=ce("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
324
- * @license lucide-react v0.468.0 - ISC
325
- *
326
- * This source code is licensed under the ISC license.
327
- * See the LICENSE file in the root directory of this source tree.
328
- */const Ru=ce("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
329
- * @license lucide-react v0.468.0 - ISC
330
- *
331
- * This source code is licensed under the ISC license.
332
- * See the LICENSE file in the root directory of this source tree.
333
- */const j5=ce("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
334
- * @license lucide-react v0.468.0 - ISC
335
- *
336
- * This source code is licensed under the ISC license.
337
- * See the LICENSE file in the root directory of this source tree.
338
- */const $1=ce("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
339
- * @license lucide-react v0.468.0 - ISC
340
- *
341
- * This source code is licensed under the ISC license.
342
- * See the LICENSE file in the root directory of this source tree.
343
- */const qa=ce("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
344
- * @license lucide-react v0.468.0 - ISC
345
- *
346
- * This source code is licensed under the ISC license.
347
- * See the LICENSE file in the root directory of this source tree.
348
- */const N5=ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
349
- * @license lucide-react v0.468.0 - ISC
350
- *
351
- * This source code is licensed under the ISC license.
352
- * See the LICENSE file in the root directory of this source tree.
353
- */const k5=ce("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
354
- * @license lucide-react v0.468.0 - ISC
355
- *
356
- * This source code is licensed under the ISC license.
357
- * See the LICENSE file in the root directory of this source tree.
358
- */const tx=ce("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
359
- * @license lucide-react v0.468.0 - ISC
360
- *
361
- * This source code is licensed under the ISC license.
362
- * See the LICENSE file in the root directory of this source tree.
363
- */const Ns=ce("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
364
- * @license lucide-react v0.468.0 - ISC
365
- *
366
- * This source code is licensed under the ISC license.
367
- * See the LICENSE file in the root directory of this source tree.
368
- */const jl=ce("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
369
- * @license lucide-react v0.468.0 - ISC
370
- *
371
- * This source code is licensed under the ISC license.
372
- * See the LICENSE file in the root directory of this source tree.
373
- */const ut=ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
374
- * @license lucide-react v0.468.0 - ISC
375
- *
376
- * This source code is licensed under the ISC license.
377
- * See the LICENSE file in the root directory of this source tree.
378
- */const S5=ce("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
379
- * @license lucide-react v0.468.0 - ISC
380
- *
381
- * This source code is licensed under the ISC license.
382
- * See the LICENSE file in the root directory of this source tree.
383
- */const C5=ce("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
384
- * @license lucide-react v0.468.0 - ISC
385
- *
386
- * This source code is licensed under the ISC license.
387
- * See the LICENSE file in the root directory of this source tree.
388
- */const Qi=ce("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
389
- * @license lucide-react v0.468.0 - ISC
390
- *
391
- * This source code is licensed under the ISC license.
392
- * See the LICENSE file in the root directory of this source tree.
393
- */const Nd=ce("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
394
- * @license lucide-react v0.468.0 - ISC
395
- *
396
- * This source code is licensed under the ISC license.
397
- * See the LICENSE file in the root directory of this source tree.
398
- */const ki=ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
399
- * @license lucide-react v0.468.0 - ISC
400
- *
401
- * This source code is licensed under the ISC license.
402
- * See the LICENSE file in the root directory of this source tree.
403
- */const _5=ce("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
404
- * @license lucide-react v0.468.0 - ISC
405
- *
406
- * This source code is licensed under the ISC license.
407
- * See the LICENSE file in the root directory of this source tree.
408
- */const rx=ce("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
409
- * @license lucide-react v0.468.0 - ISC
410
- *
411
- * This source code is licensed under the ISC license.
412
- * See the LICENSE file in the root directory of this source tree.
413
- */const nx=ce("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
414
- * @license lucide-react v0.468.0 - ISC
415
- *
416
- * This source code is licensed under the ISC license.
417
- * See the LICENSE file in the root directory of this source tree.
418
- */const M5=ce("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
419
- * @license lucide-react v0.468.0 - ISC
420
- *
421
- * This source code is licensed under the ISC license.
422
- * See the LICENSE file in the root directory of this source tree.
423
- */const P5=ce("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
424
- * @license lucide-react v0.468.0 - ISC
425
- *
426
- * This source code is licensed under the ISC license.
427
- * See the LICENSE file in the root directory of this source tree.
428
- */const bh=ce("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
429
- * @license lucide-react v0.468.0 - ISC
430
- *
431
- * This source code is licensed under the ISC license.
432
- * See the LICENSE file in the root directory of this source tree.
433
- */const z1=ce("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
434
- * @license lucide-react v0.468.0 - ISC
435
- *
436
- * This source code is licensed under the ISC license.
437
- * See the LICENSE file in the root directory of this source tree.
438
- */const $u=ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
439
- * @license lucide-react v0.468.0 - ISC
440
- *
441
- * This source code is licensed under the ISC license.
442
- * See the LICENSE file in the root directory of this source tree.
443
- */const L1=ce("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
444
- * @license lucide-react v0.468.0 - ISC
445
- *
446
- * This source code is licensed under the ISC license.
447
- * See the LICENSE file in the root directory of this source tree.
448
- */const F1=ce("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
449
- * @license lucide-react v0.468.0 - ISC
450
- *
451
- * This source code is licensed under the ISC license.
452
- * See the LICENSE file in the root directory of this source tree.
453
- */const O5=ce("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
454
- * @license lucide-react v0.468.0 - ISC
455
- *
456
- * This source code is licensed under the ISC license.
457
- * See the LICENSE file in the root directory of this source tree.
458
- */const E5=ce("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
459
- * @license lucide-react v0.468.0 - ISC
460
- *
461
- * This source code is licensed under the ISC license.
462
- * See the LICENSE file in the root directory of this source tree.
463
- */const Yv=ce("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
464
- * @license lucide-react v0.468.0 - ISC
465
- *
466
- * This source code is licensed under the ISC license.
467
- * See the LICENSE file in the root directory of this source tree.
468
- */const A5=ce("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
469
- * @license lucide-react v0.468.0 - ISC
470
- *
471
- * This source code is licensed under the ISC license.
472
- * See the LICENSE file in the root directory of this source tree.
473
- */const B1=ce("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
474
- * @license lucide-react v0.468.0 - ISC
475
- *
476
- * This source code is licensed under the ISC license.
477
- * See the LICENSE file in the root directory of this source tree.
478
- */const Or=ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
479
- * @license lucide-react v0.468.0 - ISC
480
- *
481
- * This source code is licensed under the ISC license.
482
- * See the LICENSE file in the root directory of this source tree.
483
- */const D5=ce("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
484
- * @license lucide-react v0.468.0 - ISC
485
- *
486
- * This source code is licensed under the ISC license.
487
- * See the LICENSE file in the root directory of this source tree.
488
- */const T5=ce("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
489
- * @license lucide-react v0.468.0 - ISC
490
- *
491
- * This source code is licensed under the ISC license.
492
- * See the LICENSE file in the root directory of this source tree.
493
- */const I5=ce("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
494
- * @license lucide-react v0.468.0 - ISC
495
- *
496
- * This source code is licensed under the ISC license.
497
- * See the LICENSE file in the root directory of this source tree.
498
- */const R5=ce("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
499
- * @license lucide-react v0.468.0 - ISC
500
- *
501
- * This source code is licensed under the ISC license.
502
- * See the LICENSE file in the root directory of this source tree.
503
- */const $5=ce("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
504
- * @license lucide-react v0.468.0 - ISC
505
- *
506
- * This source code is licensed under the ISC license.
507
- * See the LICENSE file in the root directory of this source tree.
508
- */const W1=ce("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
509
- * @license lucide-react v0.468.0 - ISC
510
- *
511
- * This source code is licensed under the ISC license.
512
- * See the LICENSE file in the root directory of this source tree.
513
- */const yo=ce("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
514
- * @license lucide-react v0.468.0 - ISC
515
- *
516
- * This source code is licensed under the ISC license.
517
- * See the LICENSE file in the root directory of this source tree.
518
- */const z5=ce("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
519
- * @license lucide-react v0.468.0 - ISC
520
- *
521
- * This source code is licensed under the ISC license.
522
- * See the LICENSE file in the root directory of this source tree.
523
- */const U1=ce("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
524
- * @license lucide-react v0.468.0 - ISC
525
- *
526
- * This source code is licensed under the ISC license.
527
- * See the LICENSE file in the root directory of this source tree.
528
- */const Ql=ce("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
529
- * @license lucide-react v0.468.0 - ISC
530
- *
531
- * This source code is licensed under the ISC license.
532
- * See the LICENSE file in the root directory of this source tree.
533
- */const li=ce("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
534
- * @license lucide-react v0.468.0 - ISC
535
- *
536
- * This source code is licensed under the ISC license.
537
- * See the LICENSE file in the root directory of this source tree.
538
- */const Na=ce("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
539
- * @license lucide-react v0.468.0 - ISC
540
- *
541
- * This source code is licensed under the ISC license.
542
- * See the LICENSE file in the root directory of this source tree.
543
- */const Je=ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
544
- * @license lucide-react v0.468.0 - ISC
545
- *
546
- * This source code is licensed under the ISC license.
547
- * See the LICENSE file in the root directory of this source tree.
548
- */const da=ce("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function L5({issue:e}){const t=Tu(e.id,e.project_id),[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(!1),c=e.metadata??{},d=Object.entries(c),u=()=>{if(!r.trim())return;const m={...c,[r.trim()]:s};t.mutate({metadata:m},{onSuccess:()=>{U.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>U.error("Failed to save metadata")})},f=m=>{const p={...c};delete p[m],t.mutate({metadata:Object.keys(p).length?p:null},{onSuccess:()=>U.success("Entry removed"),onError:()=>U.error("Failed to update metadata")})};return a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(d5,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Metadata"})]}),!o&&a.jsxs("button",{onClick:()=>l(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Add field"]})]}),a.jsxs("div",{className:"px-5 py-3 space-y-2",children:[d.length===0&&!o&&a.jsx("p",{className:"text-xs text-muted-foreground/50 italic",children:"No metadata fields yet"}),d.map(([m,p])=>a.jsxs("div",{className:"flex items-center gap-2 group",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground w-28 shrink-0 truncate",children:m}),a.jsx("span",{className:"text-xs text-foreground flex-1 truncate",children:String(p)}),a.jsx("button",{onClick:()=>f(m),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Or,{className:"h-3 w-3"})})]},m)),o&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Me,{autoFocus:!0,placeholder:"key",value:r,onChange:m=>n(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs font-mono w-28 shrink-0"}),a.jsx(Me,{placeholder:"value",value:s,onChange:m=>i(m.target.value),onKeyDown:m=>{m.key==="Enter"&&u(),m.key==="Escape"&&l(!1)},className:"h-7 text-xs flex-1"}),a.jsx(ne,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const F5=[{zone:"issue.details.after",component:L5}];function bo(e=!0){return Le({queryKey:["workspaces"],queryFn:()=>oe.get("/admin/workspaces"),select:t=>t.workspaces,enabled:e})}function B5(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function W5(e){const t=Ne();return ge({mutationFn:r=>oe.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function U5(e){const t=Ne();return ge({mutationFn:r=>{const n=new FormData;return n.append("logo",r),oe.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function q5(e){const t=Ne();return ge({mutationFn:()=>oe.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const ax={list:e=>["workspaces",e,"invitations"]};function H5(e){return Le({queryKey:ax.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e})}function K5(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ax.list(e)})}})}function Y5(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ax.list(e)})}})}function G5(e){return ge({mutationFn:t=>oe.post(`/admin/workspaces/${e}/invitations/${t}/resend`)})}const sx={list:e=>["workspaces",e,"members"]};function Zl(e){return Le({queryKey:sx.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e})}function V5(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/workspaces/${e}/members/batch`,r),onSuccess:()=>{t.invalidateQueries({queryKey:sx.list(e)}),t.invalidateQueries({queryKey:["workspaces"]})}})}function X5(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:sx.list(e)}),t.invalidateQueries({queryKey:["workspaces"]})}})}const ks={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function zu(e){return Le({queryKey:ks.list(e),queryFn:()=>oe.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e})}function Q5(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ks.list(e)})}})}function Z5(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ks.list(e)})}})}function J5(e,t){return Le({queryKey:ks.members(e,t),queryFn:()=>oe.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function eD(e,t){const r=Ne();return ge({mutationFn:n=>oe.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:ks.members(e,t)}),r.invalidateQueries({queryKey:ks.list(e)})}})}function tD(e,t){const r=Ne();return ge({mutationFn:n=>oe.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:ks.members(e,t)}),r.invalidateQueries({queryKey:ks.list(e)})}})}function Lu(){return Le({queryKey:["setup-status"],queryFn:()=>oe.get("/auth/setup"),staleTime:6e4,retry:!1})}function rD(){return ge({mutationFn:e=>oe.post("/auth/register/send-otp",e)})}function nD(){const{login:e}=Ie();return ge({mutationFn:t=>oe.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function aD(){const{login:e}=Ie();return ge({mutationFn:t=>oe.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function sD(){return ge({mutationFn:e=>oe.post("/auth/forgot-password",e)})}function iD(){return ge({mutationFn:e=>oe.post("/auth/reset-password",e)})}function oD(e){const{login:t}=Ie();return ge({mutationFn:r=>oe.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var Sj;const lD=((Sj=window.__MERIDIAN_CONFIG__)==null?void 0:Sj.apiUrl)??void 0??"";function cD(e,t){const r=`${lD}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function dD(){const{token:e,workspace:t}=Ie(),r=Ne(),n=h.useRef(null);h.useEffect(()=>{if(!e||!t)return;const s=cD(e,t.id);n.current=s;const i=o=>{o.forEach(l=>r.invalidateQueries({queryKey:l}))};return s.addEventListener("issue.created",()=>{i([["issues"],["notifications"]])}),s.addEventListener("issue.status_changed",()=>{i([["issues"]])}),s.addEventListener("issue.assigned",()=>{i([["issues"],["notifications"]])}),s.addEventListener("comment.created",()=>{i([["issues"],["notifications"]])}),s.addEventListener("project.member_added",()=>{i([["notifications"]])}),s.addEventListener("timer.started",()=>{i([["time-logs"]])}),s.addEventListener("timer.stopped",()=>{i([["time-logs"]])}),s.addEventListener("notification.created",()=>{i([["notifications"]])}),s.onerror=()=>{},()=>{s.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const pm=768;function uD(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pm-1}px)`),n=()=>{t(window.innerWidth<pm)};return r.addEventListener("change",n),t(window.innerWidth<pm),()=>r.removeEventListener("change",n)},[]),!!e}const wo=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(_j,{ref:s,decorative:r,orientation:t,className:L("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));wo.displayName=_j.displayName;const fD=Yl,mD=Kl,q1=h.forwardRef(({className:e,...t},r)=>a.jsx(yi,{className:L("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));q1.displayName=yi.displayName;const hD=Vl("fixed z-50 gap-4 bg-background border-border transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:duration-300",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-xl"}},defaultVariants:{side:"right"}}),H1=h.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(mD,{children:[a.jsx(q1,{}),a.jsxs(bi,{ref:s,className:L(hD({side:e}),t),...n,children:[r,a.jsxs(Eu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsx(Je,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));H1.displayName=bi.displayName;const K1=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});K1.displayName="SheetHeader";const Y1=h.forwardRef(({className:e,...t},r)=>a.jsx(ho,{ref:r,className:L("text-base font-semibold text-foreground",e),...t}));Y1.displayName=ho.displayName;const G1=h.forwardRef(({className:e,...t},r)=>a.jsx(po,{ref:r,className:L("text-sm text-muted-foreground",e),...t}));G1.displayName=po.displayName;function le({className:e,...t}){return a.jsx("div",{className:L("animate-pulse rounded-md bg-muted",e),...t})}const pD="sidebar_state",xD=60*60*24*7,gD="16rem",vD="18rem",yD="3rem",bD="b",V1=h.createContext(null);function ix(){const e=h.useContext(V1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Fu({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:i,...o}){const l=uD(),[c,d]=h.useState(!1),[u,f]=h.useState(e),m=t??u,p=h.useCallback(y=>{const w=typeof y=="function"?y(m):y;r?r(w):f(w),document.cookie=`${pD}=${w}; path=/; max-age=${xD}`},[r,m]),x=h.useCallback(()=>l?d(y=>!y):p(y=>!y),[l,p,d]);h.useEffect(()=>{const y=w=>{w.key===bD&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),x())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x]);const g=m?"expanded":"collapsed",v=h.useMemo(()=>({state:g,open:m,setOpen:p,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:x}),[g,m,p,l,c,d,x]);return a.jsx(V1.Provider,{value:v,children:a.jsx(Du,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":gD,"--sidebar-width-icon":yD,...s},className:L("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function Bu({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=ix();return r==="none"?a.jsx("div",{"data-slot":"sidebar",className:L("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:s}):o?a.jsx(fD,{open:c,onOpenChange:d,...i,children:a.jsxs(H1,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-[var(--sidebar-width)] p-0 [&>button]:hidden",style:{"--sidebar-width":vD},side:e,children:[a.jsxs(K1,{className:"sr-only",children:[a.jsx(Y1,{children:"Sidebar"}),a.jsx(G1,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:L("relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]")}),a.jsx("div",{"data-slot":"sidebar-container",className:L("fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]":"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:a.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function Wu({className:e,onClick:t,...r}){const{toggleSidebar:n}=ix();return a.jsxs(ne,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:L("size-7",e),onClick:s=>{t==null||t(s),n()},...r,children:[a.jsx(k5,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Uu({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:L("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function qu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:L("flex flex-col gap-2 p-2",e),...t})}function Hu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:L("flex flex-col gap-2 p-2",e),...t})}function Gv({className:e,...t}){return a.jsx(wo,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:L("bg-sidebar-border mx-2 w-auto",e),...t})}function Ku({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:L("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function Hs({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:L("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Vv({className:e,asChild:t=!1,...r}){const n=t?zp:"div";return a.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:L("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function Ks({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:L("w-full text-sm",e),...t})}function kr({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:L("flex w-full min-w-0 flex-col gap-1",e),...t})}function Mt({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:L("group/menu-item relative",e),...t})}const wD=Vl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),St=h.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:s="default",tooltip:i,className:o,...l},c){const d=t?zp:"button",{isMobile:u,state:f}=ix(),m=a.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:L(wD({variant:n,size:s}),o),...l});return i?(typeof i=="string"&&(i={children:i}),a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:m}),a.jsx(Pn,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});St.displayName="SidebarMenuButton";const jD=250,ND=300,tn={all:["projects"],list:()=>[...tn.all,"list"],detail:e=>[...tn.all,e],byKey:e=>[...tn.all,"key",e],activities:e=>[...tn.all,e,"activities"]};function jo(e){const{workspace:t}=Ie(),r=e==null?void 0:e.workspaceIds,n=!(e!=null&&e.allWorkspaces)&&!(r!=null&&r.length),s=n?t==null?void 0:t.id:void 0;return Le({queryKey:[...tn.list(),s??r??"all"],queryFn:()=>{const i=new URLSearchParams;s?i.set("workspace_id",s):r!=null&&r.length&&i.set("workspace_ids",r.join(","));const o=i.toString()?`?${i}`:"";return oe.get(`/admin/projects${o}`)},select:i=>i.projects,enabled:n?!!(t!=null&&t.id):!0})}function Ha(e){return Le({queryKey:tn.byKey(e),queryFn:()=>oe.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function kD(e,t={}){const[r,n]=h.useState(e),s=t.enabled!==!1;return h.useEffect(()=>{if(!s)return;const l=setTimeout(()=>n(e),jD);return()=>clearTimeout(l)},[e,s]),{...Le({queryKey:["projects","suggest-identifier",r],queryFn:()=>oe.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:s&&r.trim().length>0}),flush:()=>n(e)}}function SD(e,t={}){const r=e.toUpperCase().replace(/[^A-Z0-9]/g,""),[n,s]=h.useState(r),i=t.enabled!==!1&&r.length>=3;h.useEffect(()=>{if(!r){s("");return}const l=setTimeout(()=>s(r),ND);return()=>clearTimeout(l)},[r]);const o=Le({queryKey:["projects","check-identifier",n],queryFn:()=>oe.get(`/admin/projects/check-identifier/${encodeURIComponent(n)}`),select:l=>l.available,enabled:i&&n.length>=3});return{available:o.data,isLoading:o.isLoading,isFetching:o.isFetching}}function CD(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:tn.list()})}})}function _D(){const e=Ne();return ge({mutationFn:t=>oe.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:tn.list()})}})}function MD(e){const t=Ne();return ge({mutationFn:()=>oe.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:tn.detail(e)}),t.invalidateQueries({queryKey:tn.list()})}})}function PD(e){const t=Ne();return ge({mutationFn:()=>oe.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:tn.detail(e)}),t.invalidateQueries({queryKey:tn.list()})}})}function OD(e){return Le({queryKey:tn.activities(e),queryFn:()=>oe.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}const Yr=AO,Gr=DO,ED=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(Mj,{ref:s,className:L("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,a.jsx(hr,{className:"ml-auto"})]}));ED.displayName=Mj.displayName;const AD=h.forwardRef(({className:e,...t},r)=>a.jsx(Pj,{ref:r,className:L("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));AD.displayName=Pj.displayName;const Er=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(EO,{children:a.jsx(Oj,{ref:n,sideOffset:t,className:L("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Er.displayName=Oj.displayName;const st=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(Ej,{ref:n,className:L("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));st.displayName=Ej.displayName;const DD=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(Aj,{ref:s,className:L("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Dj,{children:a.jsx(Xt,{className:"h-4 w-4"})})}),t]}));DD.displayName=Aj.displayName;const TD=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Tj,{ref:n,className:L("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Dj,{children:a.jsx(Pr,{className:"h-2 w-2 fill-current"})})}),t]}));TD.displayName=Tj.displayName;const ox=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(Ij,{ref:n,className:L("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));ox.displayName=Ij.displayName;const An=h.forwardRef(({className:e,...t},r)=>a.jsx(Rj,{ref:r,className:L("-mx-1 my-1 h-px bg-border",e),...t}));An.displayName=Rj.displayName;const Rt=h.forwardRef(({className:e,...t},r)=>a.jsx($j,{ref:r,className:L("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));Rt.displayName=$j.displayName;const Nl=h.forwardRef(({className:e,...t},r)=>a.jsx(zj,{ref:r,className:L("aspect-square h-full w-full",e),...t}));Nl.displayName=zj.displayName;const $t=h.forwardRef(({className:e,...t},r)=>a.jsx(Lj,{ref:r,className:L("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));$t.displayName=Lj.displayName;function ID(){var s;const{workspace:e,setWorkspace:t}=Ie(),{data:r}=bo(),n=pt();return a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[e!=null&&e.logo_url?a.jsx("img",{src:e.logo_url,alt:e.name,className:"size-8 rounded-lg object-cover shrink-0"}):a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[13px] font-bold",children:(((s=e==null?void 0:e.name)==null?void 0:s[0])??"M").toUpperCase()})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:(e==null?void 0:e.name)??"Meridian"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.slug)??""})]}),a.jsx(vo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Er,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[a.jsx(ox,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),r==null?void 0:r.map(i=>a.jsxs(st,{className:"cursor-pointer gap-2 p-2",onClick:()=>{t({id:i.id,name:i.name,slug:i.slug,logo_url:i.logo_url}),n(`/${i.slug}/projects`)},children:[i.logo_url?a.jsx("img",{src:i.logo_url,alt:i.name,className:"size-6 rounded-sm object-cover shrink-0"}):a.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-[10px] font-bold",children:i.name[0].toUpperCase()})}),a.jsx("span",{className:"flex-1 truncate",children:i.name}),i.id===(e==null?void 0:e.id)&&a.jsx(Xt,{className:"size-3.5 text-muted-foreground shrink-0"})]},i.id)),a.jsx(An,{}),a.jsxs(st,{className:"cursor-pointer gap-2 p-2 text-muted-foreground",onClick:()=>n("/setup"),children:[a.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border bg-background",children:a.jsx("span",{className:"text-xs font-semibold",children:"+"})}),a.jsx("span",{children:"Create workspace"})]})]})]})})})}function RD(){var i,o,l,c;const{user:e,logout:t}=Ie(),r=pt(),n=e&&(`${((i=e.first_name)==null?void 0:i[0])??""}${((o=e.last_name)==null?void 0:o[0])??""}`.toUpperCase()||((c=(l=e.email)==null?void 0:l[0])==null?void 0:c.toUpperCase()))||"?",s=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Rt,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Nl,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx($t,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(vo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Er,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(ox,{className:"p-0 font-normal",children:a.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[a.jsxs(Rt,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Nl,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx($t,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:n})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:s}),a.jsx("span",{className:"truncate text-xs text-muted-foreground",children:(e==null?void 0:e.email)??""})]})]})}),a.jsx(An,{}),a.jsxs(st,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[a.jsx(Ql,{className:"size-4"}),"Profile"]}),a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Ru,{className:"size-4"}),"Sign out"]})]})]})})})}function $D({...e}){var j,k,b;const{workspace:t,projectKey:r}=zt(),{data:n}=jo(),{toggle:s}=qp(),{user:i}=Ie(),o=Ul(),l=t??"",c=o.pathname===`/${l}/projects`,d=o.pathname===`/${l}/my-tasks`,u=o.pathname.includes("/notifications"),f=o.pathname.includes("/settings"),m=o.pathname.includes("/roles"),p=o.pathname===`/${l}/reporting`,x=o.pathname.startsWith("/reporting"),g=o.pathname.startsWith("/org/settings"),v=((j=i==null?void 0:i.roles)==null?void 0:j.includes("super-admin"))??!1,y=v||(((k=i==null?void 0:i.roles)==null?void 0:k.includes("admin"))??!1),w=((b=i==null?void 0:i.permissions)==null?void 0:b.includes("workspace:admin"))??!1,N=y||w;return a.jsxs(Bu,{collapsible:"offcanvas",...e,children:[a.jsx(qu,{children:a.jsx(ID,{})}),a.jsxs(Ku,{children:[a.jsx(Hs,{children:a.jsx(Ks,{children:a.jsxs(kr,{children:[a.jsx(Mt,{children:a.jsxs(St,{onClick:s,tooltip:"Search",children:[a.jsx(ki,{}),a.jsx("span",{children:"Search"}),a.jsx("kbd",{className:"ml-auto hidden text-[10px] text-sidebar-foreground/40 font-mono sm:inline-flex",children:"⌘K"})]})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:d,tooltip:"My Tasks",children:a.jsxs(Nn,{to:`/${l}/my-tasks`,children:[a.jsx($u,{}),a.jsx("span",{children:"My Tasks"})]})})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:c,tooltip:"Projects",children:a.jsxs(Nn,{to:`/${l}/projects`,end:!0,children:[a.jsx(Kr,{}),a.jsx("span",{children:"Projects"})]})})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:u,tooltip:"Notifications",children:a.jsxs(Nn,{to:`/${l}/notifications`,children:[a.jsx(si,{}),a.jsx("span",{children:"Notifications"})]})})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:p,tooltip:"Reports",children:a.jsxs(Nn,{to:`/${l}/reporting`,children:[a.jsx(js,{}),a.jsx("span",{children:"Reports"})]})})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:f,tooltip:"Settings",children:a.jsxs(Nn,{to:`/${l}/settings`,children:[a.jsx(nx,{}),a.jsx("span",{children:"Workspace settings"})]})})})]})})}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Gv,{}),a.jsxs(Hs,{children:[a.jsx(Vv,{children:"Recent"}),a.jsx(Ks,{children:a.jsx(kr,{children:n.slice(0,5).map(S=>a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:S.identifier===r,tooltip:S.name,className:"data-[active=true]:bg-indigo-50 dark:data-[active=true]:bg-indigo-950/50 data-[active=true]:text-indigo-700 dark:data-[active=true]:text-indigo-300",children:a.jsxs(Nn,{to:`/${l}/projects/${S.identifier}/board`,children:[a.jsx("span",{className:"font-mono text-[10px] text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:S.identifier}),a.jsx("span",{className:"truncate",children:S.name})]})})},S.id))})})]})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx(Gv,{}),a.jsxs(Hs,{children:[a.jsx(Vv,{children:"Global"}),a.jsx(Ks,{children:a.jsxs(kr,{children:[a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:x,tooltip:"Global Reports",children:a.jsxs(Nn,{to:"/reporting",children:[a.jsx(js,{}),a.jsx("span",{children:"Global Reports"})]})})}),a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:g,tooltip:"Org Settings",children:a.jsxs(Nn,{to:"/org/settings",children:[a.jsx(rx,{}),a.jsx("span",{children:"Org Settings"})]})})})]})})]})]}),a.jsx(Hs,{className:"mt-auto",children:a.jsx(Ks,{children:a.jsx(kr,{children:v&&a.jsx(Mt,{children:a.jsx(St,{asChild:!0,isActive:m,tooltip:"Roles & Permissions",children:a.jsxs(Nn,{to:`/${l}/roles`,children:[a.jsx(bh,{}),a.jsx("span",{children:"Custom Roles"})]})})})})})})]}),a.jsx(Hu,{children:a.jsx(RD,{})})]})}function Yu(){const{theme:e,setTheme:t}=fA();return a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsxs(ne,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[a.jsx(O5,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(N5,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsx(Pn,{children:"Toggle theme"})]})}const ur={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"],globalActiveTimer:["time-logs","global-active-timer"]};function zD(e){return Le({queryKey:ur.byIssue(e),queryFn:()=>oe.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function LD(e){return Le({queryKey:ur.activeTimer(e),queryFn:()=>oe.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e})}function FD(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ur.byIssue(e)})}})}function BD(e){const t=Ne();return ge({mutationFn:()=>oe.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:r=>{t.invalidateQueries({queryKey:ur.activeTimer(e)}),t.invalidateQueries({queryKey:ur.byIssue(e)}),t.invalidateQueries({queryKey:ur.globalActiveTimer}),r.stopped_timer&&r.stopped_timer.issue_id!==e&&(t.invalidateQueries({queryKey:ur.byIssue(r.stopped_timer.issue_id)}),t.invalidateQueries({queryKey:ur.activeTimer(r.stopped_timer.issue_id)}))}})}function WD(e){const t=Ne();return ge({mutationFn:()=>oe.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:ur.activeTimer(e)}),t.invalidateQueries({queryKey:ur.byIssue(e)}),t.invalidateQueries({queryKey:ur.globalActiveTimer})}})}function UD(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ur.byIssue(e)})}})}function qD(e){const t=Ne();return ge({mutationFn:({logId:r,data:n})=>oe.put(`/admin/issues/${e}/time-logs/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:ur.byIssue(e)})}})}function HD(){return Le({queryKey:ur.globalActiveTimer,queryFn:()=>oe.get("/admin/time-logs/active-timer"),select:e=>e.active_timer})}function KD(){const e=Ne();return ge({mutationFn:()=>oe.post("/admin/time-logs/active-timer"),onSuccess:t=>{e.invalidateQueries({queryKey:ur.globalActiveTimer}),t.time_log&&(e.invalidateQueries({queryKey:ur.byIssue(t.time_log.issue_id)}),e.invalidateQueries({queryKey:ur.activeTimer(t.time_log.issue_id)}))}})}function kd(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Sd(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3),n=Math.floor(r/3600),s=Math.floor(r%3600/60),i=r%60,o=String(s).padStart(2,"0"),l=String(i).padStart(2,"0");return n>0?`${n}:${o}:${l}`:`${o}:${l}`}function YD({startedAt:e}){const[t,r]=h.useState(()=>Sd(e));return h.useEffect(()=>{const n=setInterval(()=>r(Sd(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-xs font-semibold",children:t})}function GD(){const{data:e}=HD(),t=KD(),{workspace:r}=Ie(),n=(r==null?void 0:r.slug)??"";if(!e||!e.started_at)return null;const s=e.issue_identifier??"Issue",i=e.project_identifier?`/${n}/projects/${e.project_identifier}/issues/${e.issue_id}`:`/${n}/projects`,o=()=>{t.mutate(void 0,{onSuccess:l=>{var d;const c=((d=l.time_log)==null?void 0:d.duration_minutes)??0;U.success(`Timer stopped — ${kd(c)} logged`)},onError:()=>U.error("Failed to stop timer")})};return a.jsxs("div",{className:"flex items-center gap-1.5 rounded-full border border-emerald-200 dark:border-emerald-800 bg-emerald-50 dark:bg-emerald-950/40 px-2.5 py-1 text-emerald-700 dark:text-emerald-400",children:[a.jsx(B1,{className:"h-3 w-3 shrink-0"}),a.jsx(Mr,{to:i,className:"text-xs font-medium hover:underline truncate max-w-[100px]",title:e.issue_title??s,children:s}),a.jsx(YD,{startedAt:e.started_at}),a.jsx(ne,{variant:"ghost",size:"icon",className:"h-5 w-5 rounded-full text-emerald-700 dark:text-emerald-400 hover:bg-emerald-200 dark:hover:bg-emerald-900 hover:text-emerald-900 dark:hover:text-emerald-200",onClick:o,disabled:t.isPending,children:a.jsx(L1,{className:"h-2.5 w-2.5 fill-current"})})]})}const Jl={all:["notifications"],list:()=>[...Jl.all,"list"]};function VD(){return Le({queryKey:Jl.list(),queryFn:()=>oe.get("/admin/notifications"),select:e=>e.notifications})}function X1(){return Le({queryKey:[...Jl.list(),"unread"],queryFn:()=>oe.get("/admin/notifications?unread=true"),select:e=>e.count})}function XD(){const e=Ne();return ge({mutationFn:t=>oe.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:Jl.all})}})}function QD(){const e=Ne();return ge({mutationFn:()=>oe.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:Jl.all})}})}function ZD(){const e=Ul(),{projectKey:t}=zt(),{data:r}=jo(),n=r==null?void 0:r.find(i=>i.identifier===t),s=e.pathname;return s.includes("/board")?{icon:Kr,label:n?`${n.name} / Board`:"Board"}:s.includes("/issues")?{icon:ta,label:n?`${n.name} / Issues`:"Issues"}:s.includes("/sprints")?{icon:da,label:n?`${n.name} / Sprints`:"Sprints"}:s.includes("/timeline")?{icon:ii,label:n?`${n.name} / Timeline`:"Timeline"}:s.includes("/access")?{icon:Aa,label:n?`${n.name} / Access`:"Access"}:s.includes("/reports")?{icon:js,label:n?`${n.name} / Reports`:"Reports"}:s.includes("/activity")?{icon:Iu,label:n?`${n.name} / Activity`:"Activity"}:s.endsWith("/projects")?{icon:jd,label:"Projects"}:s.includes("/notifications")?{icon:si,label:"Notifications"}:s.includes("/settings")?{icon:nx,label:"Settings"}:{icon:jd,label:"Meridian"}}function JD(){const{data:e=0}=X1(),{icon:t,label:r}=ZD(),{workspace:n}=Ie(),s=(n==null?void 0:n.slug)??"";return a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(Wu,{className:"-ml-1"}),a.jsx(wo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(t,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:r})]}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx(GD,{}),a.jsx("span",{className:"hidden md:flex",children:a.jsx(Yu,{})}),a.jsx(ne,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:a.jsxs(Mr,{to:`/${s}/notifications`,children:[a.jsx(si,{className:"h-4 w-4",strokeWidth:1.5}),e>0&&a.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-3.5 w-3.5 rounded-full bg-indigo text-[9px] font-bold text-white flex items-center justify-center leading-none",children:e>9?"9+":e})]})})]})]})})}function eT(){const e=Ul(),{workspace:t}=zt(),r=t??"",{data:n=0}=X1(),{toggle:s}=qp(),i=[{key:"projects",label:"Projects",icon:I1,to:`/${r}/projects`,match:/\/projects($|\/)/},{key:"notifications",label:"Notifications",icon:si,to:`/${r}/notifications`,match:/\/notifications/,badge:n>0?n>9?"9+":String(n):null},{key:"my-tasks",label:"My Tasks",icon:$u,to:`/${r}/my-tasks`,match:/\/my-tasks/},{key:"profile",label:"Profile",icon:Ql,to:"/profile",match:/^\/profile/}];return a.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 bg-background border-t border-border md:hidden",children:a.jsxs("div",{className:"flex items-stretch h-16 pb-safe",children:[i.map(({key:o,label:l,icon:c,to:d,match:u,badge:f})=>{const m=u.test(e.pathname);return a.jsxs(Mr,{to:d,className:L("flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium transition-colors relative",m?"text-indigo-600 dark:text-indigo-400":"text-muted-foreground hover:text-foreground"),children:[a.jsxs("div",{className:"relative",children:[a.jsx(c,{className:"h-5 w-5",strokeWidth:m?2:1.5}),f&&a.jsx("span",{className:"absolute -top-1 -right-1.5 h-3.5 w-3.5 rounded-full bg-indigo-600 text-[9px] font-bold text-white flex items-center justify-center leading-none",children:f})]}),a.jsx("span",{children:l})]},o)}),a.jsxs("button",{onClick:s,className:"flex flex-col items-center justify-center flex-1 gap-1 text-[10px] font-medium text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(ki,{className:"h-5 w-5",strokeWidth:1.5}),a.jsx("span",{children:"Search"})]})]})})}function tT(){const{user:e,token:t,updateLocalUser:r,workspace:n,setWorkspace:s}=Ie();h.useEffect(()=>{!e||!t||!e.email||fetch("/admin/users/me",{headers:{Authorization:`Bearer ${t}`}}).then(i=>i.ok?i.json():null).then(i=>{i&&r({avatar_url:i.avatar_url??null})}).catch(()=>{})},[e==null?void 0:e.id]),h.useEffect(()=>{!n||n.logo_url!==void 0||t&&fetch("/admin/workspaces",{headers:{Authorization:`Bearer ${t}`}}).then(i=>i.ok?i.json():null).then(i=>{var l;const o=(l=i==null?void 0:i.workspaces)==null?void 0:l.find(c=>c.id===n.id);o&&s({...n,logo_url:o.logo_url??null})}).catch(()=>{})},[n==null?void 0:n.id])}function rT(){return tT(),a.jsxs(Fu,{children:[a.jsx($D,{variant:"inset"}),a.jsxs(Uu,{className:"flex flex-col min-w-0",children:[a.jsx(JD,{}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden pb-16 md:pb-0",children:a.jsx(ql,{})})]}),a.jsx(eT,{})]})}const ec={project:e=>["projects",e,"access"]};function ua(e){return Le({queryKey:ec.project(e),queryFn:()=>oe.get(`/admin/projects/${e}/access`),enabled:!!e})}function Q1(e){const t=Ne();return ge({mutationFn:({userIds:r,role:n})=>oe.post(`/admin/projects/${e}/members/batch`,{user_ids:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:ec.project(e)})}})}function Z1(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ec.project(e)})}})}function J1(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/projects/${e}/teams/batch`,{team_ids:r}),onSuccess:()=>{t.invalidateQueries({queryKey:ec.project(e)})}})}function eN(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ec.project(e)})}})}const Ka=Yl,nT=Kl,tN=h.forwardRef(({className:e,...t},r)=>a.jsx(yi,{ref:r,className:L("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tN.displayName=yi.displayName;const fa=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(nT,{children:[a.jsx(tN,{}),a.jsxs(bi,{ref:n,className:L("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...r,children:[t,a.jsxs(Eu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(Je,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fa.displayName=bi.displayName;const Ya=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col space-y-1.5",e),...t});Ya.displayName="DialogHeader";const lx=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});lx.displayName="DialogFooter";const Ga=h.forwardRef(({className:e,...t},r)=>a.jsx(ho,{ref:r,className:L("text-base font-semibold leading-none tracking-tight",e),...t}));Ga.displayName=ho.displayName;const No=h.forwardRef(({className:e,...t},r)=>a.jsx(po,{ref:r,className:L("text-sm text-muted-foreground",e),...t}));No.displayName=po.displayName;function aT({open:e,onClose:t,project:r}){const[n,s]=h.useState(null),i=MD(r.id),o=PD(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:p=>{const x=`${window.location.origin}/share/${p.project.share_token}`;s(x),U.success("Public link enabled")},onError:()=>U.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{s(null),U.success("Public link revoked")},onError:()=>U.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{U.success("Link copied to clipboard")})},m=!!c;return a.jsx(Ka,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(fa,{className:"sm:max-w-md overflow-hidden",children:[a.jsxs(Ya,{children:[a.jsxs(Ga,{className:"flex items-center gap-2",children:[a.jsx(oi,{className:"h-4 w-4"}),"Share project"]}),a.jsx(No,{children:"Allow anyone with the link to view this project without logging in."})]}),a.jsx("div",{className:"space-y-4 pt-2",children:m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-3 py-2 overflow-hidden",children:[a.jsx(yh,{className:"h-3.5 w-3.5 text-green-600 shrink-0"}),a.jsx("span",{className:"text-xs text-muted-foreground min-w-0 flex-1 break-all",children:c})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ne,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[a.jsx(Xp,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),a.jsxs(ne,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[a.jsx(Or,{className:"h-3.5 w-3.5 mr-1.5"}),"Revoke"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone with this link can view the board, issues, and timeline. No account required."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-dashed border-border px-3 py-4 text-center justify-center",children:[a.jsx(Aa,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),a.jsxs(ne,{className:"w-full",onClick:d,disabled:i.isPending,children:[a.jsx(yh,{className:"h-4 w-4 mr-2"}),"Enable public link"]}),a.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Generates a secret link for read-only access. No write permissions granted."})]})})]})})}function rN(e=768){const[t,r]=h.useState(()=>typeof window<"u"?window.innerWidth<e:!1);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${e-1}px)`),s=i=>r(i.matches);return r(n.matches),n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),t}const Xv=["board","issues","sprints","timeline","access","reports","activity"];function sT(){const{projectKey:e,workspace:t}=zt(),{data:r,error:n}=Ha(e??""),{user:s}=Ie(),{data:i}=ua((r==null?void 0:r.id)??""),[o,l]=h.useState(!1),c=pt(),d=Ul(),[u]=Hl(),f=rN(),m=(s==null?void 0:s.roles)??[],p=m.includes("super-admin")||m.includes("admin"),x=i==null?void 0:i.members.some(k=>k.user_id===(s==null?void 0:s.id)&&k.role==="manager"),g=p||x;h.useEffect(()=>{n&&n instanceof Kp&&(n.status===403||n.status===404)&&c(`/${t}/projects`,{replace:!0})},[n,t,c]),h.useEffect(()=>{const k=u.get("tab");if(!k||!Xv.includes(k))return;Xv.every(S=>!d.pathname.endsWith(`/${S}`))&&c(`/${t}/projects/${e}/${k}`,{replace:!0})},[]);const v=`/${t}/projects/${e}`,y=[{to:`${v}/board`,label:"Board",icon:jd,end:!0,desktopOnly:!0},{to:`${v}/issues`,label:"Issues",icon:ta,end:!1},{to:`${v}/sprints`,label:"Sprints",icon:da,end:!0},{to:`${v}/timeline`,label:"Timeline",icon:ii,end:!0,desktopOnly:!0},{to:`${v}/access`,label:"Access",icon:Aa,end:!0},{to:`${v}/reports`,label:"Reports",icon:js,end:!0},{to:`${v}/activity`,label:"Activity",icon:Iu,end:!0}],w=y,N=y.filter(k=>!k.desktopOnly),j=d.pathname.endsWith("/board")||d.pathname.endsWith("/timeline");return f&&j?a.jsx(Zn,{to:`${v}/issues`,replace:!0}):a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"border-b border-border bg-white dark:bg-card shrink-0 px-4 pt-4 md:px-6 md:pt-5",children:[a.jsxs("div",{className:"flex items-center gap-2.5 mb-3 md:mb-4",children:[r&&a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:r.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:(r==null?void 0:r.name)??""})]}),a.jsxs("div",{className:"hidden md:flex items-center -mb-px",children:[a.jsx("div",{className:"flex flex-1",children:w.map(({to:k,label:b,icon:S,end:_})=>a.jsxs(Nn,{to:k,end:_,className:({isActive:C})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${C?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(S,{className:"h-3.5 w-3.5",strokeWidth:1.5}),b]},k))}),g&&r&&a.jsx("div",{className:"pb-px pr-1",children:a.jsxs(ne,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[a.jsx(M5,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]}),a.jsx("div",{className:"flex md:hidden overflow-x-auto -mb-px scrollbar-none",children:N.map(({to:k,label:b,icon:S,end:_})=>a.jsxs(Nn,{to:k,end:_,className:({isActive:C})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 whitespace-nowrap transition-colors shrink-0 ${C?"border-indigo-600 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400 font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(S,{className:"h-3.5 w-3.5",strokeWidth:1.5}),b]},k))})]}),a.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:a.jsx(ql,{})}),r&&a.jsx(aT,{open:o,onClose:()=>l(!1),project:r})]})}function iT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Rt,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx($t,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(vo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Er,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Ru,{className:"size-4"}),"Sign out"]})]})]})})})}function oT(){const{workspace:e}=Ie(),t=pt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(qu,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(js,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Reporting"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Time analytics"})]})]})})})}),a.jsx(Ku,{children:a.jsx(Hs,{children:a.jsx(Ks,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(go,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Hu,{children:a.jsx(iT,{})})]})}function lT(){return a.jsxs(Fu,{children:[a.jsx(oT,{}),a.jsxs(Uu,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(Wu,{className:"-ml-1"}),a.jsx(wo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(js,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Reporting"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Yu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(ql,{})})]})]})}function cT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Rt,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx($t,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(vo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Er,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Ru,{className:"size-4"}),"Sign out"]})]})]})})})}function dT(){const{workspace:e}=Ie(),t=pt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(qu,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(rx,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Org Settings"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Global configuration"})]})]})})})}),a.jsx(Ku,{children:a.jsx(Hs,{children:a.jsx(Ks,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(go,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Hu,{children:a.jsx(cT,{})})]})}function uT(){return a.jsxs(Fu,{children:[a.jsx(dT,{}),a.jsxs(Uu,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(Wu,{className:"-ml-1"}),a.jsx(wo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(rx,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Org Settings"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Yu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(ql,{})})]})]})}function fT(){var s,i;const{user:e,logout:t}=Ie(),r=e?`${((s=e.first_name)==null?void 0:s[0])??""}${((i=e.last_name)==null?void 0:i[0])??""}`.toUpperCase()||e.email[0].toUpperCase():"?",n=e?[e.first_name,e.last_name].filter(Boolean).join(" ")||e.email:"User";return a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Rt,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(Nl,{src:e.avatar_url,alt:n??"",className:"object-cover"}),a.jsx($t,{className:"rounded-lg bg-foreground text-background text-xs font-medium",children:r})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:n}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:(e==null?void 0:e.email)??""})]}),a.jsx(vo,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(Er,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Ru,{className:"size-4"}),"Sign out"]})]})]})})})}function mT(){const{workspace:e}=Ie(),t=pt(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Bu,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(qu,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{size:"lg",className:"data-[state=open]:bg-sidebar-accent",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx(Ql,{className:"size-4"})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-semibold",children:"Profile"}),a.jsx("span",{className:"truncate text-xs text-sidebar-foreground/60",children:"Personal settings"})]})]})})})}),a.jsx(Ku,{children:a.jsx(Hs,{children:a.jsx(Ks,{children:a.jsx(kr,{children:a.jsx(Mt,{children:a.jsxs(St,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(go,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Hu,{children:a.jsx(fT,{})})]})}function hT(){return a.jsxs(Fu,{children:[a.jsx(mT,{}),a.jsxs(Uu,{className:"flex flex-col min-w-0",children:[a.jsx("header",{className:"flex h-14 shrink-0 items-center gap-2 border-b w-full",children:a.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[a.jsx(Wu,{className:"-ml-1"}),a.jsx(wo,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(Ql,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400",strokeWidth:1.5}),a.jsx("span",{className:"font-medium",children:"Profile"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(Yu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(ql,{})})]})]})}var Qv=1,pT=.9,xT=.8,gT=.17,xm=.1,gm=.999,vT=.9999,yT=.99,bT=/[\\\/_+.#"@\[\(\{&]/,wT=/[\\\/_+.#"@\[\(\{&]/g,jT=/[\s-]/,nN=/[\s-]/g;function wh(e,t,r,n,s,i,o){if(i===t.length)return s===e.length?Qv:yT;var l=`${s},${i}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(i),d=r.indexOf(c,s),u=0,f,m,p,x;d>=0;)f=wh(e,t,r,n,d+1,i+1,o),f>u&&(d===s?f*=Qv:bT.test(e.charAt(d-1))?(f*=xT,p=e.slice(s,d-1).match(wT),p&&s>0&&(f*=Math.pow(gm,p.length))):jT.test(e.charAt(d-1))?(f*=pT,x=e.slice(s,d-1).match(nN),x&&s>0&&(f*=Math.pow(gm,x.length))):(f*=gT,s>0&&(f*=Math.pow(gm,d-s))),e.charAt(d)!==t.charAt(i)&&(f*=vT)),(f<xm&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=wh(e,t,r,n,d+1,i+2,o),m*xm>f&&(f=m*xm)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function Zv(e){return e.toLowerCase().replace(nN," ")}function NT(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,wh(e,t,Zv(e),Zv(t),0,0,{})}var Ko='[cmdk-group=""]',vm='[cmdk-group-items=""]',kT='[cmdk-group-heading=""]',cx='[cmdk-item=""]',Jv=`${cx}:not([aria-disabled="true"])`,jh="cmdk-item-select",Us="data-value",ST=(e,t,r)=>NT(e,t,r),aN=h.createContext(void 0),tc=()=>h.useContext(aN),sN=h.createContext(void 0),dx=()=>h.useContext(sN),iN=h.createContext(void 0),oN=h.forwardRef((e,t)=>{let r=Fi(()=>{var $,K;return{search:"",value:(K=($=e.value)!=null?$:e.defaultValue)!=null?K:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Fi(()=>new Set),s=Fi(()=>new Map),i=Fi(()=>new Map),o=Fi(()=>new Set),l=lN(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:x,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,w=qi(),N=qi(),j=qi(),k=h.useRef(null),b=RT();ci(()=>{if(u!==void 0){let $=u.trim();r.current.value=$,S.emit()}},[u]),ci(()=>{b(6,I)},[]);let S=h.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>r.current,setState:($,K,z)=>{var G,A,O;if(!Object.is(r.current[$],K)){if(r.current[$]=K,$==="search")E(),P(),b(1,D);else if($==="value"&&(z||b(5,I),((G=l.current)==null?void 0:G.value)!==void 0)){let J=K??"";(O=(A=l.current).onValueChange)==null||O.call(A,J);return}S.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),_=h.useMemo(()=>({value:($,K,z)=>{var G;K!==((G=i.current.get($))==null?void 0:G.value)&&(i.current.set($,{value:K,keywords:z}),r.current.filtered.items.set($,C(K,z)),b(2,()=>{P(),S.emit()}))},item:($,K)=>(n.current.add($),K&&(s.current.has(K)?s.current.get(K).add($):s.current.set(K,new Set([$]))),b(3,()=>{E(),P(),r.current.value||D(),S.emit()}),()=>{i.current.delete($),n.current.delete($),r.current.filtered.items.delete($);let z=F();b(4,()=>{E(),(z==null?void 0:z.getAttribute("id"))===$&&D(),S.emit()})}),group:$=>(s.current.has($)||s.current.set($,new Set),()=>{i.current.delete($),s.current.delete($)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:w,inputId:j,labelId:N,listInnerRef:k}),[]);function C($,K){var z,G;let A=(G=(z=l.current)==null?void 0:z.filter)!=null?G:ST;return $?A($,r.current.search,K):0}function P(){if(!r.current.search||l.current.shouldFilter===!1)return;let $=r.current.filtered.items,K=[];r.current.filtered.groups.forEach(G=>{let A=s.current.get(G),O=0;A.forEach(J=>{let B=$.get(J);O=Math.max(B,O)}),K.push([G,O])});let z=k.current;Q().sort((G,A)=>{var O,J;let B=G.getAttribute("id"),ae=A.getAttribute("id");return((O=$.get(ae))!=null?O:0)-((J=$.get(B))!=null?J:0)}).forEach(G=>{let A=G.closest(vm);A?A.appendChild(G.parentElement===A?G:G.closest(`${vm} > *`)):z.appendChild(G.parentElement===z?G:G.closest(`${vm} > *`))}),K.sort((G,A)=>A[1]-G[1]).forEach(G=>{var A;let O=(A=k.current)==null?void 0:A.querySelector(`${Ko}[${Us}="${encodeURIComponent(G[0])}"]`);O==null||O.parentElement.appendChild(O)})}function D(){let $=Q().find(z=>z.getAttribute("aria-disabled")!=="true"),K=$==null?void 0:$.getAttribute(Us);S.setState("value",K||void 0)}function E(){var $,K,z,G;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let A=0;for(let O of n.current){let J=(K=($=i.current.get(O))==null?void 0:$.value)!=null?K:"",B=(G=(z=i.current.get(O))==null?void 0:z.keywords)!=null?G:[],ae=C(J,B);r.current.filtered.items.set(O,ae),ae>0&&A++}for(let[O,J]of s.current)for(let B of J)if(r.current.filtered.items.get(B)>0){r.current.filtered.groups.add(O);break}r.current.filtered.count=A}function I(){var $,K,z;let G=F();G&&((($=G.parentElement)==null?void 0:$.firstChild)===G&&((z=(K=G.closest(Ko))==null?void 0:K.querySelector(kT))==null||z.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function F(){var $;return($=k.current)==null?void 0:$.querySelector(`${cx}[aria-selected="true"]`)}function Q(){var $;return Array.from((($=k.current)==null?void 0:$.querySelectorAll(Jv))||[])}function Y($){let K=Q()[$];K&&S.setState("value",K.getAttribute(Us))}function X($){var K;let z=F(),G=Q(),A=G.findIndex(J=>J===z),O=G[A+$];(K=l.current)!=null&&K.loop&&(O=A+$<0?G[G.length-1]:A+$===G.length?G[0]:G[A+$]),O&&S.setState("value",O.getAttribute(Us))}function re($){let K=F(),z=K==null?void 0:K.closest(Ko),G;for(;z&&!G;)z=$>0?TT(z,Ko):IT(z,Ko),G=z==null?void 0:z.querySelector(Jv);G?S.setState("value",G.getAttribute(Us)):X($)}let ee=()=>Y(Q().length-1),T=$=>{$.preventDefault(),$.metaKey?ee():$.altKey?re(1):X(1)},M=$=>{$.preventDefault(),$.metaKey?Y(0):$.altKey?re(-1):X(-1)};return h.createElement(Cs.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:$=>{var K;if((K=y.onKeyDown)==null||K.call(y,$),!$.defaultPrevented)switch($.key){case"n":case"j":{v&&$.ctrlKey&&T($);break}case"ArrowDown":{T($);break}case"p":case"k":{v&&$.ctrlKey&&M($);break}case"ArrowUp":{M($);break}case"Home":{$.preventDefault(),Y(0);break}case"End":{$.preventDefault(),ee();break}case"Enter":if(!$.nativeEvent.isComposing&&$.keyCode!==229){$.preventDefault();let z=F();if(z){let G=new Event(jh);z.dispatchEvent(G)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:_.inputId,id:_.labelId,style:zT},c),Gu(e,$=>h.createElement(sN.Provider,{value:S},h.createElement(aN.Provider,{value:_},$))))}),CT=h.forwardRef((e,t)=>{var r,n;let s=qi(),i=h.useRef(null),o=h.useContext(iN),l=tc(),c=lN(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;ci(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=cN(s,i,[e.value,e.children,i],e.keywords),f=dx(),m=di(b=>b.value&&b.value===u.current),p=di(b=>d||l.filter()===!1?!0:b.search?b.filtered.items.get(s)>0:!0);h.useEffect(()=>{let b=i.current;if(!(!b||e.disabled))return b.addEventListener(jh,x),()=>b.removeEventListener(jh,x)},[p,e.onSelect,e.disabled]);function x(){var b,S;g(),(S=(b=c.current).onSelect)==null||S.call(b,u.current)}function g(){f.setState("value",u.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:w,forceMount:N,keywords:j,...k}=e;return h.createElement(Cs.div,{ref:kl([i,t]),...k,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!m,"data-disabled":!!v,"data-selected":!!m,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:x},e.children)}),_T=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=qi(),l=h.useRef(null),c=h.useRef(null),d=qi(),u=tc(),f=di(p=>s||u.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);ci(()=>u.group(o),[]),cN(o,l,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:o,forceMount:s}),[s]);return h.createElement(Cs.div,{ref:kl([l,t]),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},r&&h.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Gu(e,p=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},h.createElement(iN.Provider,{value:m},p))))}),MT=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=h.useRef(null),i=di(o=>!o.search);return!r&&!i?null:h.createElement(Cs.div,{ref:kl([s,t]),...n,"cmdk-separator":"",role:"separator"})}),PT=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,i=dx(),o=di(u=>u.search),l=di(u=>u.value),c=tc(),d=h.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${cx}[${Us}="${encodeURIComponent(l)}"]`);return f==null?void 0:f.getAttribute("id")},[]);return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(Cs.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":d,id:c.inputId,type:"text",value:s?e.value:o,onChange:u=>{s||i.setState("search",u.target.value),r==null||r(u.target.value)}})}),OT=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=h.useRef(null),o=h.useRef(null),l=tc();return h.useEffect(()=>{if(o.current&&i.current){let c=o.current,d=i.current,u,f=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let m=c.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return f.observe(c),()=>{cancelAnimationFrame(u),f.unobserve(c)}}},[]),h.createElement(Cs.div,{ref:kl([i,t]),...s,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},Gu(e,c=>h.createElement("div",{ref:kl([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),ET=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...l}=e;return h.createElement(Yl,{open:r,onOpenChange:n},h.createElement(Kl,{container:o},h.createElement(yi,{"cmdk-overlay":"",className:s}),h.createElement(bi,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(oN,{ref:t,...l}))))}),AT=h.forwardRef((e,t)=>di(r=>r.filtered.count===0)?h.createElement(Cs.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),DT=h.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return h.createElement(Cs.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Gu(e,o=>h.createElement("div",{"aria-hidden":!0},o)))}),Vr=Object.assign(oN,{List:OT,Item:CT,Input:PT,Group:_T,Separator:MT,Dialog:ET,Empty:AT,Loading:DT});function TT(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function IT(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function lN(e){let t=h.useRef(e);return ci(()=>{t.current=e}),t}var ci=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Fi(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function kl(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function di(e){let t=dx(),r=()=>e(t.snapshot());return TO.useSyncExternalStore(t.subscribe,r,r)}function cN(e,t,r,n=[]){let s=h.useRef(),i=tc();return ci(()=>{var o;let l=(()=>{var d;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(d=u.current.textContent)==null?void 0:d.trim():s.current}})(),c=n.map(d=>d.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Us,l),s.current=l}),s}var RT=()=>{let[e,t]=h.useState(),r=Fi(()=>new Map);return ci(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function $T(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Gu({asChild:e,children:t},r){return e&&h.isValidElement(t)?h.cloneElement($T(t),{ref:t.ref},r(t.props.children)):r(t)}var zT={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Zs=h.forwardRef(({className:e,...t},r)=>a.jsx(Vr,{ref:r,className:L("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zs.displayName=Vr.displayName;const LT=({children:e,open:t,onOpenChange:r})=>a.jsx(Ka,{open:t,onOpenChange:r,children:a.jsx(fa,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:a.jsx(Zs,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Vu=h.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(ki,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Vr.Input,{ref:r,className:L("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Vu.displayName=Vr.Input.displayName;const Js=h.forwardRef(({className:e,...t},r)=>a.jsx(Vr.List,{ref:r,className:L("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));Js.displayName=Vr.List.displayName;const Xu=h.forwardRef((e,t)=>a.jsx(Vr.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));Xu.displayName=Vr.Empty.displayName;const fs=h.forwardRef(({className:e,...t},r)=>a.jsx(Vr.Group,{ref:r,className:L("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));fs.displayName=Vr.Group.displayName;const dN=h.forwardRef(({className:e,...t},r)=>a.jsx(Vr.Separator,{ref:r,className:L("-mx-1 h-px bg-border",e),...t}));dN.displayName=Vr.Separator.displayName;const mn=h.forwardRef(({className:e,...t},r)=>a.jsx(Vr.Item,{ref:r,className:L("relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));mn.displayName=Vr.Item.displayName;function FT(){const{open:e,setOpen:t}=qp(),r=pt(),{data:n}=jo(),{workspace:s}=Ie(),i=(s==null?void 0:s.slug)??"",o=l=>{t(!1),l()};return a.jsxs(LT,{open:e,onOpenChange:t,children:[a.jsx(Vu,{placeholder:"Search or jump to..."}),a.jsxs(Js,{children:[a.jsx(Xu,{children:"No results found."}),a.jsxs(fs,{heading:"Navigation",children:[a.jsxs(mn,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[a.jsx(jd,{className:"text-muted-foreground"}),a.jsx("span",{children:"Projects"})]}),a.jsxs(mn,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[a.jsx(si,{className:"text-muted-foreground"}),a.jsx("span",{children:"Notifications"})]}),a.jsxs(mn,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[a.jsx(nx,{className:"text-muted-foreground"}),a.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(dN,{}),a.jsxs(fs,{heading:"Projects",children:[n.map(l=>a.jsxs(mn,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[a.jsx(Kr,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Board"})]})]},`${l.id}-board`)),n.map(l=>a.jsxs(mn,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[a.jsx(ta,{className:"text-muted-foreground"}),a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"font-mono text-[11px] text-muted-foreground shrink-0",children:l.identifier}),a.jsx("span",{className:"truncate",children:l.name}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Issues"})]})]},`${l.id}-issues`))]})]})]})]})}function _r({zone:e,props:t}){const r=t5(e);return r.length?a.jsx(a.Fragment,{children:r.map((n,s)=>a.jsx(n,{...t},n.displayName??n.name??s))}):null}function ux({flow:e,inviteToken:t,label:r,disabled:n}){const s=()=>{const i=`${Xi}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return a.jsxs(ne,{type:"button",variant:"outline",className:"w-full gap-2 bg-white dark:bg-black text-black dark:text-white",onClick:s,disabled:n,children:[a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[a.jsx("path",{d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4"}),a.jsx("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18z",fill:"#34A853"}),a.jsx("path",{d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05"}),a.jsx("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z",fill:"#EA4335"})]}),r??"Continue with Google"]})}function rc(){var e;return((e=window.__MERIDIAN_CONFIG__)==null?void 0:e.appName)??"Meridian"}function BT(){var e;return(e=window.__MERIDIAN_CONFIG__)==null?void 0:e.logoUrl}function nc({className:e}){const t=BT();return t?a.jsx("img",{src:t,alt:rc(),className:e??"h-12 w-12"}):a.jsx("div",{className:e??"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})})}function WT(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(!1),o=pt(),l=nD(),{data:c}=Lu(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>U.error(f.message??"Invalid email or password")})};return a.jsx("div",{className:"min-h-screen bg-white dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsx(_r,{zone:"login.before",props:{}}),a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx(nc,{}),a.jsxs("div",{className:"text-center",children:[a.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Welcome to ",rc()]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Sign in to access the admin area"})]})]}),a.jsxs("form",{onSubmit:d,className:"space-y-2",children:[a.jsx(Me,{type:"email",placeholder:"Email",value:e,onChange:u=>t(u.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:s?"text":"password",placeholder:"Password",value:r,onChange:u=>n(u.target.value),autoComplete:"current-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>i(!s),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:s?a.jsx(Xl,{className:"h-4 w-4"}):a.jsx(Ni,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(Mr,{to:"/forgot-password",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})}),a.jsx("div",{className:"pt-1",children:a.jsx(ne,{type:"submit",className:"w-full h-10 font-medium",disabled:l.isPending,children:l.isPending?"Signing in...":"Continue with Email"})})]}),(c==null?void 0:c.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(ux,{flow:"login"})]}),((c==null?void 0:c.needsSetup)||(c==null?void 0:c.registrationEnabled))&&a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",a.jsx(Mr,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),a.jsx(_r,{zone:"login.after",props:{}})]})})}var UT=Object.defineProperty,qT=Object.defineProperties,HT=Object.getOwnPropertyDescriptors,Cd=Object.getOwnPropertySymbols,uN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,ey=(e,t,r)=>t in e?UT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,KT=(e,t)=>{for(var r in t||(t={}))uN.call(t,r)&&ey(e,r,t[r]);if(Cd)for(var r of Cd(t))fN.call(t,r)&&ey(e,r,t[r]);return e},YT=(e,t)=>qT(e,HT(t)),GT=(e,t)=>{var r={};for(var n in e)uN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cd)for(var n of Cd(e))t.indexOf(n)<0&&fN.call(e,n)&&(r[n]=e[n]);return r};function VT(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function XT(e){let t=h.useRef();return h.useEffect(()=>{t.current=e}),t.current}var QT=18,mN=40,ZT=`${mN}px`,JT=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function e3({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:n}){let[s,i]=h.useState(!1),[o,l]=h.useState(!1),[c,d]=h.useState(!1),u=h.useMemo(()=>r==="none"?!1:(r==="increase-width"||r==="experimental-no-flickering")&&s&&o,[s,o,r]),f=h.useCallback(()=>{let m=e.current,p=t.current;if(!m||!p||c||r==="none")return;let x=m,g=x.getBoundingClientRect().left+x.offsetWidth,v=x.getBoundingClientRect().top+x.offsetHeight/2,y=g-QT,w=v;document.querySelectorAll(JT).length===0&&document.elementFromPoint(y,w)===m||(i(!0),d(!0))},[e,t,c,r]);return h.useEffect(()=>{let m=e.current;if(!m||r==="none")return;function p(){let g=window.innerWidth-m.getBoundingClientRect().right;l(g>=mN)}p();let x=setInterval(p,1e3);return()=>{clearInterval(x)}},[e,r]),h.useEffect(()=>{let m=n||document.activeElement===t.current;if(r==="none"||!m)return;let p=setTimeout(f,0),x=setTimeout(f,2e3),g=setTimeout(f,5e3),v=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(x),clearTimeout(g),clearTimeout(v)}},[t,n,r,f]),{hasPWMBadge:s,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:ZT}}var hN=h.createContext({}),pN=h.forwardRef((e,t)=>{var r=e,{value:n,onChange:s,maxLength:i,textAlign:o="left",pattern:l,placeholder:c,inputMode:d="numeric",onComplete:u,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:m,containerClassName:p,noScriptCSSFallback:x=t3,render:g,children:v}=r,y=GT(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),w,N,j,k,b;let[S,_]=h.useState(typeof y.defaultValue=="string"?y.defaultValue:""),C=n??S,P=XT(C),D=h.useCallback(V=>{s==null||s(V),_(V)},[s]),E=h.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),I=h.useRef(null),F=h.useRef(null),Q=h.useRef({value:C,onChange:D,isIOS:typeof window<"u"&&((N=(w=window==null?void 0:window.CSS)==null?void 0:w.supports)==null?void 0:N.call(w,"-webkit-touch-callout","none"))}),Y=h.useRef({prev:[(j=I.current)==null?void 0:j.selectionStart,(k=I.current)==null?void 0:k.selectionEnd,(b=I.current)==null?void 0:b.selectionDirection]});h.useImperativeHandle(t,()=>I.current,[]),h.useEffect(()=>{let V=I.current,ie=F.current;if(!V||!ie)return;Q.current.value!==V.value&&Q.current.onChange(V.value),Y.current.prev=[V.selectionStart,V.selectionEnd,V.selectionDirection];function pe(){if(document.activeElement!==V){$(null),z(null);return}let be=V.selectionStart,Z=V.selectionEnd,Ae=V.selectionDirection,Te=V.maxLength,Fe=V.value,$e=Y.current.prev,et=-1,Ke=-1,Ze;if(Fe.length!==0&&be!==null&&Z!==null){let br=be===Z,ar=be===Fe.length&&Fe.length<Te;if(br&&!ar){let yt=be;if(yt===0)et=0,Ke=1,Ze="forward";else if(yt===Te)et=yt-1,Ke=yt,Ze="backward";else if(Te>1&&Fe.length>1){let Lt=0;if($e[0]!==null&&$e[1]!==null){Ze=yt<$e[1]?"backward":"forward";let Kt=$e[0]===$e[1]&&$e[0]<Te;Ze==="backward"&&!Kt&&(Lt=-1)}et=Lt+yt,Ke=Lt+yt+1}}et!==-1&&Ke!==-1&&et!==Ke&&I.current.setSelectionRange(et,Ke,Ze)}let rr=et!==-1?et:be,$r=Ke!==-1?Ke:Z,nr=Ze??Ae;$(rr),z($r),Y.current.prev=[rr,$r,nr]}if(document.addEventListener("selectionchange",pe,{capture:!0}),pe(),document.activeElement===V&&T(!0),!document.getElementById("input-otp-style")){let be=document.createElement("style");if(be.id="input-otp-style",document.head.appendChild(be),be.sheet){let Z="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Yo(be.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Yo(be.sheet,`[data-input-otp]:autofill { ${Z} }`),Yo(be.sheet,`[data-input-otp]:-webkit-autofill { ${Z} }`),Yo(be.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Yo(be.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let ue=()=>{ie&&ie.style.setProperty("--root-height",`${V.clientHeight}px`)};ue();let ve=new ResizeObserver(ue);return ve.observe(V),()=>{document.removeEventListener("selectionchange",pe,{capture:!0}),ve.disconnect()}},[]);let[X,re]=h.useState(!1),[ee,T]=h.useState(!1),[M,$]=h.useState(null),[K,z]=h.useState(null);h.useEffect(()=>{VT(()=>{var V,ie,pe,ue;(V=I.current)==null||V.dispatchEvent(new Event("input"));let ve=(ie=I.current)==null?void 0:ie.selectionStart,be=(pe=I.current)==null?void 0:pe.selectionEnd,Z=(ue=I.current)==null?void 0:ue.selectionDirection;ve!==null&&be!==null&&($(ve),z(be),Y.current.prev=[ve,be,Z])})},[C,ee]),h.useEffect(()=>{P!==void 0&&C!==P&&P.length<i&&C.length===i&&(u==null||u(C))},[i,u,P,C]);let G=e3({containerRef:F,inputRef:I,pushPasswordManagerStrategy:f,isFocused:ee}),A=h.useCallback(V=>{let ie=V.currentTarget.value.slice(0,i);if(ie.length>0&&E&&!E.test(ie)){V.preventDefault();return}typeof P=="string"&&ie.length<P.length&&document.dispatchEvent(new Event("selectionchange")),D(ie)},[i,D,P,E]),O=h.useCallback(()=>{var V;if(I.current){let ie=Math.min(I.current.value.length,i-1),pe=I.current.value.length;(V=I.current)==null||V.setSelectionRange(ie,pe),$(ie),z(pe)}T(!0)},[i]),J=h.useCallback(V=>{var ie,pe;let ue=I.current;if(!m&&(!Q.current.isIOS||!V.clipboardData||!ue))return;let ve=V.clipboardData.getData("text/plain"),be=m?m(ve):ve;V.preventDefault();let Z=(ie=I.current)==null?void 0:ie.selectionStart,Ae=(pe=I.current)==null?void 0:pe.selectionEnd,Te=(Z!==Ae?C.slice(0,Z)+be+C.slice(Ae):C.slice(0,Z)+be+C.slice(Z)).slice(0,i);if(Te.length>0&&E&&!E.test(Te))return;ue.value=Te,D(Te);let Fe=Math.min(Te.length,i-1),$e=Te.length;ue.setSelectionRange(Fe,$e),$(Fe),z($e)},[i,D,E,C]),B=h.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),ae=h.useMemo(()=>({position:"absolute",inset:0,width:G.willPushPWMBadge?`calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:G.willPushPWMBadge?`inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[G.PWM_BADGE_SPACE_WIDTH,G.willPushPWMBadge,o]),R=h.useMemo(()=>h.createElement("input",YT(KT({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":C.length===0||void 0,"data-input-otp-mss":M,"data-input-otp-mse":K,inputMode:d,pattern:E==null?void 0:E.source,"aria-placeholder":c,style:ae,maxLength:i,value:C,ref:I,onPaste:V=>{var ie;J(V),(ie=y.onPaste)==null||ie.call(y,V)},onChange:A,onMouseOver:V=>{var ie;re(!0),(ie=y.onMouseOver)==null||ie.call(y,V)},onMouseLeave:V=>{var ie;re(!1),(ie=y.onMouseLeave)==null||ie.call(y,V)},onFocus:V=>{var ie;O(),(ie=y.onFocus)==null||ie.call(y,V)},onBlur:V=>{var ie;T(!1),(ie=y.onBlur)==null||ie.call(y,V)}})),[A,O,J,d,ae,i,K,M,y,E==null?void 0:E.source,C]),q=h.useMemo(()=>({slots:Array.from({length:i}).map((V,ie)=>{var pe;let ue=ee&&M!==null&&K!==null&&(M===K&&ie===M||ie>=M&&ie<K),ve=C[ie]!==void 0?C[ie]:null,be=C[0]!==void 0?null:(pe=c==null?void 0:c[ie])!=null?pe:null;return{char:ve,placeholderChar:be,isActive:ue,hasFakeCaret:ue&&ve===null}}),isFocused:ee,isHovering:!y.disabled&&X}),[ee,X,i,K,M,y.disabled,C]),se=h.useMemo(()=>g?g(q):h.createElement(hN.Provider,{value:q},v),[v,q,g]);return h.createElement(h.Fragment,null,x!==null&&h.createElement("noscript",null,h.createElement("style",null,x)),h.createElement("div",{ref:F,"data-input-otp-container":!0,style:B,className:p},se,h.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},R)))});pN.displayName="Input";function Yo(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var t3=`
549
- [data-input-otp] {
550
- --nojs-bg: white !important;
551
- --nojs-fg: black !important;
552
-
553
- background-color: var(--nojs-bg) !important;
554
- color: var(--nojs-fg) !important;
555
- caret-color: var(--nojs-fg) !important;
556
- letter-spacing: .25em !important;
557
- text-align: center !important;
558
- border: 1px solid var(--nojs-fg) !important;
559
- border-radius: 4px !important;
560
- width: 100% !important;
561
- }
562
- @media (prefers-color-scheme: dark) {
563
- [data-input-otp] {
564
- --nojs-bg: black !important;
565
- --nojs-fg: white !important;
566
- }
567
- }`;const fx=h.forwardRef(({className:e,containerClassName:t,...r},n)=>a.jsx(pN,{ref:n,containerClassName:L("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:L("disabled:cursor-not-allowed",e),...r}));fx.displayName="InputOTP";const _d=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:L("flex items-center",e),...t}));_d.displayName="InputOTPGroup";const Jr=h.forwardRef(({index:e,className:t,...r},n)=>{const s=h.useContext(hN),{char:i,hasFakeCaret:o,isActive:l}=s.slots[e];return a.jsxs("div",{ref:n,className:L("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-2 ring-ring ring-offset-background",t),...r,children:[i,o&&a.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:a.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});Jr.displayName="InputOTPSlot";const xN=h.forwardRef(({...e},t)=>a.jsx("div",{ref:t,role:"separator",...e,children:a.jsx(qa,{})}));xN.displayName="InputOTPSeparator";function r3(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState("form"),[m,p]=h.useState(""),x=pt(),g=aD(),v=rD(),{data:y}=Lu(),w=(y==null?void 0:y.needsSetup)===!0,N=!w&&(y==null?void 0:y.registrationEnabled)===!0,j=async b=>{if(b.preventDefault(),N&&u==="form"){v.mutate({email:s},{onSuccess:()=>f("otp"),onError:S=>U.error(S.message??"Failed to send verification code")});return}g.mutate({email:s,password:o,first_name:e,last_name:r,...N?{otp:m}:{}},{onSuccess:()=>x("/"),onError:S=>U.error(S.message??"Registration failed")})},k=()=>{v.mutate({email:s},{onSuccess:()=>U.success("A new code has been sent"),onError:b=>U.error(b.message??"Failed to resend code")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx(nc,{}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:w?"Set up your account":"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:w?"You're the first user — you'll be the super admin.":u==="otp"?`We sent a code to ${s}`:`Get started with ${rc()}`})]})]}),u==="otp"?a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx(fx,{maxLength:6,value:m,onChange:p,children:a.jsxs(_d,{children:[a.jsx(Jr,{index:0}),a.jsx(Jr,{index:1}),a.jsx(Jr,{index:2}),a.jsx(Jr,{index:3}),a.jsx(Jr,{index:4}),a.jsx(Jr,{index:5})]})})}),a.jsx(ne,{className:"w-full h-10 font-medium",disabled:m.length<6||g.isPending,onClick:j,children:g.isPending?"Creating account...":"Verify & Create Account"}),a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsxs("button",{type:"button",onClick:()=>{f("form"),p("")},className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(go,{className:"h-3.5 w-3.5"}),"Back"]}),a.jsx("button",{type:"button",onClick:k,disabled:v.isPending,className:"text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:v.isPending?"Sending...":"Resend code"})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("form",{onSubmit:j,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Me,{placeholder:"First name",value:e,onChange:b=>t(b.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx(Me,{placeholder:"Last name",value:r,onChange:b=>n(b.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),a.jsx(Me,{type:"email",placeholder:"Email",value:s,onChange:b=>i(b.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:c?"text":"password",placeholder:"Password",value:o,onChange:b=>l(b.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10"}),a.jsx("button",{type:"button",onClick:()=>d(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?a.jsx(Xl,{className:"h-4 w-4"}):a.jsx(Ni,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(ne,{type:"submit",className:"w-full h-10 font-medium",disabled:g.isPending||v.isPending,children:v.isPending?"Sending code...":g.isPending?"Creating account...":N?"Continue":"Create Account"})})]}),(y==null?void 0:y.googleOAuthEnabled)&&a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(ux,{flow:"register",label:w?"Set up with Google":"Continue with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Already have an account?"," ",a.jsx(Mr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})]})})}function n3(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),s=pt(),{setWorkspace:i}=Ie(),o=B5(),l=c=>{c.preventDefault(),e.trim()&&o.mutate({name:e.trim(),is_private:r},{onSuccess:d=>{const u={id:d.workspace.id,name:d.workspace.name,slug:d.workspace.slug};i(u),s(`/${u.slug}/projects`,{replace:!0})},onError:d=>U.error(d.message??"Failed to create workspace")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx(nc,{}),a.jsxs("div",{className:"text-center",children:[a.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Create your ",rc()," workspace"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"A workspace is where your team's projects and issues live."})]})]}),a.jsxs("form",{onSubmit:l,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Me,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:c=>t(c.target.value),autoFocus:!0,required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx("p",{className:"text-xs text-muted-foreground px-0.5",children:"You can rename it later from settings."})]}),a.jsxs("label",{className:"flex items-center gap-2.5 px-0.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox",checked:r,onChange:c=>n(c.target.checked),className:"size-4 rounded border-border accent-indigo-600"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Aa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-foreground",children:"Private workspace"})]}),a.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:"Only visible to members"})]}),a.jsx(ne,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||o.isPending,children:o.isPending?"Creating workspace...":"Create workspace"})]})]})})}function a3(){const{logout:e}=Ie();return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx(nc,{}),a.jsxs("div",{className:"text-center",children:[a.jsxs("h1",{className:"text-lg font-semibold text-foreground",children:["Waiting for ",rc()," access"]}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"You've been added to the system, but haven't been assigned to a workspace yet. An admin will add you shortly."})]})]}),a.jsx(ne,{variant:"outline",className:"w-full",onClick:e,children:"Sign out"})]})})}function s3(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const gN=W.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ac=()=>{const e=W.useContext(gN);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};s3(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
568
- [data-state=closed]
569
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function i3(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function o3(){return mx(/^Mac/)}function l3(){return mx(/^iPhone/)}function ty(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function c3(){return mx(/^iPad/)||o3()&&navigator.maxTouchPoints>1}function vN(){return l3()||c3()}function mx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const d3=24,u3=typeof window<"u"?h.useLayoutEffect:h.useEffect;function ry(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const ym=typeof document<"u"&&window.visualViewport;function ny(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function yN(e){for(ny(e)&&(e=e.parentElement);e&&!ny(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const f3=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Ic=0,bm;function m3(e={}){let{isDisabled:t}=e;u3(()=>{if(!t)return Ic++,Ic===1&&vN()&&(bm=h3()),()=>{Ic--,Ic===0&&(bm==null||bm())}},[t])}function h3(){let e,t=0,r=f=>{e=yN(f.target),!(e===document.documentElement&&e===document.body)&&(t=f.changedTouches[0].pageY)},n=f=>{if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}let m=f.changedTouches[0].pageY,p=e.scrollTop,x=e.scrollHeight-e.clientHeight;x!==0&&((p<=0&&m>t||p>=x&&m<t)&&f.preventDefault(),t=m)},s=f=>{let m=f.target;Nh(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;Nh(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",ym&&(ym.height<window.innerHeight?requestAnimationFrame(()=>{ay(m)}):ym.addEventListener("resize",()=>ay(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=ry(p3(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=ry(Go(document,"touchstart",r,{passive:!1,capture:!0}),Go(document,"touchmove",n,{passive:!1,capture:!0}),Go(document,"touchend",s,{passive:!1,capture:!0}),Go(document,"focus",i,!0),Go(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function p3(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Go(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function ay(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=yN(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let n=r.getBoundingClientRect().top,s=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const o=r.getBoundingClientRect().bottom+d3;i>o&&(r.scrollTop+=s-n)}e=r.parentElement}}function Nh(e){return e instanceof HTMLInputElement&&!f3.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function x3(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function g3(...e){return t=>e.forEach(r=>x3(r,t))}function bN(...e){return h.useCallback(g3(...e),e)}const wN=new WeakMap;function Ft(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([s,i])=>{if(s.startsWith("--")){e.style.setProperty(s,i);return}n[s]=e.style[s],e.style[s]=i}),!r&&wN.set(e,n)}function v3(e,t){if(!e||!(e instanceof HTMLElement))return;let r=wN.get(e);r&&(e.style[t]=r[t])}const Dt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Rc(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let s=n.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Dt(t)?13:12]):(s=n.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Dt(t)?5:4]):null)}function y3(e){return 8*(Math.log(e+1)-2)}function wm(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function b3(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const wt={DURATION:.5,EASE:[.32,.72,0,1]},jN=.4,w3=.25,j3=100,NN=8,Ds=16,kh=26,jm="vaul-dragging";function kN(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function N3({defaultProp:e,onChange:t}){const r=W.useState(e),[n]=r,s=W.useRef(n),i=kN(t);return W.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}function SN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=N3({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=kN(r),c=W.useCallback(d=>{if(i){const f=typeof d=="function"?d(e):d;f!==e&&l(f)}else s(d)},[i,e,s,l]);return[o,c]}function k3({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=SN({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,p]=W.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);W.useEffect(()=>{function S(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const x=W.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),g=W.useMemo(()=>{var S;return(S=r==null?void 0:r.findIndex(_=>_===u))!=null?S:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=W.useMemo(()=>{const S=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var _;return(_=r==null?void 0:r.map(C=>{const P=typeof C=="string";let D=0;if(P&&(D=parseInt(C,10)),Dt(l)){const I=P?D:m?C*S.height:0;return m?l==="bottom"?S.height-I:-S.height+I:I}const E=P?D:m?C*S.width:0;return m?l==="right"?S.width-E:-S.width+E:E}))!=null?_:[]},[r,m,c]),w=W.useMemo(()=>g!==null?y==null?void 0:y[g]:null,[y,g]),N=W.useCallback(S=>{var _;const C=(_=y==null?void 0:y.findIndex(P=>P===S))!=null?_:null;o(C),Ft(n.current,{transition:`transform ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,transform:Dt(l)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),y&&C!==y.length-1&&i!==void 0&&C!==i&&C<i?Ft(s.current,{transition:`opacity ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,opacity:"0"}):Ft(s.current,{transition:`opacity ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(C,0)])},[n.current,r,y,i,s,f]);W.useEffect(()=>{if(u||e){var S;const _=(S=r==null?void 0:r.findIndex(C=>C===e||C===u))!=null?S:-1;y&&_!==-1&&typeof y[_]=="number"&&N(y[_])}},[u,e,r,y,N]);function j({draggedDistance:S,closeDrawer:_,velocity:C,dismissible:P}){if(i===void 0)return;const D=l==="bottom"||l==="right"?(w??0)-S:(w??0)+S,E=g===i-1,I=g===0,F=S>0;if(E&&Ft(s.current,{transition:`opacity ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`}),!d&&C>2&&!F){P?_():N(y[0]);return}if(!d&&C>2&&F&&y&&r){N(y[r.length-1]);return}const Q=y==null?void 0:y.reduce((X,re)=>typeof X!="number"||typeof re!="number"?X:Math.abs(re-D)<Math.abs(X-D)?re:X),Y=Dt(l)?window.innerHeight:window.innerWidth;if(C>jN&&Math.abs(S)<Y*.4){const X=F?1:-1;if(X>0&&x&&r){N(y[r.length-1]);return}if(I&&X<0&&P&&_(),g===null)return;N(y[g+X]);return}N(Q)}function k({draggedDistance:S}){if(w===null)return;const _=l==="bottom"||l==="right"?w-S:w+S;(l==="bottom"||l==="right")&&_<y[y.length-1]||(l==="top"||l==="left")&&_>y[y.length-1]||Ft(n.current,{transform:Dt(l)?`translate3d(0, ${_}px, 0)`:`translate3d(${_}px, 0, 0)`})}function b(S,_){if(!r||typeof g!="number"||!y||i===void 0)return null;const C=g===i-1;if(g>=i&&_)return 0;if(C&&!_)return 1;if(!v&&!C)return null;const D=C?g+1:g-1,E=C?y[D]-y[D-1]:y[D+1]-y[D],I=S/Math.abs(E);return C?1-I:I}return{isLastSnapPoint:x,activeSnapPoint:u,shouldFade:v,getPercentageDragged:b,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:j,onDrag:k,snapPointsOffset:y}}const S3=()=>()=>{};function C3(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:s}=ac(),i=W.useRef(null),o=h.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-kh)/window.innerWidth}W.useEffect(()=>{if(t&&r){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;b3(n&&!s?wm(document.body,{background:"black"}):S3,wm(c,{transformOrigin:Dt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${wt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${wt.EASE.join(",")})`}));const d=wm(c,{borderRadius:`${NN}px`,overflow:"hidden",...Dt(e)?{transform:`scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{d(),i.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty("background")},wt.DURATION*1e3)}}},[t,r,o])}let Vo=null;function _3({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:i}){const[o,l]=W.useState(()=>typeof window<"u"?window.location.href:""),c=W.useRef(0),d=W.useCallback(()=>{if(ty()&&Vo===null&&e&&!i){Vo={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:f,innerHeight:m}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-f}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=m-window.innerHeight;p&&c.current>=m&&(document.body.style.top=`${-(c.current+p)}px`)}),300)}},[e]),u=W.useCallback(()=>{if(ty()&&Vo!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Vo),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),Vo=null}},[o]);return W.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),W.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),W.useEffect(()=>{r||!n||(e?(!window.matchMedia("(display-mode: standalone)").matches&&d(),t||window.setTimeout(()=>{u()},500)):u())},[e,n,o,t,r,d,u]),{restorePositionSetting:u}}function M3({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=w3,scrollLockTimeout:d=j3,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:x,fixed:g,modal:v=!0,onClose:y,nested:w,noBodyStyles:N=!1,direction:j="bottom",defaultOpen:k=!1,disablePreventScroll:b=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:_=!1,repositionInputs:C=!0,onAnimationEnd:P,container:D,autoFocus:E=!1}){var I,F;const[Q=!1,Y]=SN({defaultProp:k,prop:e,onChange:Oe=>{t==null||t(Oe),!Oe&&!w&&Ze(),setTimeout(()=>{P==null||P(Oe)},wt.DURATION*1e3),Oe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Oe||(document.body.style.pointerEvents="auto")}}),[X,re]=W.useState(!1),[ee,T]=W.useState(!1),[M,$]=W.useState(!1),K=W.useRef(null),z=W.useRef(null),G=W.useRef(null),A=W.useRef(null),O=W.useRef(null),J=W.useRef(!1),B=W.useRef(null),ae=W.useRef(0),R=W.useRef(!1),q=W.useRef(!k),se=W.useRef(0),V=W.useRef(null),ie=W.useRef(((I=V.current)==null?void 0:I.getBoundingClientRect().height)||0),pe=W.useRef(((F=V.current)==null?void 0:F.getBoundingClientRect().width)||0),ue=W.useRef(0),ve=W.useCallback(Oe=>{i&&Oe===Fe.length-1&&(z.current=new Date)},[]),{activeSnapPoint:be,activeSnapPointIndex:Z,setActiveSnapPoint:Ae,onRelease:Te,snapPointsOffset:Fe,onDrag:$e,shouldFade:et,getPercentageDragged:Ke}=k3({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:x,drawerRef:V,fadeFromIndex:m,overlayRef:K,onSnapPointChange:ve,direction:j,container:D,snapToSequentialPoint:S});m3({isDisabled:!Q||ee||!v||M||!X||!C||!b});const{restorePositionSetting:Ze}=_3({isOpen:Q,modal:v,nested:w??!1,hasBeenOpened:X,preventScrollRestoration:_,noBodyStyles:N});function rr(){return(window.innerWidth-kh)/window.innerWidth}function $r(Oe){var xe,je;!u&&!i||V.current&&!V.current.contains(Oe.target)||(ie.current=((xe=V.current)==null?void 0:xe.getBoundingClientRect().height)||0,pe.current=((je=V.current)==null?void 0:je.getBoundingClientRect().width)||0,T(!0),G.current=new Date,vN()&&window.addEventListener("touchend",()=>J.current=!1,{once:!0}),Oe.target.setPointerCapture(Oe.pointerId),ae.current=Dt(j)?Oe.pageY:Oe.pageX)}function nr(Oe,xe){var je;let he=Oe;const ye=(je=window.getSelection())==null?void 0:je.toString(),Ve=V.current?Rc(V.current,j):null,de=new Date;if(he.tagName==="SELECT"||he.hasAttribute("data-vaul-no-drag")||he.closest("[data-vaul-no-drag]"))return!1;if(j==="right"||j==="left")return!0;if(z.current&&de.getTime()-z.current.getTime()<500)return!1;if(Ve!==null&&(j==="bottom"?Ve>0:Ve<0))return!0;if(ye&&ye.length>0)return!1;if(O.current&&de.getTime()-O.current.getTime()<d&&Ve===0||xe)return O.current=de,!1;for(;he;){if(he.scrollHeight>he.clientHeight){if(he.scrollTop!==0)return O.current=new Date,!1;if(he.getAttribute("role")==="dialog")return!0}he=he.parentNode}return!0}function br(Oe){if(V.current&&ee){const xe=j==="bottom"||j==="right"?1:-1,je=(ae.current-(Dt(j)?Oe.pageY:Oe.pageX))*xe,he=je>0,ye=i&&!u&&!he;if(ye&&Z===0)return;const Ve=Math.abs(je),de=document.querySelector("[data-vaul-drawer-wrapper]"),_e=j==="bottom"||j==="top"?ie.current:pe.current;let Re=Ve/_e;const bt=Ke(Ve,he);if(bt!==null&&(Re=bt),ye&&Re>=1||!J.current&&!nr(Oe.target,he))return;if(V.current.classList.add(jm),J.current=!0,Ft(V.current,{transition:"none"}),Ft(K.current,{transition:"none"}),i&&$e({draggedDistance:je}),he&&!i){const at=y3(je),wr=Math.min(at*-1,0)*xe;Ft(V.current,{transform:Dt(j)?`translate3d(0, ${wr}px, 0)`:`translate3d(${wr}px, 0, 0)`});return}const nt=1-Re;if((et||m&&Z===m-1)&&(n==null||n(Oe,Re),Ft(K.current,{opacity:`${nt}`,transition:"none"},!0)),de&&K.current&&o){const at=Math.min(rr()+Re*(1-rr()),1),wr=8-Re*8,ir=Math.max(0,14-Re*14);Ft(de,{borderRadius:`${wr}px`,transform:Dt(j)?`scale(${at}) translate3d(0, ${ir}px, 0)`:`scale(${at}) translate3d(${ir}px, 0, 0)`,transition:"none"},!0)}if(!i){const at=Ve*xe;Ft(V.current,{transform:Dt(j)?`translate3d(0, ${at}px, 0)`:`translate3d(${at}px, 0, 0)`})}}}W.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),W.useEffect(()=>{var Oe;function xe(){if(!V.current||!C)return;const je=document.activeElement;if(Nh(je)||R.current){var he;const ye=((he=window.visualViewport)==null?void 0:he.height)||0,Ve=window.innerHeight;let de=Ve-ye;const _e=V.current.getBoundingClientRect().height||0,Re=_e>Ve*.8;ue.current||(ue.current=_e);const bt=V.current.getBoundingClientRect().top;if(Math.abs(se.current-de)>60&&(R.current=!R.current),i&&i.length>0&&Fe&&Z){const nt=Fe[Z]||0;de+=nt}if(se.current=de,_e>ye||R.current){const nt=V.current.getBoundingClientRect().height;let at=nt;nt>ye&&(at=ye-(Re?bt:kh)),g?V.current.style.height=`${nt-Math.max(de,0)}px`:V.current.style.height=`${Math.max(at,ye-bt)}px`}else i3()||(V.current.style.height=`${ue.current}px`);i&&i.length>0&&!R.current?V.current.style.bottom="0px":V.current.style.bottom=`${Math.max(de,0)}px`}}return(Oe=window.visualViewport)==null||Oe.addEventListener("resize",xe),()=>{var je;return(je=window.visualViewport)==null?void 0:je.removeEventListener("resize",xe)}},[Z,i,Fe]);function ar(Oe){Lt(),y==null||y(),Oe||Y(!1),setTimeout(()=>{i&&Ae(i[0])},wt.DURATION*1e3)}function yt(){if(!V.current)return;const Oe=document.querySelector("[data-vaul-drawer-wrapper]"),xe=Rc(V.current,j);Ft(V.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`}),Ft(K.current,{transition:`opacity ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,opacity:"1"}),o&&xe&&xe>0&&Q&&Ft(Oe,{borderRadius:`${NN}px`,overflow:"hidden",...Dt(j)?{transform:`scale(${rr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${rr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${wt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${wt.EASE.join(",")})`},!0)}function Lt(){!ee||!V.current||(V.current.classList.remove(jm),J.current=!1,T(!1),A.current=new Date)}function Kt(Oe){if(!ee||!V.current)return;V.current.classList.remove(jm),J.current=!1,T(!1),A.current=new Date;const xe=Rc(V.current,j);if(!Oe||!nr(Oe.target,!1)||!xe||Number.isNaN(xe)||G.current===null)return;const je=A.current.getTime()-G.current.getTime(),he=ae.current-(Dt(j)?Oe.pageY:Oe.pageX),ye=Math.abs(he)/je;if(ye>.05&&($(!0),setTimeout(()=>{$(!1)},200)),i){Te({draggedDistance:he*(j==="bottom"||j==="right"?1:-1),closeDrawer:ar,velocity:ye,dismissible:u}),s==null||s(Oe,!0);return}if(j==="bottom"||j==="right"?he>0:he<0){yt(),s==null||s(Oe,!0);return}if(ye>jN){ar(),s==null||s(Oe,!1);return}var Ve;const de=Math.min((Ve=V.current.getBoundingClientRect().height)!=null?Ve:0,window.innerHeight);var _e;const Re=Math.min((_e=V.current.getBoundingClientRect().width)!=null?_e:0,window.innerWidth),bt=j==="left"||j==="right";if(Math.abs(xe)>=(bt?Re:de)*c){ar(),s==null||s(Oe,!1);return}s==null||s(Oe,!0),yt()}W.useEffect(()=>(Q&&(Ft(document.documentElement,{scrollBehavior:"auto"}),z.current=new Date),()=>{v3(document.documentElement,"scrollBehavior")}),[Q]);function sr(Oe){const xe=Oe?(window.innerWidth-Ds)/window.innerWidth:1,je=Oe?-Ds:0;B.current&&window.clearTimeout(B.current),Ft(V.current,{transition:`transform ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,transform:Dt(j)?`scale(${xe}) translate3d(0, ${je}px, 0)`:`scale(${xe}) translate3d(${je}px, 0, 0)`}),!Oe&&V.current&&(B.current=setTimeout(()=>{const he=Rc(V.current,j);Ft(V.current,{transition:"none",transform:Dt(j)?`translate3d(0, ${he}px, 0)`:`translate3d(${he}px, 0, 0)`})},500))}function Ln(Oe,xe){if(xe<0)return;const je=(window.innerWidth-Ds)/window.innerWidth,he=je+xe*(1-je),ye=-Ds+xe*Ds;Ft(V.current,{transform:Dt(j)?`scale(${he}) translate3d(0, ${ye}px, 0)`:`scale(${he}) translate3d(${ye}px, 0, 0)`,transition:"none"})}function pa(Oe,xe){const je=Dt(j)?window.innerHeight:window.innerWidth,he=xe?(je-Ds)/je:1,ye=xe?-Ds:0;xe&&Ft(V.current,{transition:`transform ${wt.DURATION}s cubic-bezier(${wt.EASE.join(",")})`,transform:Dt(j)?`scale(${he}) translate3d(0, ${ye}px, 0)`:`scale(${he}) translate3d(${ye}px, 0, 0)`})}return W.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),W.createElement(Yl,{defaultOpen:k,onOpenChange:Oe=>{!u&&!Oe||(Oe?re(!0):ar(!0),Y(Oe))},open:Q},W.createElement(gN.Provider,{value:{activeSnapPoint:be,snapPoints:i,setActiveSnapPoint:Ae,drawerRef:V,overlayRef:K,onOpenChange:t,onPress:$r,onRelease:Kt,onDrag:br,dismissible:u,shouldAnimate:q,handleOnly:f,isOpen:Q,isDragging:ee,shouldFade:et,closeDrawer:ar,onNestedDrag:Ln,onNestedOpenChange:sr,onNestedRelease:pa,keyboardIsOpen:R,modal:v,snapPointsOffset:Fe,activeSnapPointIndex:Z,direction:j,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:N,container:D,autoFocus:E}},r))}const CN=W.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:s,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=ac(),d=bN(t,r),u=n&&n.length>0;if(!l)return null;const f=W.useCallback(m=>s(m),[s]);return W.createElement(yi,{onMouseUp:f,ref:d,"data-vaul-overlay":"","data-vaul-snap-points":o&&u?"true":"false","data-vaul-snap-points-overlay":o&&i?"true":"false","data-vaul-animate":c!=null&&c.current?"true":"false",...e})});CN.displayName="Drawer.Overlay";const _N=W.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},s){const{drawerRef:i,onPress:o,onRelease:l,onDrag:c,keyboardIsOpen:d,snapPointsOffset:u,activeSnapPointIndex:f,modal:m,isOpen:p,direction:x,snapPoints:g,container:v,handleOnly:y,shouldAnimate:w,autoFocus:N}=ac(),[j,k]=W.useState(!1),b=bN(s,i),S=W.useRef(null),_=W.useRef(null),C=W.useRef(!1),P=g&&g.length>0;C3();const D=(I,F,Q=0)=>{if(C.current)return!0;const Y=Math.abs(I.y),X=Math.abs(I.x),re=X>Y,ee=["bottom","right"].includes(F)?1:-1;if(F==="left"||F==="right"){if(!(I.x*ee<0)&&X>=0&&X<=Q)return re}else if(!(I.y*ee<0)&&Y>=0&&Y<=Q)return!re;return C.current=!0,!0};W.useEffect(()=>{P&&window.requestAnimationFrame(()=>{k(!0)})},[]);function E(I){S.current=null,C.current=!1,l(I)}return W.createElement(bi,{"data-vaul-drawer-direction":x,"data-vaul-drawer":"","data-vaul-delayed-snap-points":j?"true":"false","data-vaul-snap-points":p&&P?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":w!=null&&w.current?"true":"false",...n,ref:b,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:I=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,I),S.current={x:I.pageX,y:I.pageY},o(I))},onOpenAutoFocus:I=>{r==null||r(I),N||I.preventDefault()},onPointerDownOutside:I=>{if(e==null||e(I),!m||I.defaultPrevented){I.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:I=>{if(!m){I.preventDefault();return}},onPointerMove:I=>{if(_.current=I,y||(n.onPointerMove==null||n.onPointerMove.call(n,I),!S.current))return;const F=I.pageY-S.current.y,Q=I.pageX-S.current.x,Y=I.pointerType==="touch"?10:2;D({x:Q,y:F},x,Y)?c(I):(Math.abs(Q)>Y||Math.abs(F)>Y)&&(S.current=null)},onPointerUp:I=>{n.onPointerUp==null||n.onPointerUp.call(n,I),S.current=null,C.current=!1,l(I)},onPointerOut:I=>{n.onPointerOut==null||n.onPointerOut.call(n,I),E(_.current)},onContextMenu:I=>{n.onContextMenu==null||n.onContextMenu.call(n,I),_.current&&E(_.current)}})});_N.displayName="Drawer.Content";const P3=250,O3=120,E3=W.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:s,isDragging:i,snapPoints:o,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:d,handleOnly:u,isOpen:f,onPress:m,onDrag:p}=ac(),x=W.useRef(null),g=W.useRef(!1);function v(){if(g.current){N();return}window.setTimeout(()=>{y()},O3)}function y(){if(i||e||g.current){N();return}if(N(),!o||o.length===0){d||s();return}if(l===o[o.length-1]&&d){s();return}const k=o.findIndex(S=>S===l);if(k===-1)return;const b=o[k+1];c(b)}function w(){x.current=window.setTimeout(()=>{g.current=!0},P3)}function N(){x.current&&window.clearTimeout(x.current),g.current=!1}return W.createElement("div",{onClick:v,onPointerCancel:N,onPointerDown:j=>{u&&m(j),w()},onPointerMove:j=>{u&&p(j)},ref:n,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},W.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});E3.displayName="Drawer.Handle";function A3(e){const t=ac(),{container:r=t.container,...n}=e;return W.createElement(Kl,{container:r,...n})}const Va={Root:M3,Content:_N,Overlay:CN,Portal:A3,Title:ho,Description:po},Si=({shouldScaleBackground:e=!1,direction:t="right",...r})=>a.jsx(Va.Root,{shouldScaleBackground:e,direction:t,...r});Si.displayName="Drawer";const D3=Va.Portal,MN=h.forwardRef(({className:e,...t},r)=>a.jsx(Va.Overlay,{ref:r,className:L("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));MN.displayName=Va.Overlay.displayName;const Ci=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(D3,{children:[a.jsx(MN,{}),a.jsx(Va.Content,{ref:n,className:L("fixed inset-y-0 right-0 z-50 flex h-full flex-col border-l border-border bg-background shadow-xl","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right","w-full max-w-lg",e),...r,children:t})]}));Ci.displayName="DrawerContent";const ko=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...t});ko.displayName="DrawerHeader";const So=({className:e,...t})=>a.jsx("div",{className:L("flex-1 overflow-y-auto px-6 py-4",e),...t});So.displayName="DrawerBody";const sc=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 px-6 py-4 border-t border-border shrink-0",e),...t});sc.displayName="DrawerFooter";const Co=h.forwardRef(({className:e,...t},r)=>a.jsx(Va.Title,{ref:r,className:L("text-base font-semibold text-foreground",e),...t}));Co.displayName=Va.Title.displayName;const T3=h.forwardRef(({className:e,...t},r)=>a.jsx(Va.Description,{ref:r,className:L("text-sm text-muted-foreground",e),...t}));T3.displayName=Va.Description.displayName;const I3=Vl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),mt=h.forwardRef(({className:e,...t},r)=>a.jsx(Fj,{ref:r,className:L(I3(),e),...t}));mt.displayName=Fj.displayName;const hx=h.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:L("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-none placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-none",e),ref:r,...t}));hx.displayName="Textarea";const sy=[{name:"Backlog",key:"backlog",color:"#94a3b8",category:"backlog",position:0},{name:"Todo",key:"todo",color:"#64748b",category:"unstarted",position:1},{name:"In Progress",key:"in_progress",color:"#6366f1",category:"started",position:2},{name:"In Review",key:"in_review",color:"#f59e0b",category:"started",position:3},{name:"Done",key:"done",color:"#10b981",category:"completed",position:4},{name:"Cancelled",key:"cancelled",color:"#9ca3af",category:"cancelled",position:5}],Nm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function R3(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function $3({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:i,transition:o,isDragging:l}=Bp({id:e.key});return a.jsxs("div",{ref:s,style:{transform:Wp.Transform.toString(i),transition:o},className:L("flex items-center gap-1 pl-1 pr-1.5 py-0.5 rounded-full border text-xs font-medium transition-opacity",l?"opacity-50":"opacity-100"),children:[a.jsx("span",{...r,...n,className:"text-muted-foreground/50 hover:text-muted-foreground cursor-grab touch-none",children:a.jsx(D1,{className:"h-3 w-3"})}),a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e.color}}),a.jsx("span",{className:"text-[11px]",children:e.name}),a.jsx("button",{type:"button",onClick:t,className:"ml-0.5 text-muted-foreground/50 hover:text-muted-foreground transition-colors",children:a.jsx(Je,{className:"h-3 w-3"})})]})}const z3=3;function L3({open:e,onClose:t}){var Q;const[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState(!1),[m,p]=h.useState(sy),[x,g]=h.useState(""),[v,y]=h.useState(Nm[2]),{workspace:w}=Ie(),N=CD(),j=kD(r,{enabled:e}),k=SD(s,{enabled:e});h.useEffect(()=>{e&&j.data&&!c&&i(j.data)},[e,j.data,c]);const b=k.available===!1||N.isError&&((Q=N.error)==null?void 0:Q.status)===409,S=s.trim().length>=z3&&/^[A-Z0-9]+$/i.test(s.trim()),_=e1(Lp(t1,{activationConstraint:{distance:5}})),C=Y=>{n(Y)},P=()=>{r.trim()&&!c&&j.flush()},D=()=>{n(""),i(""),l(""),d(!1),f(!1),p(sy),g(""),y(Nm[2]),N.reset(),t()},E=()=>{if(!x.trim())return;const Y=R3(x.trim());if(m.some(X=>X.key===Y)){U.error("A status with this name already exists");return}p(X=>[...X,{name:x.trim(),key:Y,color:v,category:"started",position:X.length}]),g("")},I=Y=>{const{active:X,over:re}=Y;!re||X.id===re.id||p(ee=>{const T=ee.findIndex($=>$.key===X.id),M=ee.findIndex($=>$.key===re.id);return fd(ee,T,M).map(($,K)=>({...$,position:K}))})},F=Y=>{Y.preventDefault(),!(!r.trim()||!s.trim()||!S||b)&&N.mutate({name:r.trim(),identifier:s.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:w.id,initial_statuses:m},{onSuccess:()=>{U.success("Project created"),D()},onError:X=>{(X==null?void 0:X.status)===409?U.error("This project key is already in use."):U.error(X.message??"Failed to create project")}})};return a.jsx(Si,{open:e,onOpenChange:Y=>!Y&&D(),dismissible:!1,children:a.jsxs(Ci,{className:"max-w-md",children:[a.jsx(ko,{children:a.jsx(Co,{children:"New project"})}),a.jsxs("form",{onSubmit:F,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(So,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{htmlFor:"project-name",children:"Name"}),a.jsx(Me,{id:"project-name",placeholder:"My Project",value:r,onChange:Y=>C(Y.target.value),onBlur:P,autoFocus:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Project key below will auto-fill when you finish typing; you can change it."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{htmlFor:"project-id",children:["Identifier",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Used as issue prefix (e.g. PROJ-1)"})]}),a.jsx(Me,{id:"project-id",placeholder:"PROJ",value:s,onChange:Y=>{i(Y.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:L("font-mono",b&&"border-destructive"),"aria-invalid":b}),b&&a.jsx("p",{className:"text-xs text-destructive",children:"This project key is already in use."})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{htmlFor:"project-desc",children:["Description",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(hx,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:Y=>l(Y.target.value),className:"min-h-[80px]"})]}),a.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[a.jsx("button",{type:"button",onClick:()=>f(!u),className:"w-full flex items-center justify-between px-3 py-2.5 text-xs font-medium hover:bg-muted/40 transition-colors",children:a.jsxs("span",{className:"flex items-center gap-1.5",children:[u?a.jsx(ca,{className:"h-3.5 w-3.5"}):a.jsx(hr,{className:"h-3.5 w-3.5"}),"Statuses",a.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",m.length,")"]})]})}),u&&a.jsxs("div",{className:"px-3 pb-3 border-t border-border space-y-3 pt-3",children:[a.jsx(yl,{sensors:_,onDragEnd:I,children:a.jsx(Fp,{items:m.map(Y=>Y.key),strategy:r1,children:a.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(Y=>a.jsx($3,{chip:Y,onRemove:()=>p(X=>X.filter(re=>re.key!==Y.key).map((re,ee)=>({...re,position:ee})))},Y.key))})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:Nm.map(Y=>a.jsx("button",{type:"button",onClick:()=>y(Y),className:L("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===Y?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:Y}},Y))}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[a.jsx(Me,{placeholder:"Status name…",value:x,onChange:Y=>g(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),E())},className:"h-7 text-xs flex-1"}),a.jsx(ne,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:E,disabled:!x.trim(),children:a.jsx(ut,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),a.jsxs(sc,{children:[a.jsx(ne,{type:"button",variant:"ghost",onClick:D,children:"Cancel"}),a.jsx(ne,{type:"submit",disabled:!r.trim()||!s.trim()||!S||b||N.isPending,children:N.isPending?"Creating...":"Create project"})]})]})]})})}const Pt=RO,Ot=$O,_t=h.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(IO,{children:a.jsx(Bj,{ref:s,align:t,sideOffset:r,className:L("z-50 w-72 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));_t.displayName=Bj.displayName;function Ma({options:e,selected:t,onSelectionChange:r,placeholder:n="Select…",className:s}){var d;const[i,o]=h.useState(!1);function l(u){t.includes(u)?r(t.filter(f=>f!==u)):r([...t,u])}const c=t.length===0?null:t.length===1?(d=e.find(u=>u.value===t[0]))==null?void 0:d.label:`${t.length} selected`;return a.jsxs(Pt,{open:i,onOpenChange:o,children:[a.jsx(Ot,{asChild:!0,children:a.jsxs(ne,{variant:"outline",role:"combobox","aria-expanded":i,className:L("h-8 justify-between text-xs font-normal min-w-36",!c&&"text-muted-foreground",s),children:[a.jsx("span",{className:"truncate",children:c??n}),a.jsx(vo,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),a.jsxs(_t,{className:"w-56 p-0",align:"start",children:[a.jsxs(Zs,{children:[a.jsx(Vu,{placeholder:"Search…",className:"h-8 text-xs"}),a.jsxs(Js,{children:[a.jsx(Xu,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),a.jsx(fs,{children:e.map(u=>a.jsxs(mn,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[a.jsx(Xt,{className:L("mr-2 h-3.5 w-3.5",t.includes(u.value)?"opacity-100":"opacity-0")}),u.label]},u.value))})]})]}),t.length>0&&a.jsx("div",{className:"border-t p-2",children:a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[a.jsx(Je,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function F3({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:s}=Ie(),i=(s==null?void 0:s.id)??"",{data:o,isLoading:l}=ua(r),{data:c}=Zl(i),{data:d}=zu(i),u=Q1(r),f=Z1(r),m=J1(r),p=eN(r),[x,g]=h.useState([]),[v,y]=h.useState([]),w=new Set((o==null?void 0:o.members.map(b=>b.user_id))??[]),N=new Set((o==null?void 0:o.teams.map(b=>b.team_id))??[]),j=(c??[]).filter(b=>!w.has(b.user_id)),k=(d??[]).filter(b=>!N.has(b.id));return a.jsx(Ka,{open:e,onOpenChange:b=>!b&&t(),children:a.jsxs(fa,{className:"sm:max-w-[480px]",children:[a.jsx(Ya,{children:a.jsxs(Ga,{children:["Access — ",n]})}),a.jsxs("div",{className:"space-y-5 pt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),l?a.jsx("div",{className:"space-y-2",children:[1,2].map(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-3.5 w-32"})]},b))}):(o==null?void 0:o.members.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No individual members."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.members.map(b=>{var E;const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"",P=`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown",D=(_[0]??C[0]??((E=S==null?void 0:S.email)==null?void 0:E[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx(Rt,{className:"h-7 w-7 shrink-0",children:a.jsx($t,{className:"text-[11px] font-medium",children:D})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:P}),a.jsx("span",{className:L("text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",b.role==="manager"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:b.role}),a.jsx("button",{onClick:()=>f.mutate(b.user_id,{onSuccess:()=>U.success("Access removed"),onError:()=>U.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]},b.id)})}),j.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(yo,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx(Ma,{options:j.map(b=>{const S=b.user,_=(S==null?void 0:S.first_name)??"",C=(S==null?void 0:S.last_name)??"";return{value:b.user_id,label:`${_} ${C}`.trim()||(S==null?void 0:S.email)||"Unknown"}}),selected:x,onSelectionChange:g,placeholder:"Add people…",className:"flex-1"}),x.length>0&&a.jsx(ne,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userIds:x},{onSuccess:b=>{U.success(`${b.added} member${b.added===1?"":"s"} added`),g([])},onError:()=>U.error("Failed to grant access")}),children:x.length===1?"Add":`Add ${x.length} members`})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),l?a.jsx("div",{className:"space-y-2",children:[1].map(b=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg"}),a.jsx(le,{className:"h-3.5 w-28"})]},b))}):(o==null?void 0:o.teams.length)===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No teams have access."}):a.jsx("div",{className:"space-y-1",children:o==null?void 0:o.teams.map(b=>{const S=b.team;return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(li,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:(S==null?void 0:S.name)??"Unknown team"}),S&&a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[S.member_count," ",S.member_count===1?"member":"members"]}),a.jsx("button",{onClick:()=>p.mutate(b.team_id,{onSuccess:()=>U.success("Team access removed"),onError:()=>U.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]},b.id)})}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx(li,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx(Ma,{options:k.map(b=>({value:b.id,label:b.name})),selected:v,onSelectionChange:y,placeholder:"Add teams…",className:"flex-1"}),v.length>0&&a.jsx(ne,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:b=>{U.success(`${b.added} team${b.added===1?"":"s"} added`),y([])},onError:()=>U.error("Failed to add teams")}),children:v.length===1?"Add":`Add ${v.length} teams`})]})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx(ne,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const PN=6048e5,B3=864e5,W3=36e5,$c=43200,iy=1440,oy=Symbol.for("constructDateFrom");function Nt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&oy in e?e[oy](t):e instanceof Date?new e.constructor(t):new Date(t)}function He(e,t){return Nt(t||e,e)}function Hr(e,t,r){const n=He(e,r==null?void 0:r.in);return isNaN(t)?Nt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function px(e,t,r){const n=He(e,r==null?void 0:r.in);if(isNaN(t))return Nt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const s=n.getDate(),i=Nt((r==null?void 0:r.in)||e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return s>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),s),n)}let U3={};function _o(){return U3}function Zi(e,t){var l,c,d,u;const r=_o(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=He(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?7:0)+i-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Sl(e,t){return Zi(e,{...t,weekStartsOn:1})}function ON(e,t){const r=He(e,t==null?void 0:t.in),n=r.getFullYear(),s=Nt(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=Sl(s),o=Nt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=Sl(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function Md(e){const t=He(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ma(e,...t){const r=Nt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function Ji(e,t){const r=He(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Qu(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t),i=Ji(n),o=Ji(s),l=+i-Md(i),c=+o-Md(o);return Math.round((l-c)/B3)}function q3(e,t){const r=ON(e,t),n=Nt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Sl(n)}function H3(e,t,r){return Hr(e,t*7,r)}function K3(e,t,r){return px(e,t*12,r)}function Y3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=Nt.bind(null,s));const i=He(s,n);(!r||r<i||isNaN(+i))&&(r=i)}),Nt(n,r||NaN)}function G3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=Nt.bind(null,s));const i=He(s,n);(!r||r>i||isNaN(+i))&&(r=i)}),Nt(n,r||NaN)}function md(e,t){const r=+He(e)-+He(t);return r<0?-1:r>0?1:r}function xx(e){return Nt(e,Date.now())}function eo(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t);return+Ji(n)==+Ji(s)}function EN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function V3(e){return!(!EN(e)&&typeof e!="number"||isNaN(+He(e)))}function gx(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t),i=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return i*12+o}function AN(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t),i=ly(n,s),o=Math.abs(Qu(n,s));n.setDate(n.getDate()-i*o);const l=+(ly(n,s)===-i),c=i*(o-l);return c===0?0:c}function ly(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function DN(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function X3(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t),i=(+n-+s)/W3;return DN(r==null?void 0:r.roundingMethod)(i)}function Q3(e,t){return+He(e)-+He(t)}function TN(e,t){const r=He(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function vx(e,t){const r=He(e,t==null?void 0:t.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function Z3(e,t){const r=He(e,t==null?void 0:t.in);return+TN(r,t)==+vx(r,t)}function IN(e,t,r){const[n,s,i]=ma(r==null?void 0:r.in,e,e,t),o=md(s,i),l=Math.abs(gx(s,i));if(l<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=md(s,i)===-o;Z3(n)&&l===1&&md(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function J3(e,t,r){const n=Q3(e,t)/1e3;return DN(r==null?void 0:r.roundingMethod)(n)}function RN(e,t){const[r,n]=ma(e,t.start,t.end);return{start:r,end:n}}function eI(e,t){const{start:r,end:n}=RN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setDate(1);let l=1;const c=[];for(;+o<=i;)c.push(Nt(r,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function $N(e,t){const r=He(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function tI(e,t){const r=He(e,t==null?void 0:t.in),n=r.getFullYear();return r.setFullYear(n+1,0,0),r.setHours(23,59,59,999),r}function zN(e,t){const r=He(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function rI(e,t){const{start:r,end:n}=RN(t==null?void 0:t.in,e);let s=+r>+n;const i=s?+r:+n,o=s?n:r;o.setHours(0,0,0,0),o.setMonth(0,1);let l=1;const c=[];for(;+o<=i;)c.push(Nt(r,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function LN(e,t){var l,c,d,u;const r=_o(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=He(e,t==null?void 0:t.in),i=s.getDay(),o=(i<n?-7:0)+6-(i-n);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function nI(e,t){return LN(e,{...t,weekStartsOn:1})}const aI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},sI=(e,t,r)=>{let n;const s=aI[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function km(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const iI={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},oI={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lI={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cI={date:km({formats:iI,defaultWidth:"full"}),time:km({formats:oI,defaultWidth:"full"}),dateTime:km({formats:lI,defaultWidth:"full"})},dI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},uI=(e,t,r,n)=>dI[e];function Xo(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const fI={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mI={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},hI={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pI={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},xI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},gI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vI=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},yI={ordinalNumber:vI,era:Xo({values:fI,defaultWidth:"wide"}),quarter:Xo({values:mI,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Xo({values:hI,defaultWidth:"wide"}),day:Xo({values:pI,defaultWidth:"wide"}),dayPeriod:Xo({values:xI,defaultWidth:"wide",formattingValues:gI,defaultFormattingWidth:"wide"})};function Qo(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?wI(l,f=>f.test(o)):bI(l,f=>f.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function bI(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function wI(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function jI(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const NI=/^(\d+)(th|st|nd|rd)?/i,kI=/\d+/i,SI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},CI={any:[/^b/i,/^(a|c)/i]},_I={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},MI={any:[/1/i,/2/i,/3/i,/4/i]},PI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},OI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},EI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},AI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},DI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},TI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},II={ordinalNumber:jI({matchPattern:NI,parsePattern:kI,valueCallback:e=>parseInt(e,10)}),era:Qo({matchPatterns:SI,defaultMatchWidth:"wide",parsePatterns:CI,defaultParseWidth:"any"}),quarter:Qo({matchPatterns:_I,defaultMatchWidth:"wide",parsePatterns:MI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Qo({matchPatterns:PI,defaultMatchWidth:"wide",parsePatterns:OI,defaultParseWidth:"any"}),day:Qo({matchPatterns:EI,defaultMatchWidth:"wide",parsePatterns:AI,defaultParseWidth:"any"}),dayPeriod:Qo({matchPatterns:DI,defaultMatchWidth:"any",parsePatterns:TI,defaultParseWidth:"any"})},qs={code:"en-US",formatDistance:sI,formatLong:cI,formatRelative:uI,localize:yI,match:II,options:{weekStartsOn:0,firstWeekContainsDate:1}};function RI(e,t){const r=He(e,t==null?void 0:t.in);return Qu(r,zN(r))+1}function yx(e,t){const r=He(e,t==null?void 0:t.in),n=+Sl(r)-+q3(r);return Math.round(n/PN)+1}function FN(e,t){var u,f,m,p;const r=He(e,t==null?void 0:t.in),n=r.getFullYear(),s=_o(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(m=s.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Zi(o,t),c=Nt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Zi(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function $I(e,t){var l,c,d,u;const r=_o(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=FN(e,t),i=Nt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Zi(i,t)}function bx(e,t){const r=He(e,t==null?void 0:t.in),n=+Zi(r,t)-+$I(r,t);return Math.round(n/PN)+1}function tt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const os={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return tt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):tt(r+1,2)},d(e,t){return tt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return tt(e.getHours()%12||12,t.length)},H(e,t){return tt(e.getHours(),t.length)},m(e,t){return tt(e.getMinutes(),t.length)},s(e,t){return tt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return tt(s,t.length)}},Di={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cy={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return os.y(e,t)},Y:function(e,t,r,n){const s=FN(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return tt(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):tt(i,t.length)},R:function(e,t){const r=ON(e);return tt(r,t.length)},u:function(e,t){const r=e.getFullYear();return tt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return tt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return tt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return os.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return tt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=bx(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):tt(s,t.length)},I:function(e,t,r){const n=yx(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):tt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):os.d(e,t)},D:function(e,t,r){const n=RI(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):tt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return tt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return tt(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return tt(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;switch(n===12?s=Di.noon:n===0?s=Di.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=Di.evening:n>=12?s=Di.afternoon:n>=4?s=Di.morning:s=Di.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return os.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):os.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):tt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):tt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):os.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):os.s(e,t)},S:function(e,t){return os.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return uy(n);case"XXXX":case"XX":return zs(n);case"XXXXX":case"XXX":default:return zs(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return uy(n);case"xxxx":case"xx":return zs(n);case"xxxxx":case"xxx":default:return zs(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+dy(n,":");case"OOOO":default:return"GMT"+zs(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+dy(n,":");case"zzzz":default:return"GMT"+zs(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return tt(n,t.length)},T:function(e,t,r){return tt(+e,t.length)}};function dy(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),i=n%60;return i===0?r+String(s):r+String(s)+t+tt(i,2)}function uy(e,t){return e%60===0?(e>0?"-":"+")+tt(Math.abs(e)/60,2):zs(e,t)}function zs(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=tt(Math.trunc(n/60),2),i=tt(n%60,2);return r+s+t+i}const fy=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},BN=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},zI=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return fy(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",fy(n,t)).replace("{{time}}",BN(s,t))},LI={p:BN,P:zI},FI=/^D+$/,BI=/^Y+$/,WI=["D","DD","YY","YYYY"];function UI(e){return FI.test(e)}function qI(e){return BI.test(e)}function HI(e,t,r){const n=KI(e,t,r);if(console.warn(n),WI.includes(e))throw new RangeError(n)}function KI(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const YI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,GI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,VI=/^'([^]*?)'?$/,XI=/''/g,QI=/[a-zA-Z]/;function fe(e,t,r){var u,f,m,p,x,g,v,y;const n=_o(),s=(r==null?void 0:r.locale)??n.locale??qs,i=(r==null?void 0:r.firstWeekContainsDate)??((f=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=He(e,r==null?void 0:r.in);if(!V3(l))throw new RangeError("Invalid time value");let c=t.match(GI).map(w=>{const N=w[0];if(N==="p"||N==="P"){const j=LI[N];return j(w,s.formatLong)}return w}).join("").match(YI).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const N=w[0];if(N==="'")return{isToken:!1,value:ZI(w)};if(cy[N])return{isToken:!0,value:w};if(N.match(QI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+N+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(w=>{if(!w.isToken)return w.value;const N=w.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&qI(N)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&UI(N))&&HI(N,t,String(e));const j=cy[N[0]];return j(l,N,s.localize,d)}).join("")}function ZI(e){const t=e.match(VI);return t?t[1].replace(XI,"'"):e}function Sh(e,t,r){const n=_o(),s=(r==null?void 0:r.locale)??n.locale??qs,i=2520,o=md(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o}),[c,d]=ma(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=J3(d,c),f=(Md(d)-Md(c))/1e3,m=Math.round((u-f)/60);let p;if(m<2)return r!=null&&r.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,l):u<10?s.formatDistance("lessThanXSeconds",10,l):u<20?s.formatDistance("lessThanXSeconds",20,l):u<40?s.formatDistance("halfAMinute",0,l):u<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):m===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",m,l);if(m<45)return s.formatDistance("xMinutes",m,l);if(m<90)return s.formatDistance("aboutXHours",1,l);if(m<iy){const x=Math.round(m/60);return s.formatDistance("aboutXHours",x,l)}else{if(m<i)return s.formatDistance("xDays",1,l);if(m<$c){const x=Math.round(m/iy);return s.formatDistance("xDays",x,l)}else if(m<$c*2)return p=Math.round(m/$c),s.formatDistance("aboutXMonths",p,l)}if(p=IN(d,c),p<12){const x=Math.round(m/$c);return s.formatDistance("xMonths",x,l)}else{const x=p%12,g=Math.trunc(p/12);return x<3?s.formatDistance("aboutXYears",g,l):x<9?s.formatDistance("overXYears",g,l):s.formatDistance("almostXYears",g+1,l)}}function JI(e,t){return Sh(e,xx(e),t)}function bl(e,t){return He(e,t==null?void 0:t.in).getDate()}function e4(e,t){return He(e,t==null?void 0:t.in).getDay()}function Ss(e,t){const r=He(e,t==null?void 0:t.in),n=r.getFullYear(),s=r.getMonth(),i=Nt(r,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function hd(e,t){return He(e,t==null?void 0:t.in).getMonth()}function t4(e,t){return He(e,t==null?void 0:t.in).getFullYear()}function r4(e,t){return+He(e)>+He(t)}function n4(e,t){return+He(e)<+He(t)}function a4(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function s4(e,t,r){const[n,s]=ma(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()}function i4(e,t){return eo(Nt(e,e),xx(e))}function WN(e,t,r){return Hr(e,-t,r)}function o4(e,t){return eo(Nt(e,e),WN(xx(e),1))}function l4(e,t,r){const n=He(e,r==null?void 0:r.in),s=n.getFullYear(),i=n.getDate(),o=Nt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=Ss(o);return n.setMonth(t,Math.min(i,l)),n}function c4(e,t,r){const n=He(e,r==null?void 0:r.in);return isNaN(+n)?Nt(e,NaN):(n.setFullYear(t),n)}function d4(){const[e,t]=h.useState(!1),[r,n]=h.useState(null),[s,i]=h.useState(""),[o,l]=h.useState("all"),{workspace:c}=zt(),{data:d,isLoading:u}=jo(),f=_D(),m=pt(),p=(d??[]).filter(x=>(o==="all"||x.status===o)&&(!s||x.name.toLowerCase().includes(s.toLowerCase())||x.identifier.toLowerCase().includes(s.toLowerCase())));return a.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),a.jsxs(ne,{size:"sm",onClick:()=>t(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"Create"]})]}),a.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 md:py-4 border-b border-border md:flex-row md:items-center md:justify-between",children:[a.jsx("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-none",children:["all","active","paused","archived"].map(x=>a.jsx("button",{onClick:()=>l(x),className:L("px-3 h-7 rounded-md text-xs font-medium transition-colors whitespace-nowrap shrink-0",o===x?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:x==="all"?"All":x.charAt(0).toUpperCase()+x.slice(1)},x))}),a.jsxs("div",{className:"relative",children:[a.jsx(ki,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Me,{placeholder:"Search...",value:s,onChange:x=>i(x.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),a.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Identifier"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Created"}),a.jsx("span",{})]}),u?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(x=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-4 w-12"}),a.jsx(le,{className:"h-5 w-16 rounded-full"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx("div",{})]},`d-${x}`),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3",children:[a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-4 w-40"}),a.jsx(le,{className:"h-3 w-24"})]}),a.jsx(le,{className:"h-6 w-6 rounded-full"})]},`m-${x}`)]}))}):p.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Kr,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:s||o!=="all"?"No projects match":"No projects yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s||o!=="all"?"Try adjusting your filters.":"Create your first project to get started."}),!s&&o==="all"&&a.jsxs(ne,{size:"sm",onClick:()=>t(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"Create project"]})]}):a.jsx("div",{className:"divide-y divide-border",children:p.map(x=>a.jsxs("div",{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors group",onClick:()=>m(`/${c}/projects/${x.identifier}/board`),children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.name}),x.description&&a.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:x.description})]}),a.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:x.identifier}),a.jsx("div",{children:a.jsxs("span",{className:L("inline-flex items-center gap-1.5 text-xs",x.status==="active"&&"text-emerald-600",x.status==="paused"&&"text-amber-600",x.status==="archived"&&"text-muted-foreground"),children:[a.jsx("span",{className:L("h-1.5 w-1.5 rounded-full shrink-0",x.status==="active"&&"bg-emerald-500",x.status==="paused"&&"bg-amber-500",x.status==="archived"&&"bg-zinc-400")}),x.status.charAt(0).toUpperCase()+x.status.slice(1)]})}),a.jsx("span",{className:"text-sm text-muted-foreground",children:fe(new Date(x.created_at),"MMM d, yyyy")}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Ea,{className:"h-4 w-4"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(st,{onClick:()=>m(`/${c}/projects/${x.identifier}/board`),children:[a.jsx(Kr,{className:"h-4 w-4"}),"Open board"]}),a.jsxs(st,{onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsx(ta,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(st,{onClick:()=>n({id:x.id,name:x.name}),children:[a.jsx(Aa,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${x.name}"? This cannot be undone.`)&&f.mutate(x.id,{onSuccess:()=>U.success("Project deleted"),onError:()=>U.error("Failed to delete project")})},children:[a.jsx(Or,{className:"h-4 w-4"}),"Delete"]})]})]})})]}),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[a.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.name}),a.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:x.identifier})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:L("h-1.5 w-1.5 rounded-full shrink-0",x.status==="active"&&"bg-emerald-500",x.status==="paused"&&"bg-amber-500",x.status==="archived"&&"bg-zinc-400")}),a.jsx("span",{className:L("text-xs",x.status==="active"&&"text-emerald-600",x.status==="paused"&&"text-amber-600",x.status==="archived"&&"text-muted-foreground"),children:x.status.charAt(0).toUpperCase()+x.status.slice(1)}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:fe(new Date(x.created_at),"MMM d, yyyy")})]})]}),a.jsx("div",{onClick:g=>g.stopPropagation(),children:a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx(ne,{variant:"ghost",size:"icon-sm",className:"h-8 w-8 text-muted-foreground",children:a.jsx(Ea,{className:"h-4 w-4"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(st,{onClick:()=>m(`/${c}/projects/${x.identifier}/issues`),children:[a.jsx(ta,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(st,{onClick:()=>n({id:x.id,name:x.name}),children:[a.jsx(Aa,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${x.name}"? This cannot be undone.`)&&f.mutate(x.id,{onSuccess:()=>U.success("Project deleted"),onError:()=>U.error("Failed to delete project")})},children:[a.jsx(Or,{className:"h-4 w-4"}),"Delete"]})]})]})})]})]},x.id))}),!u&&p.length>0&&a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:["1 — ",p.length," of ",p.length," result",p.length!==1?"s":""]}),a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[a.jsx("span",{children:"1 of 1 pages"}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),a.jsx(L3,{open:e,onClose:()=>t(!1)}),r&&a.jsx(F3,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name})]})}const ic={byProject:e=>["projects",e,"statuses"]};function Mo(e){return Le({queryKey:ic.byProject(e??""),queryFn:()=>oe.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function u4(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}function f4(e,t){const r=Ne();return ge({mutationFn:n=>oe.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:ic.byProject(e)})}})}function m4(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}function h4(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:ic.byProject(e)})}})}const _i={all:["users"],list:e=>[..._i.all,"list",e??{}]};function UN(e){const{limit:t=20,offset:r=0,q:n=""}=e??{},s=new URLSearchParams;return s.set("limit",String(t)),s.set("offset",String(r)),n&&s.set("q",n),Le({queryKey:_i.list({limit:t,offset:r,q:n}),queryFn:()=>oe.get(`/admin/users?${s}`),staleTime:1e3*60*5,placeholderData:i=>i})}const Zu={all:["org-invitations"],list:e=>[...Zu.all,"list",e??{}]};function p4(e){const{limit:t=20,offset:r=0,q:n=""}=e??{},s=new URLSearchParams;return s.set("limit",String(t)),s.set("offset",String(r)),n&&s.set("q",n),Le({queryKey:Zu.list({limit:t,offset:r,q:n}),queryFn:()=>oe.get(`/admin/users/invitations?${s}`),staleTime:1e3*30,placeholderData:i=>i})}function x4(){const e=Ne();return ge({mutationFn:t=>oe.delete(`/admin/users/invitations/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:Zu.all})})}function g4(){return ge({mutationFn:e=>oe.post(`/admin/users/invitations/${e}/resend`)})}function v4(){const e=Ne();return ge({mutationFn:({email:t,role:r})=>oe.post("/admin/users/invite",{email:t,role:r}),onSuccess:()=>e.invalidateQueries({queryKey:Zu.all})})}function y4(){const e=Ne();return ge({mutationFn:({userId:t,role:r})=>oe.patch(`/admin/users/${t}`,{role:r}),onSuccess:()=>e.invalidateQueries({queryKey:_i.all})})}function b4(){const e=Ne();return ge({mutationFn:t=>oe.delete(`/admin/users/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:_i.all})})}function w4(){const e=Ne();return ge({mutationFn:t=>oe.post(`/admin/users/${t}/reactivate`),onSuccess:()=>e.invalidateQueries({queryKey:_i.all})})}function qN(){return Le({queryKey:[..._i.all,"map-list"],queryFn:()=>oe.get("/admin/users/map"),select:e=>e.users,staleTime:1e3*60*5})}function _s(){return Le({queryKey:[..._i.all,"map"],queryFn:()=>oe.get("/admin/users/map"),select:e=>new Map(e.users.map(t=>{var o;const r=t.first_name??"",n=t.last_name??"",s=`${r} ${n}`.trim()||t.email,i=(r[0]??n[0]??((o=t.email)==null?void 0:o[0])??"U").toUpperCase();return[t.id,{name:s,initials:i}]})),staleTime:1e3*60*5})}const ui={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},an={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},oc={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},Da={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},j4=({priority:e})=>{const t=L("h-3 w-3 shrink-0",oc[e]);switch(e){case"urgent":return a.jsx(da,{className:t});case"high":return a.jsx(ji,{className:t});case"medium":return a.jsx(qa,{className:t});case"low":return a.jsx(wi,{className:t});default:return a.jsx(Pr,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function HN({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=_s(),{attributes:s,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=Bp({id:e.id}),u={transform:Wp.Transform.toString(l),transition:c};return a.jsxs("div",{ref:o,style:u,...s,...i,onClick:r,className:L("bg-white dark:bg-card border border-border rounded-lg px-3 py-2.5 cursor-pointer select-none","hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors",d&&"opacity-40 shadow-lg ring-2 ring-indigo/30"),children:[a.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),a.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mb-2",children:[a.jsx(Wt,{className:"h-2.5 w-2.5 shrink-0"}),a.jsx("span",{children:e.start_date?fe(new Date(e.start_date),"MMM d"):"?"}),a.jsx("span",{children:"→"}),a.jsx("span",{children:e.due_date?fe(new Date(e.due_date),"MMM d"):"?"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-[11px] font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:e.identifier}),e.parent_id&&a.jsx("span",{className:"flex items-center text-zinc-400 dark:text-zinc-500 shrink-0",title:"Child issue",children:a.jsx(On,{className:"h-3 w-3"})}),t>0&&a.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:[a.jsx(On,{className:"h-2.5 w-2.5"}),t]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&a.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(p=>{const x=n==null?void 0:n.get(p);return a.jsx(Rt,{className:"h-4 w-4 border border-background",children:a.jsx($t,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(x==null?void 0:x.initials)??"?"})},p)}),(((f=e.assignee_ids)==null?void 0:f.length)??0)>2&&a.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((m=e.assignee_ids)==null?void 0:m.length)??0)-2]})]}),a.jsx(j4,{priority:e.priority})]})]})]})}function zc(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),s=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(s)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${s},${i},${t})`}const N4=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(aa,{className:r,style:n});case"started":return a.jsx(Rn,{className:r,style:n});default:return a.jsx(Pr,{className:r,style:n})}};function k4({id:e,label:t,color:r,category:n,issues:s,childCounts:i,sortable:o,onIssueClick:l,onRename:c,onDelete:d,isRenaming:u,renameValue:f,onRenameChange:m,onRenameSubmit:p,onRenameCancel:x}){const{setNodeRef:g,isOver:v}=pE({id:e}),{attributes:y,listeners:w,setNodeRef:N,transform:j,transition:k,isDragging:b}=Bp({id:e,disabled:!o}),S=h.useRef(null),_=h.useRef(!1);h.useEffect(()=>{u&&(_.current=!1,setTimeout(()=>{var F;return(F=S.current)==null?void 0:F.focus()},0))},[u]);const C=o?{transform:Wp.Transform.toString(j),transition:k}:void 0,P=zc(r,.08),D=zc(r,.16),E=zc(r,.35),I=!!(c||d);return a.jsxs("div",{ref:N,style:C,className:L("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",b&&"opacity-50"),children:[a.jsxs("div",{className:L("flex items-center gap-2 mb-2 px-1",o&&"cursor-grab"),children:[o&&a.jsx("span",{...y,...w,className:"text-muted-foreground/40 hover:text-muted-foreground touch-none",children:a.jsx(D1,{className:"h-3.5 w-3.5"})}),a.jsx(N4,{category:n,color:r}),u?a.jsx("input",{ref:S,value:f??"",onChange:F=>m==null?void 0:m(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),p==null||p()),F.key==="Escape"&&(F.preventDefault(),_.current=!0,x==null||x())},onBlur:()=>{_.current||p==null||p()},className:"flex-1 text-xs font-medium bg-transparent border-b border-foreground/30 outline-none py-0.5 min-w-0"}):a.jsx("span",{className:"text-xs font-medium text-foreground",children:t}),a.jsx("span",{className:"ml-1 text-[11px] font-medium rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",style:{backgroundColor:zc(r,.12),color:r},children:s.length}),I&&!u&&a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"ml-auto h-5 w-5 flex items-center justify-center rounded opacity-0 group-hover/col:opacity-100 hover:bg-muted transition-opacity text-muted-foreground hover:text-foreground",onClick:F=>F.stopPropagation(),children:a.jsx(Ea,{className:"h-3.5 w-3.5"})})}),a.jsxs(Er,{align:"end",className:"w-40",children:[c&&a.jsx(st,{onClick:c,children:"Rename"}),c&&d&&a.jsx(An,{}),d&&a.jsx(st,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),a.jsxs("div",{ref:g,className:L("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?D:P,boxShadow:v?`inset 0 0 0 1px ${E}`:void 0},children:[a.jsx(Fp,{items:s.map(F=>F.id),strategy:xE,children:s.map(F=>a.jsx(HN,{issue:F,childCount:(i==null?void 0:i.get(F.id))??0,onClick:()=>l==null?void 0:l(F)},F.id))}),s.length===0&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:a.jsx("p",{className:"text-xs text-muted-foreground/40",children:"Drop here"})})]})]})}const qe=UO,Xe=qO,We=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Wj,{ref:n,className:L("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-none ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(zO,{asChild:!0,children:a.jsx(ca,{className:"h-4 w-4 opacity-50"})})]}));We.displayName=Wj.displayName;const KN=h.forwardRef(({className:e,...t},r)=>a.jsx(Uj,{ref:r,className:L("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Gp,{className:"h-4 w-4"})}));KN.displayName=Uj.displayName;const YN=h.forwardRef(({className:e,...t},r)=>a.jsx(qj,{ref:r,className:L("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ca,{className:"h-4 w-4"})}));YN.displayName=qj.displayName;const Ue=h.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(LO,{children:a.jsxs(Hj,{ref:s,className:L("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[a.jsx(KN,{}),a.jsx(FO,{className:L("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(YN,{})]})}));Ue.displayName=Hj.displayName;const S4=h.forwardRef(({className:e,...t},r)=>a.jsx(Kj,{ref:r,className:L("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));S4.displayName=Kj.displayName;const ke=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Yj,{ref:n,className:L("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(BO,{children:a.jsx(Xt,{className:"h-4 w-4"})})}),a.jsx(WO,{children:t})]}));ke.displayName=Yj.displayName;const C4=h.forwardRef(({className:e,...t},r)=>a.jsx(Gj,{ref:r,className:L("-mx-1 my-1 h-px bg-border",e),...t}));C4.displayName=Gj.displayName;const Sm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],_4=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function M4({open:e,onClose:t,projectId:r}){const[n,s]=h.useState(""),[i,o]=h.useState(Sm[0]),[l,c]=h.useState(""),[d,u]=h.useState("started"),f=u4(r),m=l||i,p=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{U.success("Status created"),s(""),o(Sm[0]),c(""),u("started"),t()},onError:()=>U.error("Failed to create status")})};return a.jsx(Si,{open:e,onOpenChange:x=>!x&&t(),children:a.jsxs(Ci,{className:"sm:max-w-sm",children:[a.jsx(ko,{children:a.jsx(Co,{className:"text-sm font-medium",children:"New Status"})}),a.jsx(So,{children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Name"}),a.jsx(Me,{placeholder:"e.g. In Review",value:n,onChange:x=>s(x.target.value),onKeyDown:x=>x.key==="Enter"&&p(),autoFocus:!0,className:"h-8 text-sm"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Color"}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Sm.map(x=>a.jsx("button",{onClick:()=>{o(x),c("")},className:L("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===x&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:x}},x)),a.jsxs("div",{className:"flex items-center gap-1.5 ml-1",children:[a.jsx("div",{className:"h-6 w-6 rounded-full border border-border shrink-0",style:{backgroundColor:l||"#e5e7eb"}}),a.jsx(Me,{placeholder:"#hex",value:l,onChange:x=>c(x.target.value),className:"h-6 w-20 text-xs px-1.5"})]})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-muted-foreground mb-1.5",children:"Category"}),a.jsxs(qe,{value:d,onValueChange:x=>u(x),children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:_4.map(x=>a.jsx(ke,{value:x.value,className:"text-xs",children:x.label},x.value))})]})]})]})}),a.jsxs(sc,{className:"mt-2",children:[a.jsx(ne,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),a.jsx(ne,{size:"sm",onClick:p,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function P4({projectId:e}){const[t,r]=h.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:a.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-2 px-3 py-2 rounded-xl border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted/30 transition-colors text-xs font-medium h-9",children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Add status"]})}),a.jsx(M4,{open:t,onClose:()=>r(!1),projectId:e})]})}function O4({open:e,statusName:t,issueCount:r,otherStatuses:n,onConfirm:s,onCancel:i,isLoading:o}){const[l,c]=h.useState(""),d=()=>{r>0&&!l||s(r>0?l:null)};return a.jsx(Ka,{open:e,onOpenChange:u=>{u||i()},children:a.jsxs(fa,{className:"sm:max-w-md",children:[a.jsxs(Ya,{children:[a.jsx(Ga,{children:"Delete status"}),a.jsx(No,{children:r>0?`${r} issue${r!==1?"s":""} in "${t}" will be moved to another status.`:`Delete the "${t}" status. This cannot be undone.`})]}),r>0&&a.jsxs("div",{className:"py-2",children:[a.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Move issues to"}),a.jsxs(qe,{value:l,onValueChange:c,children:[a.jsx(We,{children:a.jsx(Xe,{placeholder:"Select a status..."})}),a.jsx(Ue,{children:n.map(u=>a.jsx(ke,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:u.color}}),u.name]})},u.id))})]})]}),a.jsxs(lx,{children:[a.jsx(ne,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),a.jsx(ne,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}var wx={};(function e(t,r,n,s){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=function(){if(!t.OffscreenCanvas)return!1;try{var T=new OffscreenCanvas(1,1),M=T.getContext("2d");M.fillRect(0,0,1,1);var $=T.transferToImageBitmap();M.createPattern($,"no-repeat")}catch{return!1}return!0}();function c(){}function d(T){var M=r.exports.Promise,$=M!==void 0?M:t.Promise;return typeof $=="function"?new $(T):(T(c,c),null)}var u=function(T,M){return{transform:function($){if(T)return $;if(M.has($))return M.get($);var K=new OffscreenCanvas($.width,$.height),z=K.getContext("2d");return z.drawImage($,0,0),M.set($,K),K},clear:function(){M.clear()}}}(l,new Map),f=function(){var T=Math.floor(16.666666666666668),M,$,K={},z=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(M=function(G){var A=Math.random();return K[A]=requestAnimationFrame(function O(J){z===J||z+T-1<J?(z=J,delete K[A],G()):K[A]=requestAnimationFrame(O)}),A},$=function(G){K[G]&&cancelAnimationFrame(K[G])}):(M=function(G){return setTimeout(G,T)},$=function(G){return clearTimeout(G)}),{frame:M,cancel:$}}(),m=function(){var T,M,$={};function K(z){function G(A,O){z.postMessage({options:A||{},callback:O})}z.init=function(O){var J=O.transferControlToOffscreen();z.postMessage({canvas:J},[J])},z.fire=function(O,J,B){if(M)return G(O,null),M;var ae=Math.random().toString(36).slice(2);return M=d(function(R){function q(se){se.data.callback===ae&&(delete $[ae],z.removeEventListener("message",q),M=null,u.clear(),B(),R())}z.addEventListener("message",q),G(O,ae),$[ae]=q.bind(null,{data:{callback:ae}})}),M},z.reset=function(){z.postMessage({reset:!0});for(var O in $)$[O](),delete $[O]}}return function(){if(T)return T;if(!n&&i){var z=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
570
- `);try{T=new Worker(URL.createObjectURL(new Blob([z])))}catch(G){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",G),null}K(T)}return T}}(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function x(T,M){return M?M(T):T}function g(T){return T!=null}function v(T,M,$){return x(T&&g(T[M])?T[M]:p[M],$)}function y(T){return T<0?0:Math.floor(T)}function w(T,M){return Math.floor(Math.random()*(M-T))+T}function N(T){return parseInt(T,16)}function j(T){return T.map(k)}function k(T){var M=String(T).replace(/[^0-9a-f]/gi,"");return M.length<6&&(M=M[0]+M[0]+M[1]+M[1]+M[2]+M[2]),{r:N(M.substring(0,2)),g:N(M.substring(2,4)),b:N(M.substring(4,6))}}function b(T){var M=v(T,"origin",Object);return M.x=v(M,"x",Number),M.y=v(M,"y",Number),M}function S(T){T.width=document.documentElement.clientWidth,T.height=document.documentElement.clientHeight}function _(T){var M=T.getBoundingClientRect();T.width=M.width,T.height=M.height}function C(T){var M=document.createElement("canvas");return M.style.position="fixed",M.style.top="0px",M.style.left="0px",M.style.pointerEvents="none",M.style.zIndex=T,M}function P(T,M,$,K,z,G,A,O,J){T.save(),T.translate(M,$),T.rotate(G),T.scale(K,z),T.arc(0,0,1,A,O,J),T.restore()}function D(T){var M=T.angle*(Math.PI/180),$=T.spread*(Math.PI/180);return{x:T.x,y:T.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:T.startVelocity*.5+Math.random()*T.startVelocity,angle2D:-M+(.5*$-Math.random()*$),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:T.color,shape:T.shape,tick:0,totalTicks:T.ticks,decay:T.decay,drift:T.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:T.gravity*3,ovalScalar:.6,scalar:T.scalar,flat:T.flat}}function E(T,M){M.x+=Math.cos(M.angle2D)*M.velocity+M.drift,M.y+=Math.sin(M.angle2D)*M.velocity+M.gravity,M.velocity*=M.decay,M.flat?(M.wobble=0,M.wobbleX=M.x+10*M.scalar,M.wobbleY=M.y+10*M.scalar,M.tiltSin=0,M.tiltCos=0,M.random=1):(M.wobble+=M.wobbleSpeed,M.wobbleX=M.x+10*M.scalar*Math.cos(M.wobble),M.wobbleY=M.y+10*M.scalar*Math.sin(M.wobble),M.tiltAngle+=.1,M.tiltSin=Math.sin(M.tiltAngle),M.tiltCos=Math.cos(M.tiltAngle),M.random=Math.random()+2);var $=M.tick++/M.totalTicks,K=M.x+M.random*M.tiltCos,z=M.y+M.random*M.tiltSin,G=M.wobbleX+M.random*M.tiltCos,A=M.wobbleY+M.random*M.tiltSin;if(T.fillStyle="rgba("+M.color.r+", "+M.color.g+", "+M.color.b+", "+(1-$)+")",T.beginPath(),o&&M.shape.type==="path"&&typeof M.shape.path=="string"&&Array.isArray(M.shape.matrix))T.fill(X(M.shape.path,M.shape.matrix,M.x,M.y,Math.abs(G-K)*.1,Math.abs(A-z)*.1,Math.PI/10*M.wobble));else if(M.shape.type==="bitmap"){var O=Math.PI/10*M.wobble,J=Math.abs(G-K)*.1,B=Math.abs(A-z)*.1,ae=M.shape.bitmap.width*M.scalar,R=M.shape.bitmap.height*M.scalar,q=new DOMMatrix([Math.cos(O)*J,Math.sin(O)*J,-Math.sin(O)*B,Math.cos(O)*B,M.x,M.y]);q.multiplySelf(new DOMMatrix(M.shape.matrix));var se=T.createPattern(u.transform(M.shape.bitmap),"no-repeat");se.setTransform(q),T.globalAlpha=1-$,T.fillStyle=se,T.fillRect(M.x-ae/2,M.y-R/2,ae,R),T.globalAlpha=1}else if(M.shape==="circle")T.ellipse?T.ellipse(M.x,M.y,Math.abs(G-K)*M.ovalScalar,Math.abs(A-z)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI):P(T,M.x,M.y,Math.abs(G-K)*M.ovalScalar,Math.abs(A-z)*M.ovalScalar,Math.PI/10*M.wobble,0,2*Math.PI);else if(M.shape==="star")for(var V=Math.PI/2*3,ie=4*M.scalar,pe=8*M.scalar,ue=M.x,ve=M.y,be=5,Z=Math.PI/be;be--;)ue=M.x+Math.cos(V)*pe,ve=M.y+Math.sin(V)*pe,T.lineTo(ue,ve),V+=Z,ue=M.x+Math.cos(V)*ie,ve=M.y+Math.sin(V)*ie,T.lineTo(ue,ve),V+=Z;else T.moveTo(Math.floor(M.x),Math.floor(M.y)),T.lineTo(Math.floor(M.wobbleX),Math.floor(z)),T.lineTo(Math.floor(G),Math.floor(A)),T.lineTo(Math.floor(K),Math.floor(M.wobbleY));return T.closePath(),T.fill(),M.tick<M.totalTicks}function I(T,M,$,K,z){var G=M.slice(),A=T.getContext("2d"),O,J,B=d(function(ae){function R(){O=J=null,A.clearRect(0,0,K.width,K.height),u.clear(),z(),ae()}function q(){n&&!(K.width===s.width&&K.height===s.height)&&(K.width=T.width=s.width,K.height=T.height=s.height),!K.width&&!K.height&&($(T),K.width=T.width,K.height=T.height),A.clearRect(0,0,K.width,K.height),G=G.filter(function(se){return E(A,se)}),G.length?O=f.frame(q):R()}O=f.frame(q),J=R});return{addFettis:function(ae){return G=G.concat(ae),B},canvas:T,promise:B,reset:function(){O&&f.cancel(O),J&&J()}}}function F(T,M){var $=!T,K=!!v(M||{},"resize"),z=!1,G=v(M,"disableForReducedMotion",Boolean),A=i&&!!v(M||{},"useWorker"),O=A?m():null,J=$?S:_,B=T&&O?!!T.__confetti_initialized:!1,ae=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,R;function q(V,ie,pe){for(var ue=v(V,"particleCount",y),ve=v(V,"angle",Number),be=v(V,"spread",Number),Z=v(V,"startVelocity",Number),Ae=v(V,"decay",Number),Te=v(V,"gravity",Number),Fe=v(V,"drift",Number),$e=v(V,"colors",j),et=v(V,"ticks",Number),Ke=v(V,"shapes"),Ze=v(V,"scalar"),rr=!!v(V,"flat"),$r=b(V),nr=ue,br=[],ar=T.width*$r.x,yt=T.height*$r.y;nr--;)br.push(D({x:ar,y:yt,angle:ve,spread:be,startVelocity:Z,color:$e[nr%$e.length],shape:Ke[w(0,Ke.length)],ticks:et,decay:Ae,gravity:Te,drift:Fe,scalar:Ze,flat:rr}));return R?R.addFettis(br):(R=I(T,br,J,ie,pe),R.promise)}function se(V){var ie=G||v(V,"disableForReducedMotion",Boolean),pe=v(V,"zIndex",Number);if(ie&&ae)return d(function(Z){Z()});$&&R?T=R.canvas:$&&!T&&(T=C(pe),document.body.appendChild(T)),K&&!B&&J(T);var ue={width:T.width,height:T.height};O&&!B&&O.init(T),B=!0,O&&(T.__confetti_initialized=!0);function ve(){if(O){var Z={getBoundingClientRect:function(){if(!$)return T.getBoundingClientRect()}};J(Z),O.postMessage({resize:{width:Z.width,height:Z.height}});return}ue.width=ue.height=null}function be(){R=null,K&&(z=!1,t.removeEventListener("resize",ve)),$&&T&&(document.body.contains(T)&&document.body.removeChild(T),T=null,B=!1)}return K&&!z&&(z=!0,t.addEventListener("resize",ve,!1)),O?O.fire(V,ue,be):q(V,ue,be)}return se.reset=function(){O&&O.reset(),R&&R.reset()},se}var Q;function Y(){return Q||(Q=F(null,{useWorker:!0,resize:!0})),Q}function X(T,M,$,K,z,G,A){var O=new Path2D(T),J=new Path2D;J.addPath(O,new DOMMatrix(M));var B=new Path2D;return B.addPath(J,new DOMMatrix([Math.cos(A)*z,Math.sin(A)*z,-Math.sin(A)*G,Math.cos(A)*G,$,K])),B}function re(T){if(!o)throw new Error("path confetti are not supported in this browser");var M,$;typeof T=="string"?M=T:(M=T.path,$=T.matrix);var K=new Path2D(M),z=document.createElement("canvas"),G=z.getContext("2d");if(!$){for(var A=1e3,O=A,J=A,B=0,ae=0,R,q,se=0;se<A;se+=2)for(var V=0;V<A;V+=2)G.isPointInPath(K,se,V,"nonzero")&&(O=Math.min(O,se),J=Math.min(J,V),B=Math.max(B,se),ae=Math.max(ae,V));R=B-O,q=ae-J;var ie=10,pe=Math.min(ie/R,ie/q);$=[pe,0,0,pe,-Math.round(R/2+O)*pe,-Math.round(q/2+J)*pe]}return{type:"path",path:M,matrix:$}}function ee(T){var M,$=1,K="#000000",z='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof T=="string"?M=T:(M=T.text,$="scalar"in T?T.scalar:$,z="fontFamily"in T?T.fontFamily:z,K="color"in T?T.color:K);var G=10*$,A=""+G+"px "+z,O=new OffscreenCanvas(G,G),J=O.getContext("2d");J.font=A;var B=J.measureText(M),ae=Math.ceil(B.actualBoundingBoxRight+B.actualBoundingBoxLeft),R=Math.ceil(B.actualBoundingBoxAscent+B.actualBoundingBoxDescent),q=2,se=B.actualBoundingBoxLeft+q,V=B.actualBoundingBoxAscent+q;ae+=q+q,R+=q+q,O=new OffscreenCanvas(ae,R),J=O.getContext("2d"),J.font=A,J.fillStyle=K,J.fillText(M,se,V);var ie=1/$;return{type:"bitmap",bitmap:O.transferToImageBitmap(),matrix:[ie,0,0,ie,-ae*ie/2,-R*ie/2]}}r.exports=function(){return Y().apply(this,arguments)},r.exports.reset=function(){Y().reset()},r.exports.create=F,r.exports.shapeFromPath=re,r.exports.shapeFromText=ee})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),wx,!1);const E4=wx.exports;wx.exports.create;function Cm(e,t){var n;const r={};for(const s of t)r[s.key]=[];for(const s of e)if(r[s.status]!==void 0)r[s.status].push(s);else{const i=((n=t[0])==null?void 0:n.key)??"backlog";r[i]=[...r[i]??[],s]}return r}function A4(e,t,r){var i;const n=new Map(t.map(o=>[o.id,o])),s={};for(const o of r)s[o.key]=[];for(const o of r)for(const l of e[o.key]??[]){const c=n.get(l.id);c&&c.status===o.key&&(s[o.key].push(c),n.delete(l.id))}for(const o of n.values()){const l=s[o.status];if(l)l.push(o);else{const c=(i=r[0])==null?void 0:i.key;c&&s[c].push(o)}}return s}function GN({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:s,readOnly:i=!1,filters:o}){var G;const[l,c]=h.useState(()=>r.map(A=>A.id)),[d,u]=h.useState(()=>Cm(e,r)),[f,m]=h.useState(null),[p,x]=h.useState(null),[g,v]=h.useState(null),[y,w]=h.useState(null),[N,j]=h.useState(""),k=h.useRef(null),b=h.useRef(!1),S=Ne(),_=Tt.byProject(t,o),C=m4(t),P=f4(t,y??""),D=h.useMemo(()=>{const A=new Map;for(const O of e)O.parent_id&&A.set(O.parent_id,(A.get(O.parent_id)??0)+1);return A},[e]);h.useEffect(()=>{c(A=>{const O=new Set(r.map(ae=>ae.id)),J=A.filter(ae=>O.has(ae)),B=r.map(ae=>ae.id).filter(ae=>!A.includes(ae));return J.length===A.length&&B.length===0?A:[...J,...B]})},[r]),h.useEffect(()=>{b.current||u(A=>A4(A,e,r))},[e,r]);const E=[...r].sort((A,O)=>{const J=l.indexOf(A.id),B=l.indexOf(O.id);return J===-1&&B===-1?A.position-O.position:J===-1?1:B===-1?-1:J-B}),I=e1(Lp(t1,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),F=h.useCallback(A=>{if(p){const J=A.droppableContainers.filter(B=>l.includes(B.id));return gE({...A,droppableContainers:J})}const O=vE(A);return O.length>0?O:yE(A)},[p,l]),Q=h.useCallback(A=>{for(const[O,J]of Object.entries(d))if(J.some(B=>B.id===A))return O;return null},[d]),Y=h.useCallback(A=>r.some(O=>O.id===A),[r]),X=A=>{const O=A.active.id;if(b.current=!0,Y(O)){x(O);return}for(const[J,B]of Object.entries(d)){const ae=B.find(R=>R.id===O);if(ae){m(ae),k.current=J;return}}},re=A=>{const{active:O,over:J}=A;if(!J||p)return;const B=O.id,ae=J.id;if(Y(B))return;const R=Q(B),q=r.find(V=>V.key===ae||V.id===ae),se=(q==null?void 0:q.key)??Q(ae);!R||!se||R===se||u(V=>{const ie=[...V[R]??[]],pe=[...V[se]??[]],ue=ie.findIndex(Z=>Z.id===B);if(ue===-1)return V;const[ve]=ie.splice(ue,1),be={...ve,status:se};if(q)pe.push(be);else{const Z=pe.findIndex(Ae=>Ae.id===ae);if(Z===-1)pe.push(be);else{const Ae=O.rect.current.translated!=null&&O.rect.current.translated.top>J.rect.top+J.rect.height/2;pe.splice(Ae?Z+1:Z,0,be)}}return{...V,[R]:ie,[se]:pe}})},ee=A=>{var V;const{active:O,over:J}=A;if(m(null),p){if(x(null),b.current=!1,!J||O.id===J.id)return;const ie=l.indexOf(O.id),pe=l.indexOf(J.id);if(ie===-1||pe===-1||ie===pe)return;const ue=fd(l,ie,pe);c(ue),s==null||s(ue);return}if(!J){b.current=!1;const ie=k.current;k.current=null,ie&&u(Cm(e,r));return}const B=O.id,ae=J.id,R=k.current;k.current=null;const q=r.find(ie=>ie.key===ae||ie.id===ae),se=(q==null?void 0:q.key)??Q(ae);if(!R||!se){b.current=!1;return}if(R===se)b.current=!1,u(ie=>{const pe=ie[R]??[],ue=pe.findIndex(be=>be.id===B),ve=pe.findIndex(be=>be.id===ae);return ue===-1||ve===-1||ue===ve?ie:{...ie,[R]:fd(pe,ue,ve)}});else{if(!r.find(ue=>ue.key===ae||ue.id===ae))u(ue=>{const ve=[...ue[se]??[]],be=ve.findIndex($e=>$e.id===B);if(be===-1)return ue;const Z=A.active.rect.current.translated!=null&&A.active.rect.current.translated.top>A.over.rect.top+A.over.rect.height/2,[Ae]=ve.splice(be,1),Te=ve.findIndex($e=>$e.id===ae);if(Te===-1)return ve.splice(be,0,Ae),ue;const Fe=Z?Te+1:Te;return ve.splice(Fe,0,Ae),{...ue,[se]:ve}});else{const ue=((V=A.active.rect.current.translated)==null?void 0:V.top)??1/0,ve=A.over.rect.top+A.over.rect.height/2;ue<ve&&u(be=>{const Z=be[se]??[],Ae=Z.findIndex(Te=>Te.id===B);return Ae<=0?be:{...be,[se]:fd(Z,Ae,0)}})}const pe=S.getQueryData(_);S.cancelQueries({queryKey:_}),S.setQueryData(_,ue=>ue&&{...ue,issues:ue.issues.map(ve=>ve.id===B?{...ve,status:se}:ve)}),oe.put(`/admin/issues/${B}`,{status:se}).then(()=>{b.current=!1,S.invalidateQueries({queryKey:_});const ue=r.find(ve=>ve.key===se);(ue==null?void 0:ue.category)==="completed"&&E4({particleCount:80,spread:60,origin:{y:.6}})}).catch(()=>{b.current=!1,pe&&S.setQueryData(_,pe),u(Cm((pe==null?void 0:pe.issues)??e,r)),U.error("Failed to update issue status")})}},T=A=>{v(A)},M=async A=>{if(!g)return;const O=d[g.key]??[];if(O.length>0){const J=r.find(B=>B.id===A);if(!J)return;try{await Promise.all(O.map(B=>oe.put(`/admin/issues/${B.id}`,{status:J.key}))),S.invalidateQueries({queryKey:Tt.byProject(t)})}catch{U.error("Failed to move issues");return}}C.mutate(g.id,{onSuccess:()=>{U.success(`Status "${g.name}" deleted`),v(null)},onError:()=>U.error("Failed to delete status")})},$=()=>{const A=N.trim();!A||!y||P.mutate({name:A},{onSuccess:()=>{U.success("Status renamed"),w(null)},onError:()=>U.error("Failed to rename status")})},K=()=>{w(null)},z=p?r.find(A=>A.id===p):null;return a.jsxs(yl,{sensors:I,collisionDetection:F,onDragStart:X,onDragOver:re,onDragEnd:ee,children:[a.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[a.jsx(Fp,{items:l,strategy:r1,children:E.map(A=>a.jsx(k4,{id:A.id,label:A.name,color:A.color,category:A.category,issues:d[A.key]??[],childCounts:D,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{w(A.id),j(A.name)},onDelete:i?void 0:()=>T(A),isRenaming:y===A.id,renameValue:y===A.id?N:"",onRenameChange:j,onRenameSubmit:$,onRenameCancel:K},A.id))}),!i&&a.jsx(P4,{projectId:t})]}),a.jsxs(bE,{children:[f&&a.jsx(HN,{issue:f}),z&&a.jsx("div",{className:"opacity-80 min-w-[260px] max-w-[280px]",children:a.jsxs("div",{className:"h-9 flex items-center gap-2 px-3 rounded-xl border border-border bg-background text-xs font-medium text-foreground",children:[a.jsx("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:z.color}}),z.name]})})]}),g&&a.jsx(O4,{open:!!g,statusName:g.name,issueCount:((G=d[g.key])==null?void 0:G.length)??0,otherStatuses:r.filter(A=>A.id!==g.id),onConfirm:M,onCancel:()=>v(null),isLoading:C.isPending})]})}const D4=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],T4=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function Lc({label:e,activeCount:t,children:r}){const[n,s]=h.useState(!1);return a.jsxs(Pt,{open:n,onOpenChange:s,children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:L("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border text-xs font-medium transition-colors",t>0?"border-foreground/30 bg-foreground/5 text-foreground":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[e,t>0&&a.jsx("span",{className:"flex items-center justify-center h-4 w-4 rounded-full bg-foreground text-background text-[10px] font-semibold",children:t}),a.jsx(ca,{className:"h-3 w-3 opacity-60"})]})}),a.jsx(_t,{className:"w-48 p-1",align:"start",children:r})]})}function _m({options:e,selected:t,onToggle:r}){return a.jsx("div",{className:"flex flex-col gap-0.5",children:e.map(n=>{const s=t.includes(n.value);return a.jsxs("button",{onClick:()=>r(n.value),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:L("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",s?"bg-foreground border-foreground":"border-border"),children:s&&a.jsx(Xt,{className:"h-2.5 w-2.5 text-background"})}),n.color&&a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:n.color}}),a.jsx("span",{className:"truncate",children:n.label})]},n.value)})})}function I4({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,p,x;const s=(((c=r.priority)==null?void 0:c.length)??0)>0||!!r.assignee_id||(((d=r.type)==null?void 0:d.length)??0)>0||(((u=r.status)==null?void 0:u.length)??0)>0,i=(g,v)=>{const y=r[g]??[],w=y.includes(v)?y.filter(N=>N!==v):[...y,v];n({...r,[g]:w.length?w:void 0})},o=g=>{n({...r,assignee_id:r.assignee_id===g?void 0:g})},l=r.assignee_id?((f=t.find(g=>g.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lc,{label:r.assignee_id?l:"Assignee",activeCount:r.assignee_id?1:0,children:a.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.length===0&&a.jsx("p",{className:"text-xs text-muted-foreground px-2 py-1.5",children:"No members"}),t.map(g=>{const v=r.assignee_id===g.userId;return a.jsxs("button",{onClick:()=>o(g.userId),className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs hover:bg-muted w-full text-left",children:[a.jsx("div",{className:L("h-3.5 w-3.5 rounded border flex items-center justify-center shrink-0",v?"bg-foreground border-foreground":"border-border"),children:v&&a.jsx(Xt,{className:"h-2.5 w-2.5 text-background"})}),a.jsx("span",{className:"h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[10px] font-medium shrink-0",children:g.initials}),a.jsx("span",{className:"truncate",children:g.name})]},g.userId)})]})}),a.jsx(Lc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:a.jsx(_m,{options:D4,selected:r.priority??[],onToggle:g=>i("priority",g)})}),a.jsx(Lc,{label:"Type",activeCount:((p=r.type)==null?void 0:p.length)??0,children:a.jsx(_m,{options:T4,selected:r.type??[],onToggle:g=>i("type",g)})}),a.jsx(Lc,{label:"Status",activeCount:((x=r.status)==null?void 0:x.length)??0,children:a.jsx(_m,{options:e.map(g=>({value:g.key,label:g.name,color:g.color})),selected:r.status??[],onToggle:g=>i("status",g)})}),s&&a.jsxs("button",{onClick:()=>n({}),className:"inline-flex items-center gap-1 h-7 px-2 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear"]})]})}const R4={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function jx(){return Le({queryKey:["org","calendar"],queryFn:()=>oe.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??R4,timezone:e.timezone})})}function $4(){const e=Ne();return ge({mutationFn:t=>oe.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function Nx(e){const t=e??new Date().getFullYear();return Le({queryKey:["org","holidays",t],queryFn:()=>oe.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function z4(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function L4(){const e=Ne();return ge({mutationFn:({id:t,...r})=>oe.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function F4(){const e=Ne();return ge({mutationFn:t=>oe.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function VN(){return Le({queryKey:["app-config"],queryFn:()=>oe.get("/admin/config"),staleTime:1/0})}const B4=["sun","mon","tue","wed","thu","fri","sat"];function W4(e,t,r){const n=B4[e4(e)];if(!t[n])return!1;const s=hd(e),i=bl(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(hd(l)===s&&bl(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&hd(l)===s&&bl(l)===i)return!1}return!0}function Ch(e,t,r,n){let s=0,i=new Date(e);i.setHours(0,0,0,0);const o=new Date(t);for(o.setHours(0,0,0,0);i<=o;)W4(i,r,n)&&s++,i=Hr(i,1);return s}const to={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function Po(e){return Le({queryKey:e?to.byProject(e):to.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return oe.get(t)},select:t=>t.sprints,enabled:!!e})}function U4(e){const t=Ne();return ge({mutationFn:r=>oe.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:to.byProject(e)})}})}function q4(e,t){const r=Ne();return ge({mutationFn:n=>oe.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:to.byProject(t)}),r.invalidateQueries({queryKey:to.detail(e)})}})}function H4(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:to.byProject(e)})}})}const Ju={byProject:e=>["task-lists","project",e]};function lc(e){return Le({queryKey:e?Ju.byProject(e):["task-lists"],queryFn:()=>oe.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function K4(e){const t=Ne();return ge({mutationFn:r=>oe.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Ju.byProject(e)})}})}function Y4(e){const t=Ne();return ge({mutationFn:({id:r,...n})=>oe.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Ju.byProject(e)})}})}function G4(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Ju.byProject(e)}),t.invalidateQueries({queryKey:Tt.byProject(e)})}})}function my(e,t,r){const n=(e==null?void 0:e[0])??"",s=(t==null?void 0:t[0])??"";return(n+s).toUpperCase()||((r==null?void 0:r[0])??"U").toUpperCase()}function hy(e,t,r){return`${e??""} ${t??""}`.trim()||r}function cc({value:e,onChange:t,disabled:r,users:n}){const[s,i]=h.useState(!1),[o,l]=h.useState(e),{data:c}=qN(),d=n??c??[],u=e.slice().sort().join(",");h.useEffect(()=>{l(e)},[u]);const f=p=>{const x=o.includes(p)?o.filter(g=>g!==p):[...o,p];l(x),t(x)},m=d.filter(p=>o.includes(p.id));return a.jsxs(Pt,{open:s,onOpenChange:i,children:[a.jsx(Ot,{asChild:!0,disabled:r,children:a.jsx("button",{type:"button",className:L("flex items-center gap-1 min-h-[28px] rounded-md px-1.5 py-1","hover:bg-accent transition-colors text-left","focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",r&&"pointer-events-none opacity-50"),children:m.length===0?a.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[a.jsx(yo,{className:"h-3.5 w-3.5"}),"Assign"]}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"flex -space-x-1.5",children:m.slice(0,3).map(p=>a.jsx(Rt,{className:"h-5 w-5 border border-background ring-0",children:a.jsx($t,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:my(p.first_name,p.last_name,p.email)})},p.id))}),m.length>3&&a.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",m.length-3]}),a.jsx("span",{className:"text-xs text-foreground ml-1 hidden sm:inline",children:m.length===1?hy(m[0].first_name,m[0].last_name,m[0].email):`${m.length} assignees`})]})})}),a.jsx(_t,{className:"w-60 p-0",align:"start",children:a.jsxs(Zs,{children:[a.jsx(Vu,{placeholder:"Search users...",className:"h-8 text-xs"}),a.jsxs(Js,{children:[a.jsx(Xu,{className:"text-xs py-4",children:"No users found."}),a.jsx(fs,{children:d.map(p=>{const x=o.includes(p.id),g=hy(p.first_name,p.last_name,p.email),v=my(p.first_name,p.last_name,p.email);return a.jsxs(mn,{value:g,onSelect:()=>f(p.id),className:"gap-2 py-1.5",children:[a.jsx(Rt,{className:"h-5 w-5 shrink-0",children:a.jsx($t,{className:"text-[9px] bg-muted text-muted-foreground",children:v})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs font-medium truncate",children:g}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:p.email})]}),a.jsx(Xt,{className:L("h-3.5 w-3.5 shrink-0",x?"opacity-100 text-indigo-500":"opacity-0")})]},p.id)})})]})]})})]})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:XN,setPrototypeOf:py,isFrozen:V4,getPrototypeOf:X4,getOwnPropertyDescriptor:Q4}=Object;let{freeze:Ar,seal:pn,create:_h}=Object,{apply:Mh,construct:Ph}=typeof Reflect<"u"&&Reflect;Ar||(Ar=function(t){return t});pn||(pn=function(t){return t});Mh||(Mh=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(r,s)});Ph||(Ph=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return new t(...n)});const Fc=Dr(Array.prototype.forEach),Z4=Dr(Array.prototype.lastIndexOf),xy=Dr(Array.prototype.pop),Zo=Dr(Array.prototype.push),J4=Dr(Array.prototype.splice),pd=Dr(String.prototype.toLowerCase),Mm=Dr(String.prototype.toString),Pm=Dr(String.prototype.match),Jo=Dr(String.prototype.replace),eR=Dr(String.prototype.indexOf),tR=Dr(String.prototype.trim),kn=Dr(Object.prototype.hasOwnProperty),jr=Dr(RegExp.prototype.test),el=rR(TypeError);function Dr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return Mh(e,t,n)}}function rR(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Ph(e,r)}}function Be(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pd;py&&py(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=r(s);i!==s&&(V4(t)||(t[n]=i),s=i)}e[s]=!0}return e}function nR(e){for(let t=0;t<e.length;t++)kn(e,t)||(e[t]=null);return e}function Kn(e){const t=_h(null);for(const[r,n]of XN(e))kn(e,r)&&(Array.isArray(n)?t[r]=nR(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Kn(n):t[r]=n);return t}function tl(e,t){for(;e!==null;){const n=Q4(e,t);if(n){if(n.get)return Dr(n.get);if(typeof n.value=="function")return Dr(n.value)}e=X4(e)}function r(){return null}return r}const gy=Ar(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Om=Ar(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Em=Ar(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),aR=Ar(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Am=Ar(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sR=Ar(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vy=Ar(["#text"]),yy=Ar(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Dm=Ar(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),by=Ar(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bc=Ar(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),iR=pn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),oR=pn(/<%[\w\W]*|[\w\W]*%>/gm),lR=pn(/\$\{[\w\W]*/gm),cR=pn(/^data-[\-\w.\u00B7-\uFFFF]+$/),dR=pn(/^aria-[\-\w]+$/),QN=pn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uR=pn(/^(?:\w+script|data):/i),fR=pn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ZN=pn(/^html$/i),mR=pn(/^[a-z][.\w]*(-[.\w]+)+$/i);var wy=Object.freeze({__proto__:null,ARIA_ATTR:dR,ATTR_WHITESPACE:fR,CUSTOM_ELEMENT:mR,DATA_ATTR:cR,DOCTYPE_NAME:ZN,ERB_EXPR:oR,IS_ALLOWED_URI:QN,IS_SCRIPT_OR_DATA:uR,MUSTACHE_EXPR:iR,TMPLIT_EXPR:lR});const rl={element:1,text:3,progressingInstruction:7,comment:8,document:9},hR=function(){return typeof window>"u"?null:window},pR=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(n=r.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},jy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function JN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hR();const t=Ee=>JN(Ee);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==rl.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:p}=e,x=c.prototype,g=tl(x,"cloneNode"),v=tl(x,"remove"),y=tl(x,"nextSibling"),w=tl(x,"childNodes"),N=tl(x,"parentNode");if(typeof o=="function"){const Ee=r.createElement("template");Ee.content&&Ee.content.ownerDocument&&(r=Ee.content.ownerDocument)}let j,k="";const{implementation:b,createNodeIterator:S,createDocumentFragment:_,getElementsByTagName:C}=r,{importNode:P}=n;let D=jy();t.isSupported=typeof XN=="function"&&typeof N=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:E,ERB_EXPR:I,TMPLIT_EXPR:F,DATA_ATTR:Q,ARIA_ATTR:Y,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:re,CUSTOM_ELEMENT:ee}=wy;let{IS_ALLOWED_URI:T}=wy,M=null;const $=Be({},[...gy,...Om,...Em,...Am,...vy]);let K=null;const z=Be({},[...yy,...Dm,...by,...Bc]);let G=Object.seal(_h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),A=null,O=null;const J=Object.seal(_h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let B=!0,ae=!0,R=!1,q=!0,se=!1,V=!0,ie=!1,pe=!1,ue=!1,ve=!1,be=!1,Z=!1,Ae=!0,Te=!1;const Fe="user-content-";let $e=!0,et=!1,Ke={},Ze=null;const rr=Be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $r=null;const nr=Be({},["audio","video","img","source","image","track"]);let br=null;const ar=Be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",Kt="http://www.w3.org/1999/xhtml";let sr=Kt,Ln=!1,pa=null;const Oe=Be({},[yt,Lt,Kt],Mm);let xe=Be({},["mi","mo","mn","ms","mtext"]),je=Be({},["annotation-xml"]);const he=Be({},["title","style","font","a","script"]);let ye=null;const Ve=["application/xhtml+xml","text/html"],de="text/html";let _e=null,Re=null;const bt=r.createElement("form"),nt=function(H){return H instanceof RegExp||H instanceof Function},at=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Re&&Re===H)){if((!H||typeof H!="object")&&(H={}),H=Kn(H),ye=Ve.indexOf(H.PARSER_MEDIA_TYPE)===-1?de:H.PARSER_MEDIA_TYPE,_e=ye==="application/xhtml+xml"?Mm:pd,M=kn(H,"ALLOWED_TAGS")?Be({},H.ALLOWED_TAGS,_e):$,K=kn(H,"ALLOWED_ATTR")?Be({},H.ALLOWED_ATTR,_e):z,pa=kn(H,"ALLOWED_NAMESPACES")?Be({},H.ALLOWED_NAMESPACES,Mm):Oe,br=kn(H,"ADD_URI_SAFE_ATTR")?Be(Kn(ar),H.ADD_URI_SAFE_ATTR,_e):ar,$r=kn(H,"ADD_DATA_URI_TAGS")?Be(Kn(nr),H.ADD_DATA_URI_TAGS,_e):nr,Ze=kn(H,"FORBID_CONTENTS")?Be({},H.FORBID_CONTENTS,_e):rr,A=kn(H,"FORBID_TAGS")?Be({},H.FORBID_TAGS,_e):Kn({}),O=kn(H,"FORBID_ATTR")?Be({},H.FORBID_ATTR,_e):Kn({}),Ke=kn(H,"USE_PROFILES")?H.USE_PROFILES:!1,B=H.ALLOW_ARIA_ATTR!==!1,ae=H.ALLOW_DATA_ATTR!==!1,R=H.ALLOW_UNKNOWN_PROTOCOLS||!1,q=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,se=H.SAFE_FOR_TEMPLATES||!1,V=H.SAFE_FOR_XML!==!1,ie=H.WHOLE_DOCUMENT||!1,ve=H.RETURN_DOM||!1,be=H.RETURN_DOM_FRAGMENT||!1,Z=H.RETURN_TRUSTED_TYPE||!1,ue=H.FORCE_BODY||!1,Ae=H.SANITIZE_DOM!==!1,Te=H.SANITIZE_NAMED_PROPS||!1,$e=H.KEEP_CONTENT!==!1,et=H.IN_PLACE||!1,T=H.ALLOWED_URI_REGEXP||QN,sr=H.NAMESPACE||Kt,xe=H.MATHML_TEXT_INTEGRATION_POINTS||xe,je=H.HTML_INTEGRATION_POINTS||je,G=H.CUSTOM_ELEMENT_HANDLING||{},H.CUSTOM_ELEMENT_HANDLING&&nt(H.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=H.CUSTOM_ELEMENT_HANDLING.tagNameCheck),H.CUSTOM_ELEMENT_HANDLING&&nt(H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),se&&(ae=!1),be&&(ve=!0),Ke&&(M=Be({},vy),K=[],Ke.html===!0&&(Be(M,gy),Be(K,yy)),Ke.svg===!0&&(Be(M,Om),Be(K,Dm),Be(K,Bc)),Ke.svgFilters===!0&&(Be(M,Em),Be(K,Dm),Be(K,Bc)),Ke.mathMl===!0&&(Be(M,Am),Be(K,by),Be(K,Bc))),H.ADD_TAGS&&(typeof H.ADD_TAGS=="function"?J.tagCheck=H.ADD_TAGS:(M===$&&(M=Kn(M)),Be(M,H.ADD_TAGS,_e))),H.ADD_ATTR&&(typeof H.ADD_ATTR=="function"?J.attributeCheck=H.ADD_ATTR:(K===z&&(K=Kn(K)),Be(K,H.ADD_ATTR,_e))),H.ADD_URI_SAFE_ATTR&&Be(br,H.ADD_URI_SAFE_ATTR,_e),H.FORBID_CONTENTS&&(Ze===rr&&(Ze=Kn(Ze)),Be(Ze,H.FORBID_CONTENTS,_e)),H.ADD_FORBID_CONTENTS&&(Ze===rr&&(Ze=Kn(Ze)),Be(Ze,H.ADD_FORBID_CONTENTS,_e)),$e&&(M["#text"]=!0),ie&&Be(M,["html","head","body"]),M.table&&(Be(M,["tbody"]),delete A.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw el('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');j=H.TRUSTED_TYPES_POLICY,k=j.createHTML("")}else j===void 0&&(j=pR(p,s)),j!==null&&typeof k=="string"&&(k=j.createHTML(""));Ar&&Ar(H),Re=H}},wr=Be({},[...Om,...Em,...aR]),ir=Be({},[...Am,...sR]),Fn=function(H){let me=N(H);(!me||!me.tagName)&&(me={namespaceURI:sr,tagName:"template"});const Se=pd(H.tagName),xt=pd(me.tagName);return pa[H.namespaceURI]?H.namespaceURI===Lt?me.namespaceURI===Kt?Se==="svg":me.namespaceURI===yt?Se==="svg"&&(xt==="annotation-xml"||xe[xt]):!!wr[Se]:H.namespaceURI===yt?me.namespaceURI===Kt?Se==="math":me.namespaceURI===Lt?Se==="math"&&je[xt]:!!ir[Se]:H.namespaceURI===Kt?me.namespaceURI===Lt&&!je[xt]||me.namespaceURI===yt&&!xe[xt]?!1:!ir[Se]&&(he[Se]||!wr[Se]):!!(ye==="application/xhtml+xml"&&pa[H.namespaceURI]):!1},Bn=function(H){Zo(t.removed,{element:H});try{N(H).removeChild(H)}catch{v(H)}},Es=function(H,me){try{Zo(t.removed,{attribute:me.getAttributeNode(H),from:me})}catch{Zo(t.removed,{attribute:null,from:me})}if(me.removeAttribute(H),H==="is")if(ve||be)try{Bn(me)}catch{}else try{me.setAttribute(H,"")}catch{}},_v=function(H){let me=null,Se=null;if(ue)H="<remove></remove>"+H;else{const At=Pm(H,/^[\r\n\t ]+/);Se=At&&At[0]}ye==="application/xhtml+xml"&&sr===Kt&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const xt=j?j.createHTML(H):H;if(sr===Kt)try{me=new m().parseFromString(xt,ye)}catch{}if(!me||!me.documentElement){me=b.createDocument(sr,"template",null);try{me.documentElement.innerHTML=Ln?k:xt}catch{}}const pr=me.body||me.documentElement;return H&&Se&&pr.insertBefore(r.createTextNode(Se),pr.childNodes[0]||null),sr===Kt?C.call(me,ie?"html":"body")[0]:ie?me.documentElement:pr},Mv=function(H){return S.call(H.ownerDocument||H,H,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},dm=function(H){return H instanceof f&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof u)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},Pv=function(H){return typeof l=="function"&&H instanceof l};function xa(Ee,H,me){Fc(Ee,Se=>{Se.call(t,H,me,Re)})}const Ov=function(H){let me=null;if(xa(D.beforeSanitizeElements,H,null),dm(H))return Bn(H),!0;const Se=_e(H.nodeName);if(xa(D.uponSanitizeElement,H,{tagName:Se,allowedTags:M}),V&&H.hasChildNodes()&&!Pv(H.firstElementChild)&&jr(/<[/\w!]/g,H.innerHTML)&&jr(/<[/\w!]/g,H.textContent)||H.nodeType===rl.progressingInstruction||V&&H.nodeType===rl.comment&&jr(/<[/\w]/g,H.data))return Bn(H),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(Se))&&(!M[Se]||A[Se])){if(!A[Se]&&Av(Se)&&(G.tagNameCheck instanceof RegExp&&jr(G.tagNameCheck,Se)||G.tagNameCheck instanceof Function&&G.tagNameCheck(Se)))return!1;if($e&&!Ze[Se]){const xt=N(H)||H.parentNode,pr=w(H)||H.childNodes;if(pr&&xt){const At=pr.length;for(let zr=At-1;zr>=0;--zr){const ga=g(pr[zr],!0);ga.__removalCount=(H.__removalCount||0)+1,xt.insertBefore(ga,y(H))}}}return Bn(H),!0}return H instanceof c&&!Fn(H)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&jr(/<\/no(script|embed|frames)/i,H.innerHTML)?(Bn(H),!0):(se&&H.nodeType===rl.text&&(me=H.textContent,Fc([E,I,F],xt=>{me=Jo(me,xt," ")}),H.textContent!==me&&(Zo(t.removed,{element:H.cloneNode()}),H.textContent=me)),xa(D.afterSanitizeElements,H,null),!1)},Ev=function(H,me,Se){if(Ae&&(me==="id"||me==="name")&&(Se in r||Se in bt))return!1;if(!(ae&&!O[me]&&jr(Q,me))){if(!(B&&jr(Y,me))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(me,H))){if(!K[me]||O[me]){if(!(Av(H)&&(G.tagNameCheck instanceof RegExp&&jr(G.tagNameCheck,H)||G.tagNameCheck instanceof Function&&G.tagNameCheck(H))&&(G.attributeNameCheck instanceof RegExp&&jr(G.attributeNameCheck,me)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(me,H))||me==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&jr(G.tagNameCheck,Se)||G.tagNameCheck instanceof Function&&G.tagNameCheck(Se))))return!1}else if(!br[me]){if(!jr(T,Jo(Se,re,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&H!=="script"&&eR(Se,"data:")===0&&$r[H])){if(!(R&&!jr(X,Jo(Se,re,"")))){if(Se)return!1}}}}}}}return!0},Av=function(H){return H!=="annotation-xml"&&Pm(H,ee)},Dv=function(H){xa(D.beforeSanitizeAttributes,H,null);const{attributes:me}=H;if(!me||dm(H))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0};let xt=me.length;for(;xt--;){const pr=me[xt],{name:At,namespaceURI:zr,value:ga}=pr,Ai=_e(At),um=ga;let or=At==="value"?um:tR(um);if(Se.attrName=Ai,Se.attrValue=or,Se.keepAttr=!0,Se.forceKeepAttr=void 0,xa(D.uponSanitizeAttribute,H,Se),or=Se.attrValue,Te&&(Ai==="id"||Ai==="name")&&(Es(At,H),or=Fe+or),V&&jr(/((--!?|])>)|<\/(style|title|textarea)/i,or)){Es(At,H);continue}if(Ai==="attributename"&&Pm(or,"href")){Es(At,H);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){Es(At,H);continue}if(!q&&jr(/\/>/i,or)){Es(At,H);continue}se&&Fc([E,I,F],Iv=>{or=Jo(or,Iv," ")});const Tv=_e(H.nodeName);if(!Ev(Tv,Ai,or)){Es(At,H);continue}if(j&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!zr)switch(p.getAttributeType(Tv,Ai)){case"TrustedHTML":{or=j.createHTML(or);break}case"TrustedScriptURL":{or=j.createScriptURL(or);break}}if(or!==um)try{zr?H.setAttributeNS(zr,At,or):H.setAttribute(At,or),dm(H)?Bn(H):xy(t.removed)}catch{Es(At,H)}}xa(D.afterSanitizeAttributes,H,null)},vO=function Ee(H){let me=null;const Se=Mv(H);for(xa(D.beforeSanitizeShadowDOM,H,null);me=Se.nextNode();)xa(D.uponSanitizeShadowNode,me,null),Ov(me),Dv(me),me.content instanceof i&&Ee(me.content);xa(D.afterSanitizeShadowDOM,H,null)};return t.sanitize=function(Ee){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Se=null,xt=null,pr=null;if(Ln=!Ee,Ln&&(Ee="<!-->"),typeof Ee!="string"&&!Pv(Ee))if(typeof Ee.toString=="function"){if(Ee=Ee.toString(),typeof Ee!="string")throw el("dirty is not a string, aborting")}else throw el("toString is not a function");if(!t.isSupported)return Ee;if(pe||at(H),t.removed=[],typeof Ee=="string"&&(et=!1),et){if(Ee.nodeName){const ga=_e(Ee.nodeName);if(!M[ga]||A[ga])throw el("root node is forbidden and cannot be sanitized in-place")}}else if(Ee instanceof l)me=_v("<!---->"),Se=me.ownerDocument.importNode(Ee,!0),Se.nodeType===rl.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?me=Se:me.appendChild(Se);else{if(!ve&&!se&&!ie&&Ee.indexOf("<")===-1)return j&&Z?j.createHTML(Ee):Ee;if(me=_v(Ee),!me)return ve?null:Z?k:""}me&&ue&&Bn(me.firstChild);const At=Mv(et?Ee:me);for(;xt=At.nextNode();)Ov(xt),Dv(xt),xt.content instanceof i&&vO(xt.content);if(et)return Ee;if(ve){if(be)for(pr=_.call(me.ownerDocument);me.firstChild;)pr.appendChild(me.firstChild);else pr=me;return(K.shadowroot||K.shadowrootmode)&&(pr=P.call(n,pr,!0)),pr}let zr=ie?me.outerHTML:me.innerHTML;return ie&&M["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&jr(ZN,me.ownerDocument.doctype.name)&&(zr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
571
- `+zr),se&&Fc([E,I,F],ga=>{zr=Jo(zr,ga," ")}),j&&Z?j.createHTML(zr):zr},t.setConfig=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(Ee),pe=!0},t.clearConfig=function(){Re=null,pe=!1},t.isValidAttribute=function(Ee,H,me){Re||at({});const Se=_e(Ee),xt=_e(H);return Ev(Se,xt,me)},t.addHook=function(Ee,H){typeof H=="function"&&Zo(D[Ee],H)},t.removeHook=function(Ee,H){if(H!==void 0){const me=Z4(D[Ee],H);return me===-1?void 0:J4(D[Ee],me,1)[0]}return xy(D[Ee])},t.removeHooks=function(Ee){D[Ee]=[]},t.removeAllHooks=function(){D=jy()},t}var xR=JN();function gR(e){var t;const{char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=e,c=n&&!s,d=SE(r),u=new RegExp(`\\s${d}$`),f=o?"^":"",m=s?"":d,p=c?new RegExp(`${f}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${m}]*`,"gm"),x=((t=l.nodeBefore)==null?void 0:t.isText)&&l.nodeBefore.text;if(!x)return null;const g=l.pos-x.length,v=Array.from(x.matchAll(p)).pop();if(!v||v.input===void 0||v.index===void 0)return null;const y=v.input.slice(Math.max(0,v.index-1),v.index),w=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!w)return null;const N=g+v.index;let j=N+v[0].length;return c&&u.test(x.slice(j-1,j+1))&&(v[0]+=" ",j+=1),N<l.pos&&j>=l.pos?{range:{from:N,to:j},query:v[0].slice(r.length),text:v[0]}:null}var vR=new a1("suggestion");function yR({pluginKey:e=vR,editor:t,char:r="@",allowSpaces:n=!1,allowToIncludeChar:s=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:l="span",decorationClass:c="suggestion",decorationContent:d="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:m=()=>[],render:p=()=>({}),allow:x=()=>!0,findSuggestionMatch:g=gR,shouldShow:v}){let y;const w=p==null?void 0:p(),N=()=>{const S=t.state.selection.$anchor.pos,_=t.view.coordsAtPos(S),{top:C,right:P,bottom:D,left:E}=_;try{return new DOMRect(E,C,P-E,D-C)}catch{return null}},j=(S,_)=>_?()=>{const C=e.getState(t.state),P=C==null?void 0:C.decorationId,D=S.dom.querySelector(`[data-decoration-id="${P}"]`);return(D==null?void 0:D.getBoundingClientRect())||null}:N;function k(S,_){var C;try{const D=e.getState(S.state),E=D!=null&&D.decorationId?S.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`):null,I={editor:t,range:(D==null?void 0:D.range)||{from:0,to:0},query:(D==null?void 0:D.query)||null,text:(D==null?void 0:D.text)||null,items:[],command:F=>f({editor:t,range:(D==null?void 0:D.range)||{from:0,to:0},props:F}),decorationNode:E,clientRect:j(S,E)};(C=w==null?void 0:w.onExit)==null||C.call(w,I)}catch{}const P=S.state.tr.setMeta(_,{exit:!0});S.dispatch(P)}const b=new jE({key:e,view(){return{update:async(S,_)=>{var C,P,D,E,I,F,Q;const Y=(C=this.key)==null?void 0:C.getState(_),X=(P=this.key)==null?void 0:P.getState(S.state),re=Y.active&&X.active&&Y.range.from!==X.range.from,ee=!Y.active&&X.active,T=Y.active&&!X.active,M=!ee&&!T&&Y.query!==X.query,$=ee||re&&M,K=M||re,z=T||re&&M;if(!$&&!K&&!z)return;const G=z&&!$?Y:X,A=S.dom.querySelector(`[data-decoration-id="${G.decorationId}"]`);y={editor:t,range:G.range,query:G.query,text:G.text,items:[],command:O=>f({editor:t,range:G.range,props:O}),decorationNode:A,clientRect:j(S,A)},$&&((D=w==null?void 0:w.onBeforeStart)==null||D.call(w,y)),K&&((E=w==null?void 0:w.onBeforeUpdate)==null||E.call(w,y)),(K||$)&&(y.items=await m({editor:t,query:G.query})),z&&((I=w==null?void 0:w.onExit)==null||I.call(w,y)),K&&((F=w==null?void 0:w.onUpdate)==null||F.call(w,y)),$&&((Q=w==null?void 0:w.onStart)==null||Q.call(w,y))},destroy:()=>{var S;y&&((S=w==null?void 0:w.onExit)==null||S.call(w,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,_,C,P){const{isEditable:D}=t,{composing:E}=t.view,{selection:I}=S,{empty:F,from:Q}=I,Y={..._},X=S.getMeta(e);if(X&&X.exit)return Y.active=!1,Y.decorationId=null,Y.range={from:0,to:0},Y.query=null,Y.text=null,Y;if(Y.composing=E,D&&(F||t.view.composing)){(Q<_.range.from||Q>_.range.to)&&!E&&!_.composing&&(Y.active=!1);const re=g({char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:I.$from}),ee=`id_${Math.floor(Math.random()*4294967295)}`;re&&x({editor:t,state:P,range:re.range,isActive:_.active})&&(!v||v({editor:t,range:re.range,query:re.query,text:re.text,transaction:S}))?(Y.active=!0,Y.decorationId=_.decorationId?_.decorationId:ee,Y.range=re.range,Y.query=re.query,Y.text=re.text):Y.active=!1}else Y.active=!1;return Y.active||(Y.decorationId=null,Y.range={from:0,to:0},Y.query=null,Y.text=null),Y}},props:{handleKeyDown(S,_){var C,P,D,E;const{active:I,range:F}=b.getState(S.state);if(!I)return!1;if(_.key==="Escape"||_.key==="Esc"){const Y=b.getState(S.state),X=(C=y==null?void 0:y.decorationNode)!=null?C:null,re=X??(Y!=null&&Y.decorationId?S.dom.querySelector(`[data-decoration-id="${Y.decorationId}"]`):null);if(((P=w==null?void 0:w.onKeyDown)==null?void 0:P.call(w,{view:S,event:_,range:Y.range}))||!1)return!0;const T={editor:t,range:Y.range,query:Y.query,text:Y.text,items:[],command:M=>f({editor:t,range:Y.range,props:M}),decorationNode:re,clientRect:re?()=>re.getBoundingClientRect()||null:null};return(D=w==null?void 0:w.onExit)==null||D.call(w,T),k(S,e),!0}return((E=w==null?void 0:w.onKeyDown)==null?void 0:E.call(w,{view:S,event:_,range:F}))||!1},decorations(S){const{active:_,range:C,decorationId:P,query:D}=b.getState(S);if(!_)return null;const E=!(D!=null&&D.length),I=[c];return E&&I.push(u),NE.create(S.doc,[kE.inline(C.from,C.to,{nodeName:l,class:I.join(" "),"data-decoration-id":P,"data-decoration-content":d})])}}});return b}function bR({editor:e,overrideSuggestionOptions:t,extensionName:r,char:n="@"}){const s=new a1;return{editor:e,char:n,pluginKey:s,command:({editor:i,range:o,props:l})=>{var c,d,u;const f=i.view.state.selection.$to.nodeAfter;((c=f==null?void 0:f.text)==null?void 0:c.startsWith(" "))&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:r,attrs:{...l,mentionSuggestionChar:n}},{type:"text",text:" "}]).run(),(u=(d=i.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:i,range:o})=>{const l=i.doc.resolve(o.from),c=i.schema.nodes[r];return!!l.parent.type.contentMatch.matchType(c)},...t}}function ek(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>bR({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function Ny(e,t){const r=ek(e),n=r.find(s=>s.char===t);return n||(r.length?r[0]:null)}var wR=CE.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){var r,n;return`${(r=t==null?void 0:t.char)!=null?r:"@"}${(n=e.attrs.label)!=null?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:r}){var n,s;return["span",Ac(this.HTMLAttributes,e.HTMLAttributes),`${(n=r==null?void 0:r.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:e=>e.getAttribute("data-mention-suggestion-char"),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){const r=Ny(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Ac({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:r})];const n={...this.options};n.HTMLAttributes=Ac({"data-type":this.name},this.options.HTMLAttributes,t);const s=this.options.renderHTML({options:n,node:e,suggestion:r});return typeof s=="string"?["span",Ac({"data-type":this.name},this.options.HTMLAttributes,t),s]:s},...ME({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:e=>{const t={},r=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=r.exec(e);for(;n!==null;){const[,s,i,o]=n,l=i??o;t[s==="char"?"mentionSuggestionChar":s]=l,n=r.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t==="mentionSuggestionChar"?"char":t}="${r}"`).join(" ")}),renderText({node:e}){const t={options:this.options,node:e,suggestion:Ny(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(t)):this.options.renderText(t)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:s,anchor:i}=n;if(!s)return!1;let o=new _E,l=0;return t.doc.nodesBetween(i-1,i,(c,d)=>{if(c.type.name===this.name)return r=!0,o=c,l=d,!1}),r&&e.insertText(this.options.deleteTriggerWithBackspace?"":o.attrs.mentionSuggestionChar,l,l+o.nodeSize),r})}},addProseMirrorPlugins(){return ek(this).map(yR)}}),tk=wR;const kx={byIssue:e=>["attachments",e]};function rk(e){return Le({queryKey:kx.byIssue(e),queryFn:()=>oe.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function nk(e){const t=Ne();return ge({mutationFn:({file:r,commentId:n})=>{const s=new FormData;return s.append("file",r),n&&s.append("comment_id",n),oe.upload(`/admin/issues/${e}/attachments`,s)},onSuccess:()=>{t.invalidateQueries({queryKey:kx.byIssue(e)})}})}function jR(e){const t=Ne();return ge({mutationFn:r=>oe.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:kx.byIssue(e)})}})}function Cl(e){return e.startsWith("image/")}function ef(e){return e.startsWith("video/")}function tf(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Pd(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function Sx(e,t){if(!Pd(e)){console.error("downloadFile: blocked unsafe URL",e);return}const r=document.createElement("a");r.href=e,r.download=t,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}function Cx({mimeType:e,className:t}){return Cl(e)?a.jsx(m5,{className:t}):ef(e)?a.jsx(jl,{className:t}):e.startsWith("text/")||e.includes("json")?a.jsx(f5,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?a.jsx(u5,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?a.jsx(h5,{className:t}):a.jsx(p5,{className:t})}function ak({attachment:e,onClose:t}){return e?a.jsx(Si,{open:!0,onOpenChange:r=>!r&&t(),children:a.jsxs(Ci,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[a.jsxs(ko,{className:"flex-row items-center justify-between px-4 py-3 border-b border-border shrink-0 pr-10",children:[a.jsx(Co,{className:"text-sm font-medium truncate",children:e.original_name}),a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>Sx(e.url,e.original_name),children:[a.jsx(Qp,{className:"h-3.5 w-3.5"}),"Download"]})]}),a.jsxs(So,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[Cl(e.mime_type)&&Pd(e.url)&&a.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),ef(e.mime_type)&&Pd(e.url)&&a.jsx("video",{src:e.url,controls:!0,className:"max-w-full max-h-[75vh]"})]}),a.jsxs("div",{className:"px-4 py-2 border-t border-border text-[11px] text-muted-foreground flex items-center gap-3 shrink-0",children:[a.jsx("span",{children:tf(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:e.mime_type}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:["Uploaded ",fe(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function NR({attachment:e}){const[t,r]=h.useState(null),n=Cl(e.mime_type)||ef(e.mime_type),s=()=>{n?r(e):Sx(e.url,e.original_name)};return a.jsxs(a.Fragment,{children:[Cl(e.mime_type)?a.jsx("button",{type:"button",onClick:s,className:"block rounded-md overflow-hidden border border-border hover:opacity-90 transition-opacity",title:e.original_name,children:a.jsx("img",{src:Pd(e.url)?e.url:"",alt:e.original_name,className:"max-h-48 max-w-xs object-cover"})}):a.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-2 px-2.5 py-1.5 rounded-lg border border-border bg-muted/40 hover:bg-muted transition-colors text-left max-w-xs",title:n?"View":"Download",children:[a.jsx(Cx,{mimeType:e.mime_type,className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-foreground truncate",children:e.original_name}),a.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:tf(e.size)}),!n&&a.jsx(Qp,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&a.jsx(ak,{attachment:t,onClose:()=>r(null)})]})}function kR({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const s=Cl(e.mime_type)||ef(e.mime_type),i=()=>{s?t(e):Sx(e.url,e.original_name)};return a.jsxs("div",{className:"flex items-center gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("button",{type:"button",onClick:i,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground hover:bg-primary/10 hover:text-primary transition-colors",title:s?"View":"Download",children:a.jsx(Cx,{mimeType:e.mime_type,className:"h-4 w-4"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("button",{type:"button",onClick:i,className:"text-xs font-medium text-foreground truncate block text-left w-full hover:underline",children:e.original_name}),a.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5 flex items-center gap-1.5",children:[a.jsx("span",{children:tf(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:fe(new Date(e.created_at),"MMM d, yyyy")}),e.comment_id&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsx("span",{className:"italic",children:"from comment"})]}),!s&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"·"}),a.jsxs("span",{className:"flex items-center gap-0.5",children:[a.jsx(Qp,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),a.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all",onClick:()=>r(e.id),disabled:n,children:a.jsx(Or,{className:"h-3.5 w-3.5"})})]})}function SR({onFiles:e,isUploading:t}){const[r,n]=h.useState(!1),s=h.useRef(null),i=h.useCallback(o=>{o.preventDefault(),n(!1);const l=Array.from(o.dataTransfer.files);l.length>0&&e(l)},[e]);return a.jsxs("div",{onDragOver:o=>{o.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:i,onClick:()=>{var o;return!t&&((o=s.current)==null?void 0:o.click())},className:L("flex flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6","cursor-pointer transition-colors",r?"border-primary/60 bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30",t&&"opacity-60 cursor-wait"),children:[a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted",children:a.jsx(R5,{className:"h-4 w-4 text-muted-foreground"})}),a.jsx("p",{className:"text-xs font-medium text-foreground",children:t?"Uploading…":"Drop files or click to browse"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Up to 50 MB per file"}),a.jsx("input",{ref:s,type:"file",multiple:!0,className:"hidden",onChange:o=>{const l=Array.from(o.target.files??[]);l.length>0&&e(l),o.target.value=""}})]})}function CR({issueId:e,className:t}){const[r,n]=h.useState(null),{data:s,isLoading:i}=rk(e),o=nk(e),l=jR(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>U.success(`${f.name} uploaded`),onError:()=>U.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>U.success("Attachment removed"),onError:()=>U.error("Failed to remove attachment")})};return a.jsxs("div",{className:L("px-6 py-4 space-y-4",t),children:[a.jsx(SR,{onFiles:c,isUploading:o.isPending}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(u=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-8 w-8 rounded-md shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-2/3"}),a.jsx(le,{className:"h-2.5 w-1/3"})]})]},u))}):s&&s.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(tx,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[s.length," ",s.length===1?"file":"files"]})]}),a.jsx("div",{children:s.map(u=>a.jsx(kR,{attachment:u,onOpen:n,onDelete:d,isDeleting:l.isPending},u.id))})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No attachments yet."}),a.jsx(ak,{attachment:r,onClose:()=>n(null)})]})}const _R=Vl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",muted:"border-transparent bg-muted text-muted-foreground"}},defaultVariants:{variant:"default"}});function Dn({className:e,variant:t,...r}){return a.jsx("div",{className:L(_R({variant:t}),e),...r})}function MR(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,PR(s,...t)]}function PR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var OR=Symbol("radix.slottable");function ER(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=OR,t}var sk="AlertDialog",[AR]=MR(sk,[Vj]),Xa=Vj(),ik=e=>{const{__scopeAlertDialog:t,...r}=e,n=Xa(t);return a.jsx(Yl,{...n,...r,modal:!0})};ik.displayName=sk;var DR="AlertDialogTrigger",TR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Xa(r);return a.jsx(KO,{...s,...n,ref:t})});TR.displayName=DR;var IR="AlertDialogPortal",ok=e=>{const{__scopeAlertDialog:t,...r}=e,n=Xa(t);return a.jsx(Kl,{...n,...r})};ok.displayName=IR;var RR="AlertDialogOverlay",lk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Xa(r);return a.jsx(yi,{...s,...n,ref:t})});lk.displayName=RR;var Yi="AlertDialogContent",[$R,zR]=AR(Yi),LR=ER("AlertDialogContent"),ck=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Xa(r),o=h.useRef(null),l=Au(t,o),c=h.useRef(null);return a.jsx(HO,{contentName:Yi,titleName:dk,docsSlug:"alert-dialog",children:a.jsx($R,{scope:r,cancelRef:c,children:a.jsxs(bi,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:Ws(s.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[a.jsx(LR,{children:n}),a.jsx(BR,{contentRef:o})]})})})});ck.displayName=Yi;var dk="AlertDialogTitle",uk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Xa(r);return a.jsx(ho,{...s,...n,ref:t})});uk.displayName=dk;var fk="AlertDialogDescription",mk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Xa(r);return a.jsx(po,{...s,...n,ref:t})});mk.displayName=fk;var FR="AlertDialogAction",hk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Xa(r);return a.jsx(Eu,{...s,...n,ref:t})});hk.displayName=FR;var pk="AlertDialogCancel",xk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=zR(pk,r),i=Xa(r),o=Au(t,s);return a.jsx(Eu,{...i,...n,ref:o})});xk.displayName=pk;var BR=({contentRef:e})=>{const t=`\`${Yi}\` requires a description for the component to be accessible for screen reader users.
572
-
573
- You can add a description to the \`${Yi}\` by passing a \`${fk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
574
-
575
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Yi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
576
-
577
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},WR=ik,UR=ok,gk=lk,vk=ck,yk=hk,bk=xk,wk=uk,jk=mk;const ei=WR,qR=UR,Nk=h.forwardRef(({className:e,...t},r)=>a.jsx(gk,{className:L("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Nk.displayName=gk.displayName;const ms=h.forwardRef(({className:e,...t},r)=>a.jsxs(qR,{children:[a.jsx(Nk,{}),a.jsx(vk,{ref:r,className:L("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-background border border-border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",e),...t})]}));ms.displayName=vk.displayName;const hs=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col space-y-2 text-center sm:text-left",e),...t});hs.displayName="AlertDialogHeader";const ps=({className:e,...t})=>a.jsx("div",{className:L("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ps.displayName="AlertDialogFooter";const xs=h.forwardRef(({className:e,...t},r)=>a.jsx(wk,{ref:r,className:L("text-base font-semibold",e),...t}));xs.displayName=wk.displayName;const gs=h.forwardRef(({className:e,...t},r)=>a.jsx(jk,{ref:r,className:L("text-sm text-muted-foreground",e),...t}));gs.displayName=jk.displayName;const vs=h.forwardRef(({className:e,...t},r)=>a.jsx(yk,{ref:r,className:L(Ki(),e),...t}));vs.displayName=yk.displayName;const ys=h.forwardRef(({className:e,...t},r)=>a.jsx(bk,{ref:r,className:L(Ki({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ys.displayName=bk.displayName;function ro({open:e,onClose:t,onConfirm:r,title:n,description:s,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return a.jsx(ei,{open:e,onOpenChange:c=>!c&&t(),children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsx(xs,{children:n}),a.jsx(gs,{children:s})]}),a.jsxs(ps,{children:[a.jsx(ys,{onClick:t,disabled:l,children:"Cancel"}),a.jsx(vs,{onClick:r,disabled:l,className:L(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function HR({startedAt:e}){const[t,r]=h.useState(()=>Sd(e));return h.useEffect(()=>{const n=setInterval(()=>r(Sd(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function KR({onSubmit:e,isPending:t,onCancel:r}){const[n,s]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(new Date().toISOString().split("T")[0]),f=m=>{m.preventDefault();const p=parseInt(n||"0",10),x=parseInt(i||"0",10),g=p*60+x;if(g<=0){U.error("Please enter a duration greater than 0.");return}e({duration_minutes:g,description:l.trim()||void 0,logged_date:d||void 0})};return a.jsxs("form",{onSubmit:f,className:"rounded-xl border border-border bg-card p-4 space-y-3",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Log time manually"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Hours"}),a.jsx(Me,{type:"number",min:"0",max:"999",placeholder:"0",value:n,onChange:m=>s(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Minutes"}),a.jsx(Me,{type:"number",min:"0",max:"59",placeholder:"0",value:i,onChange:m=>o(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:"Date"}),a.jsx(Me,{type:"date",value:d,onChange:m=>u(m.target.value),className:"h-8 text-sm"})]})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-[11px] text-muted-foreground mb-1 block",children:["Description ",a.jsx("span",{className:"text-muted-foreground/60",children:"(optional)"})]}),a.jsx(Me,{placeholder:"What did you work on?",value:l,onChange:m=>c(m.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),a.jsx(ne,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function YR({entry:e,onSave:t,onCancel:r,isPending:n}){const s=e.duration_minutes??0,[i,o]=h.useState(String(Math.floor(s/60))),[l,c]=h.useState(String(s%60)),[d,u]=h.useState(e.description??""),[f,m]=h.useState(e.logged_date?new Date(e.logged_date).toISOString().split("T")[0]:new Date().toISOString().split("T")[0]),p=x=>{x.preventDefault();const g=parseInt(i||"0",10),v=parseInt(l||"0",10),y=g*60+v;if(y<=0){U.error("Please enter a duration greater than 0.");return}t({duration_minutes:y,description:d.trim()||void 0,logged_date:f||void 0})};return a.jsxs("form",{onSubmit:p,className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"w-16",children:[a.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Hours"}),a.jsx(Me,{type:"number",min:"0",max:"999",value:i,onChange:x=>o(x.target.value),className:"h-7 text-xs"})]}),a.jsxs("div",{className:"w-16",children:[a.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Min"}),a.jsx(Me,{type:"number",min:"0",max:"59",value:l,onChange:x=>c(x.target.value),className:"h-7 text-xs"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Date"}),a.jsx(Me,{type:"date",value:f,onChange:x=>m(x.target.value),className:"h-7 text-xs"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[10px] text-muted-foreground mb-0.5 block",children:"Description"}),a.jsx(Me,{placeholder:"What did you work on?",value:d,onChange:x=>u(x.target.value),className:"h-7 text-xs"})]}),a.jsxs("div",{className:"flex justify-end gap-1.5 pt-0.5",children:[a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:r,disabled:n,children:a.jsx(Je,{className:"h-3 w-3"})}),a.jsx(ne,{type:"submit",size:"icon",className:"h-6 w-6",disabled:n,children:a.jsx(Xt,{className:"h-3 w-3"})})]})]})}function GR({entry:e,userName:t,isOwnEntry:r,onDelete:n,isDeleting:s,onEdit:i,isEditing:o,editForm:l}){const c=e.started_at!=null&&e.stopped_at==null;return o?a.jsx("div",{className:"py-1.5 px-3",children:l}):a.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg hover:bg-muted/50 group transition-colors",children:[a.jsx("div",{className:L("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",c?"bg-emerald-50 dark:bg-emerald-950/40":e.source==="timer"?"bg-sky-50 dark:bg-sky-950/40":"bg-violet-50 dark:bg-violet-950/40"),children:c?a.jsx(B1,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?a.jsx(Rn,{className:"h-3.5 w-3.5 text-sky-600 dark:text-sky-400"}):a.jsx(c5,{className:"h-3.5 w-3.5 text-violet-600 dark:text-violet-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[c?a.jsx(HR,{startedAt:e.started_at}):a.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:kd(e.duration_minutes??0)}),a.jsx(Dn,{variant:"muted",className:L("text-[10px] px-1.5 py-0",c?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":e.source==="timer"?"bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-400":"bg-violet-100 text-violet-700 dark:bg-violet-950 dark:text-violet-400"),children:c?"Running":e.source==="timer"?"Timer":"Manual"}),t&&a.jsx("span",{className:"text-[11px] text-foreground",children:t})]}),e.description&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!c&&a.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:fe(new Date(e.logged_date),"MMM d, yyyy")})]}),!c&&r&&a.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 opacity-0 group-hover:opacity-100 transition-all mt-0.5",children:[a.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>i(e.id),children:a.jsx(Ns,{className:"h-3.5 w-3.5"})}),a.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>n(e.id),disabled:s,children:a.jsx(Or,{className:"h-3.5 w-3.5"})})]})]})}function VR({issueId:e,className:t}){const[r,n]=h.useState(!1),[s,i]=h.useState(null),[o,l]=h.useState(null),{data:c,isLoading:d}=zD(e),{data:u}=LD(e),{data:f}=_s(),{user:m}=Ie(),p=FD(e),x=BD(e),g=WD(e),v=UD(e),y=qD(e),w=(c==null?void 0:c.time_logs)??[],N=(c==null?void 0:c.total_minutes)??0,j=u!=null,k=P=>{p.mutate(P,{onSuccess:()=>{n(!1),U.success("Time logged")},onError:()=>U.error("Failed to log time")})},b=()=>{x.mutate(void 0,{onSuccess:P=>{P.stopped_timer?U.success("Previous timer stopped, new timer started"):U.success("Timer started")},onError:P=>U.error(P.message??"Failed to start timer")})},S=()=>{g.mutate(void 0,{onSuccess:P=>{const D=P.time_log.duration_minutes??0;U.success(`Timer stopped — ${kd(D)} logged`)},onError:()=>U.error("Failed to stop timer")})},_=()=>{o&&v.mutate(o,{onSuccess:()=>{l(null),U.success("Time entry removed")},onError:()=>U.error("Failed to remove entry")})},C=(P,D)=>{y.mutate({logId:P,data:D},{onSuccess:()=>{i(null),U.success("Time entry updated")},onError:()=>U.error("Failed to update entry")})};return a.jsxs("div",{className:L("px-6 py-4 space-y-4",t),children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium mb-0.5",children:"Total logged"}),a.jsx("p",{className:"text-xl font-bold text-foreground tabular-nums",children:N>0?kd(N):"—"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a.jsxs(ne,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Log time"]}),j?a.jsxs(ne,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:S,disabled:g.isPending,children:[a.jsx(L1,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):a.jsxs(ne,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:b,disabled:x.isPending,children:[a.jsx(jl,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&a.jsx(KR,{onSubmit:k,isPending:p.isPending,onCancel:()=>n(!1)}),d?a.jsx("div",{className:"space-y-2",children:[1,2].map(P=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3 w-1/3"}),a.jsx(le,{className:"h-2.5 w-1/4"})]})]},P))}):w.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(Rn,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[w.length," ",w.length===1?"entry":"entries"]})]}),a.jsx("div",{children:w.map(P=>{var D;return a.jsx(GR,{entry:P,userName:(D=f==null?void 0:f.get(P.user_id))==null?void 0:D.name,isOwnEntry:P.user_id===(m==null?void 0:m.id),onDelete:l,isDeleting:v.isPending,onEdit:i,isEditing:s===P.id,editForm:a.jsx(YR,{entry:P,onSave:E=>C(P.id,E),onCancel:()=>i(null),isPending:y.isPending})},P.id)})})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."}),a.jsx(ro,{open:o!==null,onClose:()=>l(null),onConfirm:_,title:"Delete time entry",description:"This time entry will be permanently removed. This action cannot be undone.",confirmLabel:"Delete",variant:"destructive",loading:v.isPending})]})}function Ts({onClick:e,active:t,title:r,children:n}){return a.jsx("button",{type:"button",title:r,onMouseDown:s=>{s.preventDefault(),e()},className:L("flex h-6 w-6 items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted",t&&"bg-muted text-foreground"),children:n})}function ky(){return a.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}const Wc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function kk({issueId:e,projectId:t,compact:r,className:n,onSuccess:s}){const[i,o]=h.useState(!0),[l,c]=h.useState([]),[d,u]=h.useState(!1),[f,m]=h.useState(Wc),p=h.useRef(null),x=h.useRef(async()=>{}),g=h.useRef(null),{user:v}=Ie(),y=a5(e),w=nk(e),{data:N}=ua(t??""),j=h.useMemo(()=>N!=null&&N.members?N.members.filter(A=>A.user).map(A=>{const O=A.user,J=`${O.first_name??""} ${O.last_name??""}`.trim()||O.email;return{id:O.id,label:J,email:O.email}}):[],[N]),k=h.useRef([]);k.current=j;const b=h.useRef(m);b.current=m;const S=h.useRef([]),_=h.useRef(null),C=h.useRef(0),P=(v==null?void 0:v.first_name)??"",D=(v==null?void 0:v.last_name)??"",E=`${P} ${D}`.trim()||(v==null?void 0:v.email)||"?",I=v&&`${P[0]??""}${D[0]??""}`.toUpperCase()||"?",F=_x(E),Q=h.useMemo(()=>PE.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(x.current(),!0)}}}),[]),Y=h.useMemo(()=>tk.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:A})=>{const O=k.current;if(!O.length)return[];const J=A.toLowerCase();return O.filter(B=>!J||B.label.toLowerCase().includes(J)||B.email.toLowerCase().includes(J)).slice(0,8)},render:()=>({onStart:A=>{var O;S.current=A.items,_.current=A.command,C.current=0,b.current({active:!0,items:A.items,selectedIndex:0,rect:((O=A.clientRect)==null?void 0:O.call(A))??null,command:A.command})},onUpdate:A=>{var O;S.current=A.items,_.current=A.command,C.current=0,b.current({active:!0,items:A.items,selectedIndex:0,rect:((O=A.clientRect)==null?void 0:O.call(A))??null,command:A.command})},onKeyDown:({event:A})=>{var J;const O=S.current;if(!O.length)return!1;if(A.key==="Escape")return b.current(Wc),!0;if(A.key==="ArrowDown"){const B=(C.current+1)%O.length;return C.current=B,b.current(ae=>({...ae,selectedIndex:B})),!0}if(A.key==="ArrowUp"){const B=(C.current-1+O.length)%O.length;return C.current=B,b.current(ae=>({...ae,selectedIndex:B})),!0}if(A.key==="Enter"){const B=O[C.current];return B&&((J=_.current)==null||J.call(_,B)),!0}return!1},onExit:()=>{b.current(Wc),_.current=null}})}}),[]),X=s1({extensions:[i1,o1,l1.configure({placeholder:"Leave a comment… (type @ to mention)"}),Q,Y],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:A}){o(A.isEmpty)}}),re=!i||l.length>0,ee=25*1024*1024,T=A=>{const O=A.filter(B=>B.size>ee);O.length>0&&U.error(`Files must be under 25 MB: ${O.map(B=>B.name).join(", ")}`);const J=A.filter(B=>B.size<=ee);c(B=>{const ae=new Set(B.map(R=>`${R.name}-${R.size}`));return[...B,...J.filter(R=>!ae.has(`${R.name}-${R.size}`))]})},M=A=>{c(O=>O.filter((J,B)=>B!==A))},$=h.useCallback(A=>{var O;(O=_.current)==null||O.call(_,A),m(Wc)},[]),K=async()=>{if(!(!re||d)){u(!0);try{const A=X!=null&&X.isEmpty?"":(X==null?void 0:X.getHTML())??"",O=[];A&&new DOMParser().parseFromString(A,"text/html").querySelectorAll("[data-type='mention']").forEach(se=>{const V=se.getAttribute("data-id");V&&!O.includes(V)&&O.push(V)});const J=O.length>0?{mentioned_user_ids:O}:void 0,ae=(await y.mutateAsync({body:A||" ",metadata:J})).comment.id;for(const R of l)await w.mutateAsync({file:R,commentId:ae});X==null||X.commands.clearContent(),o(!0),c([]),U.success("Comment added"),s==null||s()}catch{U.error("Failed to add comment")}finally{u(!1)}}};x.current=K;const z="h-3 w-3",G=h.useMemo(()=>{if(!f.rect||!g.current)return{bottom:"105%",left:0};const A=g.current.getBoundingClientRect(),O=Math.max(0,f.rect.left-A.left);return{top:f.rect.bottom-A.top+4,left:O}},[f.rect]);return a.jsxs("div",{className:L("flex gap-3 items-start",n),children:[a.jsx(Rt,{className:"h-7 w-7 shrink-0 mt-1",children:a.jsx($t,{className:L("text-[11px] font-semibold",F.bg,F.text),children:I})}),a.jsxs("div",{className:"flex-1 min-w-0 relative",ref:g,children:[a.jsxs("div",{className:L("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[X&&a.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-border/70 bg-muted/30",children:[a.jsx(Ts,{title:"Bold (⌘B)",active:X.isActive("bold"),onClick:()=>X.chain().focus().toggleBold().run(),children:a.jsx(C1,{className:z})}),a.jsx(Ts,{title:"Italic (⌘I)",active:X.isActive("italic"),onClick:()=>X.chain().focus().toggleItalic().run(),children:a.jsx(T1,{className:z})}),a.jsx(Ts,{title:"Strikethrough",active:X.isActive("strike"),onClick:()=>X.chain().focus().toggleStrike().run(),children:a.jsx(F1,{className:z})}),a.jsx(Ts,{title:"Inline code",active:X.isActive("code"),onClick:()=>X.chain().focus().toggleCode().run(),children:a.jsx(A1,{className:z})}),a.jsx(ky,{}),a.jsx(Ts,{title:"Bullet list",active:X.isActive("bulletList"),onClick:()=>X.chain().focus().toggleBulletList().run(),children:a.jsx(ex,{className:z})}),a.jsx(Ts,{title:"Ordered list",active:X.isActive("orderedList"),onClick:()=>X.chain().focus().toggleOrderedList().run(),children:a.jsx(R1,{className:z})}),a.jsx(ky,{}),a.jsx(Ts,{title:"Code block",active:X.isActive("codeBlock"),onClick:()=>X.chain().focus().toggleCodeBlock().run(),children:a.jsx(E1,{className:z})})]}),a.jsx(c1,{editor:X,className:L("px-3 py-2.5 text-sm",r?"min-h-[68px]":"min-h-[80px]")})]}),l.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:l.map((A,O)=>a.jsxs("span",{className:"inline-flex items-center gap-1 pl-1.5 pr-1 py-0.5 rounded-md bg-muted border border-border text-[11px] text-foreground max-w-[180px]",children:[a.jsx(Cx,{mimeType:A.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:A.name}),a.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",tf(A.size),")"]}),a.jsx("button",{type:"button",onClick:()=>M(O),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:a.jsx(Je,{className:"h-3 w-3"})})]},O))}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var A;return(A=p.current)==null?void 0:A.click()},disabled:d,title:"Attach files",children:a.jsx(tx,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-[11px] text-muted-foreground/50 hidden sm:block",children:[a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})]}),a.jsx(ne,{size:"icon",className:"h-8 w-8",onClick:K,disabled:!re||d,children:a.jsx(_5,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:A=>{const O=Array.from(A.target.files??[]);O.length>0&&T(O),A.target.value=""}}),f.active&&f.items.length>0&&a.jsx("div",{className:"absolute z-[9999]",style:G,children:a.jsx(Ck,{items:f.items,selectedIndex:f.selectedIndex,onSelect:$})})]})]})}const Sy=[{bg:"bg-indigo-100 dark:bg-indigo-900/50",text:"text-indigo-700 dark:text-indigo-300"},{bg:"bg-violet-100 dark:bg-violet-900/50",text:"text-violet-700 dark:text-violet-300"},{bg:"bg-emerald-100 dark:bg-emerald-900/50",text:"text-emerald-700 dark:text-emerald-300"},{bg:"bg-amber-100 dark:bg-amber-900/50",text:"text-amber-700 dark:text-amber-300"},{bg:"bg-rose-100 dark:bg-rose-900/50",text:"text-rose-700 dark:text-rose-300"},{bg:"bg-sky-100 dark:bg-sky-900/50",text:"text-sky-700 dark:text-sky-300"},{bg:"bg-teal-100 dark:bg-teal-900/50",text:"text-teal-700 dark:text-teal-300"},{bg:"bg-orange-100 dark:bg-orange-900/50",text:"text-orange-700 dark:text-orange-300"}];function _x(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return Sy[t%Sy.length]}function XR({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?a.jsx(Mx,{html:t,className:"text-xs"}):a.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const Cy={created:{icon:ut,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:Yp,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:yo,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:W1,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:Ns,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function QR(e,t){var s,i,o,l;const{action:r,changes:n}=e;if(r==="created")return"created this issue";if(r==="status_changed"){const c=(s=n==null?void 0:n.status)==null?void 0:s.from,d=(i=n==null?void 0:n.status)==null?void 0:i.to;return a.jsxs(a.Fragment,{children:["changed status",c&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:ui[c]??c})]}),d&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:ui[d]??d})]})]})}if(r==="assigned"||r==="unassigned"){const c=((o=n==null?void 0:n.assignee_ids)==null?void 0:o.to)??[],d=((l=n==null?void 0:n.assignee_ids)==null?void 0:l.from)??[],u=c.filter(p=>!d.includes(p)),f=d.filter(p=>!c.includes(p)),m=p=>{var x;return((x=t==null?void 0:t.get(p))==null?void 0:x.name)??p.slice(0,8)+"…"};return u.length>0&&f.length>0?a.jsx(a.Fragment,{children:"updated assignees"}):u.length>0?a.jsxs(a.Fragment,{children:["assigned ",a.jsx("strong",{className:"font-medium text-foreground",children:u.map(m).join(", ")})]}):f.length>0?a.jsxs(a.Fragment,{children:["unassigned ",a.jsx("strong",{className:"font-medium text-foreground",children:f.map(m).join(", ")})]}):"updated assignees"}if(r==="updated"&&n){const c=[];for(const[d,u]of Object.entries(n)){const{from:f,to:m}=u;d==="title"||d==="description"?c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d})]},d)):d==="priority"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"priority"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:an[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:an[m]??String(m)})]})]},d)):d==="type"?c.push(a.jsxs("span",{children:["changed ",a.jsx("strong",{className:"font-medium text-foreground",children:"type"}),f!=null&&a.jsxs(a.Fragment,{children:[" from ",a.jsx("strong",{className:"font-medium text-foreground",children:Da[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:Da[m]??String(m)})]})]},d)):c.push(a.jsxs("span",{children:["updated ",a.jsx("strong",{className:"font-medium text-foreground",children:d.replace(/_/g," ")})]},d))}return c.length===0?"made changes":a.jsx(a.Fragment,{children:c.reduce((d,u,f)=>f===0?[u]:[...d,a.jsx("span",{children:" and "},`sep-${f}`),u],[])})}return r.replace(/_/g," ")}function Sk({issueId:e,projectId:t,className:r,compact:n,onViewMore:s,onTabChange:i,hideCommentInput:o,scrollMarginTop:l=0}){const[c,d]=h.useState("comments"),u=k=>{d(k),i==null||i(k)},f=h.useRef(null),m=h.useRef(null),{user:p}=Ie(),{data:x}=_s(),{data:g,isLoading:v}=r5(e),{data:y,isLoading:w}=n5(e),{data:N}=rk(e);h.useEffect(()=>{var b;const k=g==null?void 0:g.length;k!==void 0&&(m.current!==null&&k>m.current&&((b=f.current)==null||b.scrollIntoView({behavior:"smooth",block:"start"})),m.current=k)},[g==null?void 0:g.length]);const j=k=>{var b;if(p&&k===p.id){const S=p.first_name??"",_=p.last_name??"",C=`${S} ${_}`.trim()||p.email,P=(S[0]??_[0]??((b=p.email)==null?void 0:b[0])??"U").toUpperCase();return{name:C,initials:P}}return(x==null?void 0:x.get(k))??{name:"Unknown",initials:"?"}};return a.jsxs("div",{className:r,children:[a.jsx("div",{className:"flex items-center gap-0 px-6 pt-3 border-b border-zinc-100 dark:border-zinc-800",children:["comments","activity","attachments","time"].map(k=>{const b=k==="comments"?(g==null?void 0:g.length)??0:k==="activity"?(y==null?void 0:y.length)??0:k==="attachments"?(N==null?void 0:N.length)??0:void 0,S=k==="comments"?"Comments":k==="activity"?"Activity":k==="attachments"?"Attachments":"Time",_=c===k;return a.jsxs("button",{onClick:()=>u(k),className:L("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",_?"text-indigo-700 dark:text-indigo-300 border-indigo-500 dark:border-indigo-400":"border-transparent text-zinc-500 dark:text-zinc-400 hover:text-zinc-800 dark:hover:text-zinc-200"),children:[S,b!=null&&b>0&&a.jsx("span",{className:L("ml-1.5 text-[10px] tabular-nums font-normal",_?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:b})]},k)})}),c==="comments"&&a.jsxs("div",{className:"px-6 pb-5 pt-4",children:[a.jsx("div",{ref:f,style:{scrollMarginTop:l},className:"space-y-5 mb-5",children:v?a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsx(le,{className:"h-16 flex-1"})]}):g&&g.length>0?(n?g.slice(0,5):g).map(k=>{const b=j(k.author_id),S=_x(b.name),_=(N??[]).filter(C=>C.comment_id===k.id);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Rt,{className:"h-7 w-7 mt-0.5 shrink-0",children:a.jsx($t,{className:L("text-[11px] font-semibold",S.bg,S.text),children:b.initials})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-zinc-900 dark:text-zinc-100",children:b.name}),a.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:fe(new Date(k.created_at),"MMM d, h:mm a")})]}),a.jsxs("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900 border border-zinc-100 dark:border-zinc-800 px-3 py-2.5",children:[a.jsx(XR,{body:k.body}),_.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:_.map(C=>a.jsx(NR,{attachment:C},C.id))})]})]})]},k.id)}):a.jsxs("div",{className:"flex flex-col items-center py-6 gap-2",children:[a.jsx("div",{className:"h-9 w-9 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center",children:a.jsx($1,{className:"h-4 w-4 text-zinc-400 dark:text-zinc-500"})}),a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:"No comments yet"})]})}),n&&g&&g.length>5&&s&&a.jsxs("button",{onClick:s,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mb-4 font-medium transition-colors",children:["View all ",g.length," comments →"]}),!o&&a.jsx(kk,{issueId:e,projectId:t})]}),c==="activity"&&a.jsx("div",{className:"px-6 pb-6 pt-4",children:w?a.jsx("div",{className:"space-y-4",children:[1,2,3].map(k=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(le,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),a.jsx(le,{className:"h-4 flex-1 mt-1"})]},k))}):y&&y.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-[11px] top-2 bottom-2 w-px bg-zinc-100 dark:bg-zinc-800"}),a.jsx("div",{className:"space-y-0",children:(n?y.slice(-5):y).map((k,b,S)=>{var E;const _=Cy[k.action]??Cy.updated,C=_.icon,P=((E=x==null?void 0:x.get(k.actor_id))==null?void 0:E.name)??"System",D=b===S.length-1;return a.jsxs("div",{className:L("relative flex gap-3",D?"pb-0":"pb-4"),children:[a.jsx("div",{className:L("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",_.bg),children:a.jsx(C,{className:L("h-3 w-3",_.color)})}),a.jsxs("div",{className:"flex-1 min-w-0 pt-0.5",children:[a.jsxs("p",{className:"text-xs text-foreground leading-relaxed",children:[a.jsx("span",{className:"font-semibold text-zinc-900 dark:text-zinc-100",children:P})," ",a.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:QR(k,x)})]}),a.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:fe(new Date(k.created_at),"MMM d, yyyy · h:mm a")})]})]},k.id)})})]}),n&&y.length>5&&s&&a.jsxs("button",{onClick:s,className:"text-xs text-indigo-700 hover:text-indigo-900 dark:text-indigo-300 dark:hover:text-indigo-100 mt-3 font-medium transition-colors",children:["View all ",y.length," events →"]})]}):a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),c==="attachments"&&a.jsx(CR,{issueId:e}),c==="time"&&a.jsx(VR,{issueId:e})]})}function Ck({items:e,selectedIndex:t,onSelect:r}){const n=h.useRef(null);return h.useEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.querySelector(`[data-index="${t}"]`);s==null||s.scrollIntoView({block:"nearest"})},[t]),e.length===0?null:a.jsx("div",{className:L("z-50 min-w-[220px] max-w-[280px] rounded-md border border-border","bg-popover shadow-md overflow-hidden","animate-in fade-in-0 zoom-in-95"),children:a.jsx("div",{ref:n,className:"max-h-[200px] overflow-y-auto p-1",role:"listbox",children:e.map((s,i)=>{const o=s.label.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2)||"?",l=_x(s.label);return a.jsxs("button",{"data-index":i,role:"option","aria-selected":i===t,onMouseDown:c=>{c.preventDefault(),r(s)},className:L("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs cursor-pointer","transition-colors",i===t?"bg-accent text-accent-foreground":"hover:bg-accent/60"),children:[a.jsx(Rt,{className:"h-5 w-5 shrink-0",children:a.jsx($t,{className:L("text-[9px] font-semibold",l.bg,l.text),children:o})}),a.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[a.jsx("span",{className:"font-medium text-foreground truncate leading-tight",children:s.label}),a.jsx("span",{className:"text-[10px] text-muted-foreground truncate leading-tight",children:s.email})]})]},s.id)})})})}const Uc={active:!1,items:[],selectedIndex:0,rect:null,command:null};function ZR({onClick:e,active:t,disabled:r,title:n,children:s}){return a.jsx("button",{type:"button",title:n,disabled:r,onMouseDown:i=>{i.preventDefault(),e()},className:L("flex h-[26px] w-[26px] items-center justify-center rounded transition-colors shrink-0","text-muted-foreground hover:text-foreground hover:bg-muted","disabled:opacity-30 disabled:cursor-not-allowed",t&&"bg-muted text-foreground"),children:s})}function qc(){return a.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function rf({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:s,editorClassName:i,users:o}){const[l,c]=h.useState(Uc),d=h.useRef(c);d.current=c;const u=h.useRef([]);o&&(u.current=o);const f=h.useRef([]),m=h.useRef(null),p=h.useRef(0),x=h.useMemo(()=>o!==void 0?tk.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:k})=>{const b=u.current;if(!b.length)return[];const S=k.toLowerCase();return b.filter(_=>!S||_.label.toLowerCase().includes(S)||_.email.toLowerCase().includes(S)).slice(0,8)},render:()=>({onStart:k=>{var b;f.current=k.items,m.current=k.command,p.current=0,d.current({active:!0,items:k.items,selectedIndex:0,rect:((b=k.clientRect)==null?void 0:b.call(k))??null,command:k.command})},onUpdate:k=>{var b;f.current=k.items,m.current=k.command,p.current=0,d.current({active:!0,items:k.items,selectedIndex:0,rect:((b=k.clientRect)==null?void 0:b.call(k))??null,command:k.command})},onKeyDown:({event:k})=>{var S;const b=f.current;if(!b.length)return!1;if(k.key==="Escape")return d.current(Uc),!0;if(k.key==="ArrowDown"){const _=(p.current+1)%b.length;return p.current=_,d.current(C=>({...C,selectedIndex:_})),!0}if(k.key==="ArrowUp"){const _=(p.current-1+b.length)%b.length;return p.current=_,d.current(C=>({...C,selectedIndex:_})),!0}if(k.key==="Enter"){const _=b[p.current];return _&&((S=m.current)==null||S.call(m,_)),!0}return!1},onExit:()=>{d.current(Uc),m.current=null}})}}):null,[o!==void 0]),g=h.useCallback(k=>{var b;(b=m.current)==null||b.call(m,k),c(Uc)},[]),v=h.useRef(null),y=h.useMemo(()=>{if(!l.rect||!v.current)return{top:0,left:0};const k=v.current.getBoundingClientRect();return{top:l.rect.bottom-k.top+4,left:Math.max(0,l.rect.left-k.left)}},[l.rect]),w=s1({extensions:[i1.configure({heading:{levels:[1,2,3]}}),o1,OE,EE.configure({nested:!0}),l1.configure({placeholder:r}),...x?[x]:[]],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:k}){t&&t(k.isEmpty?"":k.getHTML())}});if(!w)return null;const N=(k,b,S,_,C)=>a.jsx(ZR,{title:k,onClick:S,active:_,disabled:C,children:b},k),j="h-3.5 w-3.5";return a.jsxs("div",{ref:v,className:"relative",children:[a.jsxs("div",{className:L("flex flex-col overflow-hidden",n),children:[a.jsxs("div",{className:L("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",s),children:[N("Undo",a.jsx(I5,{className:j}),()=>w.chain().focus().undo().run(),!1,!w.can().undo()),N("Redo",a.jsx(C5,{className:j}),()=>w.chain().focus().redo().run(),!1,!w.can().redo()),a.jsx(qc,{}),N("Bold (⌘B)",a.jsx(C1,{className:j}),()=>w.chain().focus().toggleBold().run(),w.isActive("bold")),N("Italic (⌘I)",a.jsx(T1,{className:j}),()=>w.chain().focus().toggleItalic().run(),w.isActive("italic")),N("Underline (⌘U)",a.jsx(T5,{className:j}),()=>w.chain().focus().toggleUnderline().run(),w.isActive("underline")),N("Strikethrough",a.jsx(F1,{className:j}),()=>w.chain().focus().toggleStrike().run(),w.isActive("strike")),N("Inline code",a.jsx(A1,{className:j}),()=>w.chain().focus().toggleCode().run(),w.isActive("code")),a.jsx(qc,{}),N("Heading 1",a.jsx(x5,{className:j}),()=>w.chain().focus().toggleHeading({level:1}).run(),w.isActive("heading",{level:1})),N("Heading 2",a.jsx(g5,{className:j}),()=>w.chain().focus().toggleHeading({level:2}).run(),w.isActive("heading",{level:2})),N("Heading 3",a.jsx(v5,{className:j}),()=>w.chain().focus().toggleHeading({level:3}).run(),w.isActive("heading",{level:3})),a.jsx(qc,{}),N("Bullet list",a.jsx(ex,{className:j}),()=>w.chain().focus().toggleBulletList().run(),w.isActive("bulletList")),N("Ordered list",a.jsx(R1,{className:j}),()=>w.chain().focus().toggleOrderedList().run(),w.isActive("orderedList")),N("Task list",a.jsx(w5,{className:j}),()=>w.chain().focus().toggleTaskList().run(),w.isActive("taskList")),a.jsx(qc,{}),N("Blockquote",a.jsx(S5,{className:j}),()=>w.chain().focus().toggleBlockquote().run(),w.isActive("blockquote")),N("Code block",a.jsx(E1,{className:j}),()=>w.chain().focus().toggleCodeBlock().run(),w.isActive("codeBlock")),N("Divider line",a.jsx(qa,{className:j}),()=>w.chain().focus().setHorizontalRule().run())]}),a.jsx(c1,{editor:w,className:L("flex-1 px-5 py-4",i)})]}),l.active&&l.items.length>0&&a.jsx("div",{className:"absolute z-[9999]",style:y,children:a.jsx(Ck,{items:l.items,selectedIndex:l.selectedIndex,onSelect:g})})]})}function Mx({html:e,className:t}){return e?a.jsx("div",{className:L("meridian-editor",t),dangerouslySetInnerHTML:{__html:xR.sanitize(e,{ADD_ATTR:["data-type","data-id","data-label"]})}}):null}function JR(e,t,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:r}).format(t).split(/\s/g).slice(2).join(" ")}const Tm={},hl={};function Ys(e,t){try{const n=(Tm[e]||(Tm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in hl?hl[n]:_y(n,n.split(":"))}catch{if(e in hl)return hl[e];const r=e==null?void 0:e.match(e$);return r?_y(e,r.slice(1)):NaN}}const e$=/([+-]\d\d):?(\d\d)?/;function _y(e,t){const r=+(t[0]||0),n=+(t[1]||0),s=+(t[2]||0)/60;return hl[e]=r*60+n>0?r*60+n+s:r*60-n-s}class Vn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ys(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),_k(this),Oh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new Vn(...r,t):new Vn(Date.now(),t)}withTimeZone(t){return new Vn(+this,t)}getTimezoneOffset(){const t=-Ys(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Oh(this),+this}[Symbol.for("constructDateFrom")](t){return new Vn(+new Date(t),this.timeZone)}}const My=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!My.test(e))return;const t=e.replace(My,"$1UTC");Vn.prototype[t]&&(e.startsWith("get")?Vn.prototype[e]=function(){return this.internal[t]()}:(Vn.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),t$(this),+this},Vn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Oh(this),+this}))});function Oh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ys(e.timeZone,e)*60))}function t$(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),_k(e)}function _k(e){const t=Ys(e.timeZone,e),r=t>0?Math.floor(t):Math.ceil(t),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),o=s-i,l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const c=s-r;c&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+c);const d=new Date(+e);d.setUTCSeconds(0);const u=s>0?d.getSeconds():(d.getSeconds()-60)%60,f=Math.round(-(Ys(e.timeZone,e)*60))%60;(f||u)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+f),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+f+u));const m=Ys(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),g=-new Date(+e).getTimezoneOffset()-p,v=p!==r,y=g-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const w=Ys(e.timeZone,e),N=w>0?Math.floor(w):Math.ceil(w),j=p-N;j&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j))}}class gr extends Vn{static tz(t,...r){return r.length?new gr(...r,t):new gr(Date.now(),t)}toISOString(){const[t,r,n]=this.tzComponents(),s=`${t}${r}:${n}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,r,n,s]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${n} ${r} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[r,n,s]=this.tzComponents();return`${t} GMT${r}${n}${s} (${JR(this.timeZone,this)})`}toLocaleString(t,r){return Date.prototype.toLocaleString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleDateString(t,r){return Date.prototype.toLocaleDateString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}toLocaleTimeString(t,r){return Date.prototype.toLocaleTimeString.call(this,t,{...r,timeZone:(r==null?void 0:r.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),r=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[r,n,s]}withTimeZone(t){return new gr(+this,t)}[Symbol.for("constructDateFrom")](t){return new gr(+new Date(t),this.timeZone)}}const Py=5,r$=4;function n$(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,s=t.addDays(e,-n+1),i=t.addDays(s,Py*7-1);return t.getMonth(e)===t.getMonth(i)?Py:r$}function Mk(e,t){const r=t.startOfMonth(e),n=r.getDay();return n===1?r:n===0?t.addDays(r,-1*6):t.addDays(r,-1*(n-1))}function a$(e,t){const r=Mk(e,t),n=n$(e,t);return t.addDays(r,n*7-1)}const Pk={...qs,labels:{labelDayButton:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>fe(o,l,{locale:qs,...r});let i=s(e,"PPPP");return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>fe(s,i,{locale:qs,...t}),n(e,"LLLL yyyy")},labelGridcell:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>fe(o,l,{locale:qs,...r});let i=s(e,"PPPP");return t!=null&&t.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,r)=>{let n;return r&&typeof r.format=="function"?n=r.format.bind(r):n=(s,i)=>fe(s,i,{locale:qs,...t}),n(e,"cccc")}}};class sn{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?gr.tz(this.options.timeZone):new this.Date},this.newDate=(n,s,i)=>{var o;return(o=this.overrides)!=null&&o.newDate?this.overrides.newDate(n,s,i):this.options.timeZone?new gr(n,s,i,this.options.timeZone):new Date(n,s,i)},this.addDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addDays?this.overrides.addDays(n,s):Hr(n,s)},this.addMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,s):px(n,s)},this.addWeeks=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,s):H3(n,s)},this.addYears=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,s):K3(n,s)},this.differenceInCalendarDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,s):Qu(n,s)},this.differenceInCalendarMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,s):gx(n,s)},this.eachMonthOfInterval=n=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):eI(n)},this.eachYearOfInterval=n=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):rI(n),i=new Set(s.map(c=>this.getYear(c)));if(i.size===s.length)return s;const o=[];return i.forEach(c=>{o.push(new Date(c,0,1))}),o},this.endOfBroadcastWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):a$(n,this)},this.endOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(n):nI(n)},this.endOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(n):vx(n)},this.endOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,s):LN(n,this.options)},this.endOfYear=n=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(n):tI(n)},this.format=(n,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,s,this.options):fe(n,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(o):o},this.getISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.getISOWeek?this.overrides.getISOWeek(n):yx(n)},this.getMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):hd(n,this.options)},this.getYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):t4(n,this.options)},this.getWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):bx(n,this.options)},this.isAfter=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,s):r4(n,s)},this.isBefore=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,s):n4(n,s)},this.isDate=n=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(n):EN(n)},this.isSameDay=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,s):eo(n,s)},this.isSameMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,s):a4(n,s)},this.isSameYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,s):s4(n,s)},this.max=n=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(n):Y3(n)},this.min=n=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(n):G3(n)},this.setMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,s):l4(n,s)},this.setYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,s):c4(n,s)},this.startOfBroadcastWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):Mk(n,this)},this.startOfDay=n=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(n):Ji(n)},this.startOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(n):Sl(n)},this.startOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(n):$N(n)},this.startOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):Zi(n,this.options)},this.startOfYear=n=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(n):zN(n)},this.options={locale:Pk,...t},this.overrides=r}getDigitMap(){const{numerals:t="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let s=0;s<10;s++)n[s.toString()]=r.format(s);return n}replaceDigits(t){const r=this.getDigitMap();return t.replace(/\d/g,n=>r[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var r;const t=(r=this.options.locale)==null?void 0:r.code;return t&&sn.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:r,timeZone:n,numerals:s}=this.options,i=r==null?void 0:r.code;if(i&&sn.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:n,numberingSystem:s}).format(t)}catch{}const o=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,o)}}sn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const ha=new sn;class Ok{constructor(t,r,n=ha){this.date=t,this.displayMonth=r,this.outside=!!(r&&!n.isSameMonth(t,r)),this.dateLib=n,this.isoDate=n.format(t,"yyyy-MM-dd"),this.displayMonthId=n.format(r,"yyyy-MM"),this.dateMonthId=n.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class s${constructor(t,r){this.date=t,this.weeks=r}}class i${constructor(t,r){this.days=r,this.weekNumber=t}}function o$(e){return W.createElement("button",{...e})}function l$(e){return W.createElement("span",{...e})}function c$(e){const{size:t=24,orientation:r="left",className:n}=e;return W.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&W.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&W.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&W.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&W.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function d$(e){const{day:t,modifiers:r,...n}=e;return W.createElement("td",{...n})}function u$(e){const{day:t,modifiers:r,...n}=e,s=W.useRef(null);return W.useEffect(()=>{var i;r.focused&&((i=s.current)==null||i.focus())},[r.focused]),W.createElement("button",{ref:s,...n})}var Pe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Pe||(Pe={}));var jt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(jt||(jt={}));var Mn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Mn||(Mn={}));var Zr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Zr||(Zr={}));function f$(e){const{options:t,className:r,components:n,classNames:s,...i}=e,o=[s[Pe.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return W.createElement("span",{"data-disabled":i.disabled,className:s[Pe.DropdownRoot]},W.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>W.createElement(n.Option,{key:c,value:c,disabled:u},d))),W.createElement("span",{className:s[Pe.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,W.createElement(n.Chevron,{orientation:"down",size:18,className:s[Pe.Chevron]})))}function m$(e){return W.createElement("div",{...e})}function h$(e){return W.createElement("div",{...e})}function p$(e){const{calendarMonth:t,displayIndex:r,...n}=e;return W.createElement("div",{...n},e.children)}function x$(e){const{calendarMonth:t,displayIndex:r,...n}=e;return W.createElement("div",{...n})}function g$(e){return W.createElement("table",{...e})}function v$(e){return W.createElement("div",{...e})}const Ek=h.createContext(void 0);function dc(){const e=h.useContext(Ek);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function y$(e){const{components:t}=dc();return W.createElement(t.Dropdown,{...e})}function b$(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=dc(),u=h.useCallback(m=>{s&&(r==null||r(m))},[s,r]),f=h.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return W.createElement("nav",{...i},W.createElement(o.PreviousMonthButton,{type:"button",className:l[Pe.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},W.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[Pe.Chevron],orientation:"left"})),W.createElement(o.NextMonthButton,{type:"button",className:l[Pe.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:u},W.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[Pe.Chevron]})))}function w$(e){const{components:t}=dc();return W.createElement(t.Button,{...e})}function j$(e){return W.createElement("option",{...e})}function N$(e){const{components:t}=dc();return W.createElement(t.Button,{...e})}function k$(e){const{rootRef:t,...r}=e;return W.createElement("div",{...r,ref:t})}function S$(e){return W.createElement("select",{...e})}function C$(e){const{week:t,...r}=e;return W.createElement("tr",{...r})}function _$(e){return W.createElement("th",{...e})}function M$(e){return W.createElement("thead",{"aria-hidden":!0},W.createElement("tr",{...e}))}function P$(e){const{week:t,...r}=e;return W.createElement("th",{...r})}function O$(e){return W.createElement("th",{...e})}function E$(e){return W.createElement("tbody",{...e})}function A$(e){const{components:t}=dc();return W.createElement(t.Dropdown,{...e})}const D$=Object.freeze(Object.defineProperty({__proto__:null,Button:o$,CaptionLabel:l$,Chevron:c$,Day:d$,DayButton:u$,Dropdown:f$,DropdownNav:m$,Footer:h$,Month:p$,MonthCaption:x$,MonthGrid:g$,Months:v$,MonthsDropdown:y$,Nav:b$,NextMonthButton:w$,Option:j$,PreviousMonthButton:N$,Root:k$,Select:S$,Week:C$,WeekNumber:P$,WeekNumberHeader:O$,Weekday:_$,Weekdays:M$,Weeks:E$,YearsDropdown:A$},Symbol.toStringTag,{value:"Module"}));function ka(e,t,r=!1,n=ha){let{from:s,to:i}=e;const{differenceInCalendarDays:o,isSameDay:l}=n;return s&&i?(o(i,s)<0&&([s,i]=[i,s]),o(t,s)>=(r?1:0)&&o(i,t)>=(r?1:0)):!r&&i?l(i,t):!r&&s?l(s,t):!1}function Px(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function nf(e){return!!(e&&typeof e=="object"&&"from"in e)}function Ox(e){return!!(e&&typeof e=="object"&&"after"in e)}function Ex(e){return!!(e&&typeof e=="object"&&"before"in e)}function Ak(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Dk(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Sa(e,t,r=ha){const n=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:i,isAfter:o}=r;return n.some(l=>{if(typeof l=="boolean")return l;if(r.isDate(l))return s(e,l);if(Dk(l,r))return l.some(c=>s(e,c));if(nf(l))return ka(l,e,!1,r);if(Ak(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(Px(l)){const c=i(l.before,e),d=i(l.after,e),u=c>0,f=d<0;return o(l.before,l.after)?f&&u:u||f}return Ox(l)?i(e,l.after)>0:Ex(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function T$(e,t,r,n,s){const{disabled:i,hidden:o,modifiers:l,showOutsideDays:c,broadcastCalendar:d,today:u=s.today()}=t,{isSameDay:f,isSameMonth:m,startOfMonth:p,isBefore:x,endOfMonth:g,isAfter:v}=s,y=r&&p(r),w=n&&g(n),N={[jt.focused]:[],[jt.outside]:[],[jt.disabled]:[],[jt.hidden]:[],[jt.today]:[]},j={};for(const k of e){const{date:b,displayMonth:S}=k,_=!!(S&&!m(b,S)),C=!!(y&&x(b,y)),P=!!(w&&v(b,w)),D=!!(i&&Sa(b,i,s)),E=!!(o&&Sa(b,o,s))||C||P||!d&&!c&&_||d&&c===!1&&_,I=f(b,u);_&&N.outside.push(k),D&&N.disabled.push(k),E&&N.hidden.push(k),I&&N.today.push(k),l&&Object.keys(l).forEach(F=>{const Q=l==null?void 0:l[F];Q&&Sa(b,Q,s)&&(j[F]?j[F].push(k):j[F]=[k])})}return k=>{const b={[jt.focused]:!1,[jt.disabled]:!1,[jt.hidden]:!1,[jt.outside]:!1,[jt.today]:!1},S={};for(const _ in N){const C=N[_];b[_]=C.some(P=>P===k)}for(const _ in j)S[_]=j[_].some(C=>C===k);return{...b,...S}}}function I$(e,t,r={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(r[i]?s.push(r[i]):t[jt[i]]?s.push(t[jt[i]]):t[Mn[i]]&&s.push(t[Mn[i]]),s),[t[Pe.Day]])}function R$(e){return{...D$,...e}}function $$(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([r,n])=>{r.startsWith("data-")&&(t[r]=n)}),t}function z$(){const e={};for(const t in Pe)e[Pe[t]]=`rdp-${Pe[t]}`;for(const t in jt)e[jt[t]]=`rdp-${jt[t]}`;for(const t in Mn)e[Mn[t]]=`rdp-${Mn[t]}`;for(const t in Zr)e[Zr[t]]=`rdp-${Zr[t]}`;return e}function Tk(e,t,r){return(r??new sn(t)).formatMonthYear(e)}const L$=Tk;function F$(e,t,r){return(r??new sn(t)).format(e,"d")}function B$(e,t=ha){return t.format(e,"LLLL")}function W$(e,t,r){return(r??new sn(t)).format(e,"cccccc")}function U$(e,t=ha){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function q$(){return""}function Ik(e,t=ha){return t.format(e,"yyyy")}const H$=Ik,K$=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Tk,formatDay:F$,formatMonthCaption:L$,formatMonthDropdown:B$,formatWeekNumber:U$,formatWeekNumberHeader:q$,formatWeekdayName:W$,formatYearCaption:H$,formatYearDropdown:Ik},Symbol.toStringTag,{value:"Module"}));function Y$(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...K$,...e}}function Ax(e,t,r,n){let s=(n??new sn(r)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const G$=Ax;function Dx(e,t,r){return(r??new sn(t)).formatMonthYear(e)}const V$=Dx;function Rk(e,t,r,n){let s=(n??new sn(r)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function $k(e){return"Choose the Month"}function zk(){return""}const X$="Go to the Next Month";function Lk(e,t){return X$}function Fk(e){return"Go to the Previous Month"}function Bk(e,t,r){return(r??new sn(t)).format(e,"cccc")}function Wk(e,t){return`Week ${e}`}function Uk(e){return"Week Number"}function qk(e){return"Choose the Year"}const Q$=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:V$,labelDay:G$,labelDayButton:Ax,labelGrid:Dx,labelGridcell:Rk,labelMonthDropdown:$k,labelNav:zk,labelNext:Lk,labelPrevious:Fk,labelWeekNumber:Wk,labelWeekNumberHeader:Uk,labelWeekday:Bk,labelYearDropdown:qk},Symbol.toStringTag,{value:"Module"})),jn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function Z$(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...Q$,...e??{},labelDayButton:jn(Ax,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:jn($k,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:jn(Lk,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:jn(Fk,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:jn(Wk,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:jn(qk,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:jn(Dx,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:jn(Rk,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:jn(zk,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:jn(Uk,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:jn(Bk,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function J$(e,t,r,n,s){const{startOfMonth:i,startOfYear:o,endOfYear:l,eachMonthOfInterval:c,getMonth:d}=s;return c({start:o(e),end:l(e)}).map(m=>{const p=n.formatMonthDropdown(m,s),x=d(m),g=t&&m<i(t)||r&&m>i(r)||!1;return{value:x,label:p,disabled:g}})}function e6(e,t={},r={}){let n={...t==null?void 0:t[Pe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{n={...n,...r==null?void 0:r[s]}}),n}function t6(e,t,r,n){const s=n??e.today(),i=r?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),o=[];for(let l=0;l<7;l++){const c=e.addDays(i,l);o.push(c)}return o}function r6(e,t,r,n,s=!1){if(!e||!t)return;const{startOfYear:i,endOfYear:o,eachYearOfInterval:l,getYear:c}=n,d=i(e),u=o(t),f=l({start:d,end:u});return s&&f.reverse(),f.map(m=>{const p=r.formatYearDropdown(m,n);return{value:c(m),label:p,disabled:!1}})}function n6(e,t={}){var l;const{weekStartsOn:r,locale:n}=t,s=r??((l=n==null?void 0:n.options)==null?void 0:l.weekStartsOn)??0,i=c=>{const d=typeof c=="number"||typeof c=="string"?new Date(c):c;return new gr(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,e)},o=c=>{const d=i(c);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(gr.tz(e)),newDate:(c,d,u)=>new gr(c,d,u,12,0,0,e),startOfDay:c=>i(c),startOfWeek:(c,d)=>{const u=i(c),f=(d==null?void 0:d.weekStartsOn)??s,m=(u.getDay()-f+7)%7;return u.setDate(u.getDate()-m),u},startOfISOWeek:c=>{const d=i(c),u=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-u),d},startOfMonth:c=>{const d=i(c);return d.setDate(1),d},startOfYear:c=>{const d=i(c);return d.setMonth(0,1),d},endOfWeek:(c,d)=>{const u=i(c),p=((((d==null?void 0:d.weekStartsOn)??s)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),u},endOfISOWeek:c=>{const d=i(c),u=(7-d.getDay())%7;return d.setDate(d.getDate()+u),d},endOfMonth:c=>{const d=i(c);return d.setMonth(d.getMonth()+1,0),d},endOfYear:c=>{const d=i(c);return d.setMonth(11,31),d},eachMonthOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new gr(d.getFullYear(),d.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)f.push(new gr(m,e)),m.setMonth(m.getMonth()+1,1);return f},addDays:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d),u},addWeeks:(c,d)=>{const u=i(c);return u.setDate(u.getDate()+d*7),u},addMonths:(c,d)=>{const u=i(c);return u.setMonth(u.getMonth()+d),u},addYears:(c,d)=>{const u=i(c);return u.setFullYear(u.getFullYear()+d),u},eachYearOfInterval:c=>{const d=i(c.start),u=i(c.end),f=[],m=new gr(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new gr(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return bx(u,{weekStartsOn:(d==null?void 0:d.weekStartsOn)??s,firstWeekContainsDate:(d==null?void 0:d.firstWeekContainsDate)??((f=n==null?void 0:n.options)==null?void 0:f.firstWeekContainsDate)??1})},getISOWeek:c=>{const d=o(c);return yx(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return Qu(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return gx(u,f)}}}const uc=e=>e instanceof HTMLElement?e:null,Im=e=>[...e.querySelectorAll("[data-animated-month]")??[]],a6=e=>uc(e.querySelector("[data-animated-month]")),Rm=e=>uc(e.querySelector("[data-animated-caption]")),$m=e=>uc(e.querySelector("[data-animated-weeks]")),s6=e=>uc(e.querySelector("[data-animated-nav]")),i6=e=>uc(e.querySelector("[data-animated-weekdays]"));function o6(e,t,{classNames:r,months:n,focused:s,dateLib:i}){const o=h.useRef(null),l=h.useRef(n),c=h.useRef(!1);h.useLayoutEffect(()=>{const d=l.current;if(l.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||d.length===0||n.length!==d.length)return;const u=i.isSameMonth(n[0].date,d[0].date),f=i.isAfter(n[0].date,d[0].date),m=f?r[Zr.caption_after_enter]:r[Zr.caption_before_enter],p=f?r[Zr.weeks_after_enter]:r[Zr.weeks_before_enter],x=o.current,g=e.current.cloneNode(!0);if(g instanceof HTMLElement?(Im(g).forEach(N=>{if(!(N instanceof HTMLElement))return;const j=a6(N);j&&N.contains(j)&&N.removeChild(j);const k=Rm(N);k&&k.classList.remove(m);const b=$m(N);b&&b.classList.remove(p)}),o.current=g):o.current=null,c.current||u||s)return;const v=x instanceof HTMLElement?Im(x):[],y=Im(e.current);if(y!=null&&y.every(w=>w instanceof HTMLElement)&&v&&v.every(w=>w instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const w=s6(e.current);w&&(w.style.zIndex="1"),y.forEach((N,j)=>{const k=v[j];if(!k)return;N.style.position="relative",N.style.overflow="hidden";const b=Rm(N);b&&b.classList.add(m);const S=$m(N);S&&S.classList.add(p);const _=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),w&&(w.style.zIndex=""),b&&b.classList.remove(m),S&&S.classList.remove(p),N.style.position="",N.style.overflow="",N.contains(k)&&N.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const C=i6(k);C&&(C.style.opacity="0");const P=Rm(k);P&&(P.classList.add(f?r[Zr.caption_before_exit]:r[Zr.caption_after_exit]),P.addEventListener("animationend",_));const D=$m(k);D&&D.classList.add(f?r[Zr.weeks_before_exit]:r[Zr.weeks_after_exit]),N.insertBefore(k,N.firstChild)})}})}function l6(e,t,r,n){const s=e[0],i=e[e.length-1],{ISOWeek:o,fixedWeeks:l,broadcastCalendar:c}=r??{},{addDays:d,differenceInCalendarDays:u,differenceInCalendarMonths:f,endOfBroadcastWeek:m,endOfISOWeek:p,endOfMonth:x,endOfWeek:g,isAfter:v,startOfBroadcastWeek:y,startOfISOWeek:w,startOfWeek:N}=n,j=c?y(s,n):o?w(s):N(s),k=c?m(i):o?p(x(i)):g(x(i)),b=t&&(c?m(t):o?p(t):g(t)),S=b&&v(k,b)?b:k,_=u(S,j),C=f(i,s)+1,P=[];for(let I=0;I<=_;I++){const F=d(j,I);P.push(F)}const E=(c?35:42)*C;if(l&&P.length<E){const I=E-P.length;for(let F=0;F<I;F++){const Q=d(P[P.length-1],1);P.push(Q)}}return P}function c6(e){const t=[];return e.reduce((r,n)=>{const s=n.weeks.reduce((i,o)=>i.concat(o.days.slice()),t.slice());return r.concat(s.slice())},t.slice())}function d6(e,t,r,n){const{numberOfMonths:s=1}=r,i=[];for(let o=0;o<s;o++){const l=n.addMonths(e,o);if(t&&l>t)break;i.push(l)}return i}function Oy(e,t,r,n){const{month:s,defaultMonth:i,today:o=n.today(),numberOfMonths:l=1}=e;let c=s||i||o;const{differenceInCalendarMonths:d,addMonths:u,startOfMonth:f}=n;if(r&&d(r,c)<l-1){const m=-1*(l-1);c=u(r,m)}return t&&d(c,t)<0&&(c=t),f(c)}function u6(e,t,r,n){const{addDays:s,endOfBroadcastWeek:i,endOfISOWeek:o,endOfMonth:l,endOfWeek:c,getISOWeek:d,getWeek:u,startOfBroadcastWeek:f,startOfISOWeek:m,startOfWeek:p}=n,x=e.reduce((g,v)=>{const y=r.broadcastCalendar?f(v,n):r.ISOWeek?m(v):p(v),w=r.broadcastCalendar?i(v):r.ISOWeek?o(l(v)):c(l(v)),N=t.filter(S=>S>=y&&S<=w),j=r.broadcastCalendar?35:42;if(r.fixedWeeks&&N.length<j){const S=t.filter(_=>{const C=j-N.length;return _>w&&_<=s(w,C)});N.push(...S)}const k=N.reduce((S,_)=>{const C=r.ISOWeek?d(_):u(_),P=S.find(E=>E.weekNumber===C),D=new Ok(_,v,n);return P?P.days.push(D):S.push(new i$(C,[D])),S},[]),b=new s$(v,k);return g.push(b),g},[]);return r.reverseMonths?x.reverse():x}function f6(e,t){let{startMonth:r,endMonth:n}=e;const{startOfYear:s,startOfDay:i,startOfMonth:o,endOfMonth:l,addYears:c,endOfYear:d,newDate:u,today:f}=t,{fromYear:m,toYear:p,fromMonth:x,toMonth:g}=e;!r&&x&&(r=x),!r&&m&&(r=t.newDate(m,0,1)),!n&&g&&(n=g),!n&&p&&(n=u(p,11,31));const v=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return r?r=o(r):m?r=u(m,0,1):!r&&v&&(r=s(c(e.today??f(),-100))),n?n=l(n):p?n=u(p,11,31):!n&&v&&(n=d(e.today??f())),[r&&i(r),n&&i(n)]}function m6(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i:1,u=o(e);if(!t)return l(u,d);if(!(c(t,e)<i))return l(u,d)}function h6(e,t,r,n){if(r.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i}=r,{startOfMonth:o,addMonths:l,differenceInCalendarMonths:c}=n,d=s?i??1:1,u=o(e);if(!t)return l(u,-d);if(!(c(u,t)<=0))return l(u,-d)}function p6(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function af(e,t){const[r,n]=h.useState(e);return[t===void 0?r:t,n]}function x6(e,t){var j;const[r,n]=f6(e,t),{startOfMonth:s,endOfMonth:i}=t,o=Oy(e,r,n,t),[l,c]=af(o,e.month?o:void 0);h.useEffect(()=>{const k=Oy(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=h.useMemo(()=>{const k=d6(l,n,{numberOfMonths:e.numberOfMonths},t),b=l6(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),S=u6(k,b,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),_=p6(S),C=c6(S),P=h6(l,r,e,t),D=m6(l,n,e,t);return{months:S,weeks:_,days:C,previousMonth:P,nextMonth:D}},[t,l.getTime(),n==null?void 0:n.getTime(),r==null?void 0:r.getTime(),e.disableNavigation,e.broadcastCalendar,(j=e.endMonth)==null?void 0:j.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:x,onMonthChange:g}=e,v=k=>u.some(b=>b.days.some(S=>S.isEqualTo(k))),y=k=>{if(x)return;let b=s(k);r&&b<s(r)&&(b=s(r)),n&&b>s(n)&&(b=s(n)),c(b),g==null||g(b)};return{months:d,weeks:u,days:f,navStart:r,navEnd:n,previousMonth:m,nextMonth:p,goToMonth:y,goToDay:k=>{v(k)||y(k.date)}}}var Yn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Yn||(Yn={}));function Ey(e){return!e[jt.disabled]&&!e[jt.hidden]&&!e[jt.outside]}function g6(e,t,r,n){let s,i=-1;for(const o of e){const l=t(o);Ey(l)&&(l[jt.focused]&&i<Yn.FocusedModifier?(s=o,i=Yn.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<Yn.LastFocused?(s=o,i=Yn.LastFocused):r(o.date)&&i<Yn.Selected?(s=o,i=Yn.Selected):l[jt.today]&&i<Yn.Today&&(s=o,i=Yn.Today))}return s||(s=e.find(o=>Ey(t(o)))),s}function v6(e,t,r,n,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:x,endOfWeek:g,max:v,min:y,startOfBroadcastWeek:w,startOfISOWeek:N,startOfWeek:j}=o;let b={day:d,week:f,month:u,year:m,startOfWeek:S=>c?w(S,o):l?N(S):j(S),endOfWeek:S=>c?p(S):l?x(S):g(S)}[e](r,t==="after"?1:-1);return t==="before"&&n?b=v([n,b]):t==="after"&&s&&(b=y([s,b])),b}function Hk(e,t,r,n,s,i,o,l=0){if(l>365)return;const c=v6(e,t,r.date,n,s,i,o),d=!!(i.disabled&&Sa(c,i.disabled,o)),u=!!(i.hidden&&Sa(c,i.hidden,o)),f=c,m=new Ok(c,f,o);return!d&&!u?m:Hk(e,t,m,n,s,i,o,l+1)}function y6(e,t,r,n,s){const{autoFocus:i}=e,[o,l]=h.useState(),c=g6(t.days,r,n||(()=>!1),o),[d,u]=h.useState(i?c:void 0);return{isFocusTarget:g=>!!(c!=null&&c.isEqualTo(g)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(g,v)=>{if(!d)return;const y=Hk(g,v,d,t.navStart,t.navEnd,e,s);y&&(e.disableNavigation&&!t.days.some(N=>N.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function b6(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=af(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(x=>c(x,p)))??!1,{min:u,max:f}=e;return{selected:l,select:(p,x,g)=>{let v=[...l??[]];if(d(p)){if((l==null?void 0:l.length)===u||n&&(l==null?void 0:l.length)===1)return;v=l==null?void 0:l.filter(y=>!c(y,p))}else(l==null?void 0:l.length)===f?v=[p]:v=[...v,p];return s||o(v),s==null||s(v,p,x,g),v},isSelected:d}}function w6(e,t,r=0,n=0,s=!1,i=ha){const{from:o,to:l}=t||{},{isSameDay:c,isAfter:d,isBefore:u}=i;let f;if(!o&&!l)f={from:e,to:r>0?void 0:e};else if(o&&!l)c(o,e)?r===0?f={from:o,to:e}:s?f={from:o,to:void 0}:f=void 0:u(e,o)?f={from:e,to:o}:f={from:o,to:e};else if(o&&l)if(c(o,e)&&c(l,e))s?f={from:o,to:l}:f=void 0;else if(c(o,e))f={from:o,to:r>0?void 0:e};else if(c(l,e))f={from:e,to:r>0?void 0:e};else if(u(e,o))f={from:e,to:l};else if(d(e,o))f={from:o,to:e};else if(d(e,l))f={from:o,to:e};else throw new Error("Invalid range");if(f!=null&&f.from&&(f!=null&&f.to)){const m=i.differenceInCalendarDays(f.to,f.from);n>0&&m>n?f={from:e,to:void 0}:r>1&&m<r&&(f={from:e,to:void 0})}return f}function j6(e,t,r=ha){const n=Array.isArray(t)?t:[t];let s=e.from;const i=r.differenceInCalendarDays(e.to,e.from),o=Math.min(i,6);for(let l=0;l<=o;l++){if(n.includes(s.getDay()))return!0;s=r.addDays(s,1)}return!1}function Ay(e,t,r=ha){return ka(e,t.from,!1,r)||ka(e,t.to,!1,r)||ka(t,e.from,!1,r)||ka(t,e.to,!1,r)}function N6(e,t,r=ha){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?ka(e,l,!1,r):Dk(l,r)?l.some(c=>ka(e,c,!1,r)):nf(l)?l.from&&l.to?Ay(e,{from:l.from,to:l.to},r):!1:Ak(l)?j6(e,l.dayOfWeek,r):Px(l)?r.isAfter(l.before,l.after)?Ay(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):Sa(e.from,l,r)||Sa(e.to,l,r):Ox(l)||Ex(l)?Sa(e.from,l,r)||Sa(e.to,l,r):!1))return!0;const o=n.filter(l=>typeof l=="function");if(o.length){let l=e.from;const c=r.differenceInCalendarDays(e.to,e.from);for(let d=0;d<=c;d++){if(o.some(u=>u(l)))return!0;l=r.addDays(l,1)}}return!1}function k6(e,t){const{disabled:r,excludeDisabled:n,selected:s,required:i,onSelect:o}=e,[l,c]=af(s,o?s:void 0),d=o?s:l;return{selected:d,select:(m,p,x)=>{const{min:g,max:v}=e,y=m?w6(m,d,g,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&N6({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,p,x),y},isSelected:m=>d&&ka(d,m,!1,t)}}function S6(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=af(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,p)=>{let x=f;return!n&&l&&l&&c(f,l)&&(x=void 0),s||o(x),s==null||s(x,f,m,p),x},isSelected:f=>l?c(l,f):!1}}function C6(e,t){const r=S6(e,t),n=b6(e,t),s=k6(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return s;default:return}}function fn(e,t){return e instanceof gr&&e.timeZone===t?e:new gr(e,t)}function Ti(e,t,r){return fn(e,t)}function Dy(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Ti(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?Ti(n,t):n):nf(e)?{...e,from:e.from?fn(e.from,t):e.from,to:e.to?fn(e.to,t):e.to}:Px(e)?{before:Ti(e.before,t),after:Ti(e.after,t)}:Ox(e)?{after:Ti(e.after,t)}:Ex(e)?{before:Ti(e.before,t)}:e}function zm(e,t,r){return e&&(Array.isArray(e)?e.map(n=>Dy(n,t)):Dy(e,t))}function _6(e){var Oe;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=fn(t.today,r)),t.month&&(t.month=fn(t.month,r)),t.defaultMonth&&(t.defaultMonth=fn(t.defaultMonth,r)),t.startMonth&&(t.startMonth=fn(t.startMonth,r)),t.endMonth&&(t.endMonth=fn(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=fn(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(Oe=t.selected)==null?void 0:Oe.map(xe=>fn(xe,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?fn(t.selected.from,r):t.selected.from,to:t.selected.to?fn(t.selected.to,r):t.selected.to}),t.disabled!==void 0&&(t.disabled=zm(t.disabled,r)),t.hidden!==void 0&&(t.hidden=zm(t.hidden,r)),t.modifiers)){const xe={};Object.keys(t.modifiers).forEach(je=>{var he;xe[je]=zm((he=t.modifiers)==null?void 0:he[je],r)}),t.modifiers=xe}const{components:n,formatters:s,labels:i,dateLib:o,locale:l,classNames:c}=h.useMemo(()=>{const xe={...Pk,...t.locale},je=t.broadcastCalendar?1:t.weekStartsOn,he=t.noonSafe&&t.timeZone?n6(t.timeZone,{weekStartsOn:je,locale:xe}):void 0,ye=t.dateLib&&he?{...he,...t.dateLib}:t.dateLib??he,Ve=new sn({locale:xe,weekStartsOn:je,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},ye);return{dateLib:Ve,components:R$(t.components),formatters:Y$(t.formatters),labels:Z$(t.labels,Ve.options),locale:xe,classNames:{...z$(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});const{captionLayout:d,mode:u,navLayout:f,numberOfMonths:m=1,onDayBlur:p,onDayClick:x,onDayFocus:g,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:w,onNextClick:N,onPrevClick:j,showWeekNumber:k,styles:b}=t,{formatCaption:S,formatDay:_,formatMonthDropdown:C,formatWeekNumber:P,formatWeekNumberHeader:D,formatWeekdayName:E,formatYearDropdown:I}=s,F=x6(t,o),{days:Q,months:Y,navStart:X,navEnd:re,previousMonth:ee,nextMonth:T,goToMonth:M}=F,$=T$(Q,t,X,re,o),{isSelected:K,select:z,selected:G}=C6(t,o)??{},{blur:A,focused:O,isFocusTarget:J,moveFocus:B,setFocused:ae}=y6(t,F,$,K??(()=>!1),o),{labelDayButton:R,labelGridcell:q,labelGrid:se,labelMonthDropdown:V,labelNav:ie,labelPrevious:pe,labelNext:ue,labelWeekday:ve,labelWeekNumber:be,labelWeekNumberHeader:Z,labelYearDropdown:Ae}=i,Te=h.useMemo(()=>t6(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Fe=u!==void 0||x!==void 0,$e=h.useCallback(()=>{ee&&(M(ee),j==null||j(ee))},[ee,M,j]),et=h.useCallback(()=>{T&&(M(T),N==null||N(T))},[M,T,N]),Ke=h.useCallback((xe,je)=>he=>{he.preventDefault(),he.stopPropagation(),ae(xe),!je.disabled&&(z==null||z(xe.date,je,he),x==null||x(xe.date,je,he))},[z,x,ae]),Ze=h.useCallback((xe,je)=>he=>{ae(xe),g==null||g(xe.date,je,he)},[g,ae]),rr=h.useCallback((xe,je)=>he=>{A(),p==null||p(xe.date,je,he)},[A,p]),$r=h.useCallback((xe,je)=>he=>{const ye={ArrowLeft:[he.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[he.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[he.shiftKey?"year":"week","after"],ArrowUp:[he.shiftKey?"year":"week","before"],PageUp:[he.shiftKey?"year":"month","before"],PageDown:[he.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ye[he.key]){he.preventDefault(),he.stopPropagation();const[Ve,de]=ye[he.key];B(Ve,de)}v==null||v(xe.date,je,he)},[B,v,t.dir]),nr=h.useCallback((xe,je)=>he=>{y==null||y(xe.date,je,he)},[y]),br=h.useCallback((xe,je)=>he=>{w==null||w(xe.date,je,he)},[w]),ar=h.useCallback(xe=>je=>{const he=Number(je.target.value),ye=o.setMonth(o.startOfMonth(xe),he);M(ye)},[o,M]),yt=h.useCallback(xe=>je=>{const he=Number(je.target.value),ye=o.setYear(o.startOfMonth(xe),he);M(ye)},[o,M]),{className:Lt,style:Kt}=h.useMemo(()=>({className:[c[Pe.Root],t.className].filter(Boolean).join(" "),style:{...b==null?void 0:b[Pe.Root],...t.style}}),[c,t.className,t.style,b]),sr=$$(t),Ln=h.useRef(null);o6(Ln,!!t.animate,{classNames:c,months:Y,focused:O,dateLib:o});const pa={dayPickerProps:t,selected:G,select:z,isSelected:K,months:Y,nextMonth:T,previousMonth:ee,goToMonth:M,getModifiers:$,components:n,classNames:c,styles:b,labels:i,formatters:s};return W.createElement(Ek.Provider,{value:pa},W.createElement(n.Root,{rootRef:t.animate?Ln:void 0,className:Lt,style:Kt,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...sr},W.createElement(n.Months,{className:c[Pe.Months],style:b==null?void 0:b[Pe.Months]},!t.hideNavigation&&!f&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Pe.Nav],style:b==null?void 0:b[Pe.Nav],"aria-label":ie(),onPreviousClick:$e,onNextClick:et,previousMonth:ee,nextMonth:T}),Y.map((xe,je)=>W.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[Pe.Month],style:b==null?void 0:b[Pe.Month],key:je,displayIndex:je,calendarMonth:xe},f==="around"&&!t.hideNavigation&&je===0&&W.createElement(n.PreviousMonthButton,{type:"button",className:c[Pe.PreviousMonthButton],tabIndex:ee?void 0:-1,"aria-disabled":ee?void 0:!0,"aria-label":pe(ee),onClick:$e,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:ee?void 0:!0,className:c[Pe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),W.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[Pe.MonthCaption],style:b==null?void 0:b[Pe.MonthCaption],calendarMonth:xe,displayIndex:je},d!=null&&d.startsWith("dropdown")?W.createElement(n.DropdownNav,{className:c[Pe.Dropdowns],style:b==null?void 0:b[Pe.Dropdowns]},(()=>{const he=d==="dropdown"||d==="dropdown-months"?W.createElement(n.MonthsDropdown,{key:"month",className:c[Pe.MonthsDropdown],"aria-label":V(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:ar(xe.date),options:J$(xe.date,X,re,s,o),style:b==null?void 0:b[Pe.Dropdown],value:o.getMonth(xe.date)}):W.createElement("span",{key:"month"},C(xe.date,o)),ye=d==="dropdown"||d==="dropdown-years"?W.createElement(n.YearsDropdown,{key:"year",className:c[Pe.YearsDropdown],"aria-label":Ae(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:yt(xe.date),options:r6(X,re,s,o,!!t.reverseYears),style:b==null?void 0:b[Pe.Dropdown],value:o.getYear(xe.date)}):W.createElement("span",{key:"year"},I(xe.date,o));return o.getMonthYearOrder()==="year-first"?[ye,he]:[he,ye]})(),W.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},S(xe.date,o.options,o))):W.createElement(n.CaptionLabel,{className:c[Pe.CaptionLabel],role:"status","aria-live":"polite"},S(xe.date,o.options,o))),f==="around"&&!t.hideNavigation&&je===m-1&&W.createElement(n.NextMonthButton,{type:"button",className:c[Pe.NextMonthButton],tabIndex:T?void 0:-1,"aria-disabled":T?void 0:!0,"aria-label":ue(T),onClick:et,"data-animated-button":t.animate?"true":void 0},W.createElement(n.Chevron,{disabled:T?void 0:!0,className:c[Pe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),je===m-1&&f==="after"&&!t.hideNavigation&&W.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Pe.Nav],style:b==null?void 0:b[Pe.Nav],"aria-label":ie(),onPreviousClick:$e,onNextClick:et,previousMonth:ee,nextMonth:T}),W.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":se(xe.date,o.options,o)||void 0,className:c[Pe.MonthGrid],style:b==null?void 0:b[Pe.MonthGrid]},!t.hideWeekdays&&W.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[Pe.Weekdays],style:b==null?void 0:b[Pe.Weekdays]},k&&W.createElement(n.WeekNumberHeader,{"aria-label":Z(o.options),className:c[Pe.WeekNumberHeader],style:b==null?void 0:b[Pe.WeekNumberHeader],scope:"col"},D()),Te.map(he=>W.createElement(n.Weekday,{"aria-label":ve(he,o.options,o),className:c[Pe.Weekday],key:String(he),style:b==null?void 0:b[Pe.Weekday],scope:"col"},E(he,o.options,o)))),W.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[Pe.Weeks],style:b==null?void 0:b[Pe.Weeks]},xe.weeks.map(he=>W.createElement(n.Week,{className:c[Pe.Week],key:he.weekNumber,style:b==null?void 0:b[Pe.Week],week:he},k&&W.createElement(n.WeekNumber,{week:he,style:b==null?void 0:b[Pe.WeekNumber],"aria-label":be(he.weekNumber,{locale:l}),className:c[Pe.WeekNumber],scope:"row",role:"rowheader"},P(he.weekNumber,o)),he.days.map(ye=>{const{date:Ve}=ye,de=$(ye);if(de[jt.focused]=!de.hidden&&!!(O!=null&&O.isEqualTo(ye)),de[Mn.selected]=(K==null?void 0:K(Ve))||de.selected,nf(G)){const{from:nt,to:at}=G;de[Mn.range_start]=!!(nt&&at&&o.isSameDay(Ve,nt)),de[Mn.range_end]=!!(nt&&at&&o.isSameDay(Ve,at)),de[Mn.range_middle]=ka(G,Ve,!0,o)}const _e=e6(de,b,t.modifiersStyles),Re=I$(de,c,t.modifiersClassNames),bt=!Fe&&!de.hidden?q(Ve,de,o.options,o):void 0;return W.createElement(n.Day,{key:`${ye.isoDate}_${ye.displayMonthId}`,day:ye,modifiers:de,className:Re.join(" "),style:_e,role:"gridcell","aria-selected":de.selected||void 0,"aria-label":bt,"data-day":ye.isoDate,"data-month":ye.outside?ye.dateMonthId:void 0,"data-selected":de.selected||void 0,"data-disabled":de.disabled||void 0,"data-hidden":de.hidden||void 0,"data-outside":ye.outside||void 0,"data-focused":de.focused||void 0,"data-today":de.today||void 0},!de.hidden&&Fe?W.createElement(n.DayButton,{className:c[Pe.DayButton],style:b==null?void 0:b[Pe.DayButton],type:"button",day:ye,modifiers:de,disabled:!de.focused&&de.disabled||void 0,"aria-disabled":de.focused&&de.disabled||void 0,tabIndex:J(ye)?0:-1,"aria-label":R(Ve,de,o.options,o),onClick:Ke(ye,de),onBlur:rr(ye,de),onFocus:Ze(ye,de),onKeyDown:$r(ye,de),onMouseEnter:nr(ye,de),onMouseLeave:br(ye,de)},_(Ve,o.options,o)):!de.hidden&&_(ye.date,o.options,o))})))))))),t.footer&&W.createElement(n.Footer,{className:c[Pe.Footer],style:b==null?void 0:b[Pe.Footer],role:"status","aria-live":"polite"},t.footer)))}function yr({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(_6,{showOutsideDays:r,className:L("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",month_caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium pointer-events-none",nav:"flex items-center gap-1",button_previous:L(Ki({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:L(Ki({variant:"outline"}),"absolute right-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),month_grid:"w-full border-collapse",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem] text-center",week:"flex w-full mt-2",day:"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 rounded-md",day_button:L(Ki({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),selected:"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:focus:bg-primary [&>button]:focus:text-primary-foreground",today:"[&>button]:bg-accent [&>button]:text-accent-foreground",outside:"day-outside text-muted-foreground [&>button]:text-muted-foreground aria-selected:text-muted-foreground",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...t},components:{Chevron:({orientation:s})=>s==="left"?a.jsx(na,{className:"h-4 w-4"}):a.jsx(hr,{className:"h-4 w-4"})},...n})}yr.displayName="Calendar";function M6(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,P6(s,...t)]}function P6(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function O6(e){const t=E6(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(D6);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function E6(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=I6(s),l=T6(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Xj(n,o):o),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var A6=Symbol("radix.slottable");function D6(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A6}function T6(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function I6(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var R6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kk=R6.reduce((e,t)=>{const r=O6(`Primitive.${t}`),n=h.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),sf="Switch",[$6]=M6(sf),[z6,L6]=$6(sf),Yk=h.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[m,p]=h.useState(null),x=Au(t,N=>p(N)),g=h.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,w]=YO({prop:s,defaultProp:i??!1,onChange:d,caller:sf});return a.jsxs(z6,{scope:r,checked:y,disabled:l,children:[a.jsx(Kk.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":Qk(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:x,onClick:Ws(e.onClick,N=>{w(j=>!j),v&&(g.current=N.isPropagationStopped(),g.current||N.stopPropagation())})}),v&&a.jsx(Xk,{control:m,bubbles:!g.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});Yk.displayName=sf;var Gk="SwitchThumb",Vk=h.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=L6(Gk,r);return a.jsx(Kk.span,{"data-state":Qk(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Vk.displayName=Gk;var F6="SwitchBubbleInput",Xk=h.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=h.useRef(null),l=Au(o,i),c=GO(r),d=VO(t);return h.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const x=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(x)}},[c,r,n]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Xk.displayName=F6;function Qk(e){return e?"checked":"unchecked"}var Zk=Yk,B6=Vk;const Oo=h.forwardRef(({className:e,...t},r)=>a.jsx(Zk,{className:L("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(B6,{className:L("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Oo.displayName=Zk.displayName;function W6(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function of({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:s,defaultParentId:i}){const o=pt(),{workspace:l,projectKey:c}=zt(),{workspace:d}=Ie(),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(n),[v,y]=h.useState("medium"),[w,N]=h.useState("task"),[j,k]=h.useState([]),[b,S]=h.useState(""),[_,C]=h.useState(s??""),[P,D]=h.useState(void 0),[E,I]=h.useState(void 0),[F,Q]=h.useState(!1),[Y,X]=h.useState("weekly"),[re,ee]=h.useState(void 0),T=k1(),{data:M}=ua(r),$=h.useMemo(()=>M?M.members.filter(R=>R.user).map(R=>R.user):void 0,[M]),K=h.useMemo(()=>$==null?void 0:$.map(R=>({id:R.id,label:`${R.first_name??""} ${R.last_name??""}`.trim()||R.email,email:R.email})),[$]),{data:z}=Mo(r),{data:G}=Po(r||void 0),{data:A}=lc(r||void 0),O=(G??[]).filter(R=>R.status!=="completed"),J=z&&z.length>0?Object.fromEntries(z.map(R=>[R.key,R.name])):ui,B=()=>{f(""),p(""),g(n),y("medium"),N("task"),k([]),S(""),C(s??""),D(void 0),I(void 0),Q(!1),X("weekly"),ee(void 0),t()},ae=R=>{if(R.preventDefault(),!u.trim())return;const q=[];m&&new DOMParser().parseFromString(m,"text/html").querySelectorAll("[data-type='mention']").forEach(ie=>{const pe=ie.getAttribute("data-id");pe&&!q.includes(pe)&&q.push(pe)}),T.mutate({title:u.trim(),description:m.trim()||void 0,status:x,priority:v,type:w,project_id:r,workspace_id:d.id,assignee_ids:j.length>0?j:void 0,sprint_id:b||null,task_list_id:_||null,parent_id:i||null,start_date:P?fe(P,"yyyy-MM-dd"):null,due_date:E?fe(E,"yyyy-MM-dd"):null,recurrence_frequency:F?Y:void 0,recurrence_end_date:F&&re?fe(re,"yyyy-MM-dd"):void 0,mentioned_user_ids:q.length>0?q:void 0},{onSuccess:()=>{U.success("Issue created"),B()},onError:se=>U.error(se.message??"Failed to create issue")})};return a.jsx(Si,{open:e,onOpenChange:R=>!R&&B(),dismissible:!1,children:a.jsxs(Ci,{className:"max-w-xl",children:[a.jsx(ko,{children:a.jsx(Co,{children:"New issue"})}),a.jsxs("form",{onSubmit:ae,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(So,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{htmlFor:"issue-title",children:"Title"}),a.jsx(Me,{id:"issue-title",placeholder:"Issue title",value:u,onChange:R=>f(R.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Description ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(rf,{content:m,onChange:p,placeholder:"Add more context… (type @ to mention)",className:"min-h-[120px] rounded-md border border-input",users:K})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"Status"}),a.jsxs(qe,{value:x,onValueChange:g,children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(J).map(([R,q])=>a.jsx(ke,{value:R,className:"text-xs",children:q},R))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"Priority"}),a.jsxs(qe,{value:v,onValueChange:y,children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(an).map(([R,q])=>a.jsx(ke,{value:R,className:"text-xs",children:q},R))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"Type"}),a.jsxs(qe,{value:w,onValueChange:N,children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(Da).map(([R,q])=>a.jsx(ke,{value:R,className:"text-xs",children:q},R))})]})]})]}),i&&a.jsx("div",{className:"rounded-md bg-muted/50 border border-border px-3 py-2 text-xs text-muted-foreground",children:"Will be created as a child issue"}),(A??[]).length>0&&!i&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["List ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(qe,{value:_||"none",onValueChange:R=>C(R==="none"?"":R),children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{placeholder:"No list"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(A??[]).map(R=>a.jsx(ke,{value:R.id,className:"text-xs",children:R.name},R.id))]})]})]}),O.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Sprint ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(qe,{value:b||"none",onValueChange:R=>S(R==="none"?"":R),children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{placeholder:"No sprint"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),O.map(R=>{const q=W6(R);return a.jsx(ke,{value:R.id,className:"text-xs",children:a.jsxs("div",{children:[a.jsx("span",{children:R.name}),q&&a.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:q})]})},R.id)})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Assignees ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(cc,{value:j,onChange:k,users:$})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Start Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:P?"text-foreground":"text-muted-foreground",children:P?fe(P,"MMM d, yyyy"):"No start date"}),P&&a.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),D(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:P,onSelect:D,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Due Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-9 w-full rounded-md border border-input px-3 text-sm bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?fe(E,"MMM d, yyyy"):"No due date"}),E&&a.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),I(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:E,onSelect:I,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Oo,{id:"recurring",checked:F,onCheckedChange:Q}),a.jsxs(mt,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[a.jsx(Qi,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),F&&a.jsx("div",{className:"space-y-3 pl-4 border-l-2 border-indigo-200 dark:border-indigo-800",children:a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"Frequency"}),a.jsxs(qe,{value:Y,onValueChange:R=>X(R),children:[a.jsx(We,{className:"h-8 text-xs",children:a.jsx(Xe,{})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{children:["Until ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-2 h-8 w-full rounded-md border border-input px-3 text-xs bg-transparent hover:bg-accent transition-colors text-left",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:re?"text-foreground":"text-muted-foreground",children:re?fe(re,"MMM d, yyyy"):"No end date"}),re&&a.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),ee(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:re,onSelect:ee,initialFocus:!0})})]})]})]})})]})]}),a.jsxs(sc,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs(ne,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{B(),o(`/${l}/projects/${c}/issues/new`)},children:[a.jsx(Zp,{className:"h-3.5 w-3.5"}),"Open full form"]}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx(ne,{type:"button",variant:"ghost",onClick:B,children:"Cancel"}),a.jsx(ne,{type:"submit",disabled:!u.trim()||T.isPending,children:T.isPending?"Creating...":"Create issue"})]})]})]})]})})}const Jk=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Qj,{ref:n,className:L("relative overflow-hidden",e),...r,children:[a.jsx(XO,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(eS,{}),a.jsx(QO,{})]}));Jk.displayName=Qj.displayName;const eS=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(Zj,{ref:n,orientation:t,className:L("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(ZO,{className:"relative flex-1 rounded-full bg-border"})}));eS.displayName=Zj.displayName;function U6(e,t){let r=0,n=e;for(;n!=null&&n.parent_id;)n=t.find(s=>s.id===n.parent_id),r++;return r}function q6(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const H6={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function K6(e,t){return e==="completed"?"bg-emerald-500":e==="in_progress"?"bg-indigo-500":e==="cancelled"?"bg-red-400":t!=null&&t.includes("block")?"bg-red-500":"bg-zinc-400"}const Wn=({children:e})=>a.jsx("p",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100 mb-1.5",children:e}),nl=()=>a.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function tS({issue:e,projectId:t,open:r,onClose:n}){const s=pt(),{workspace:i,projectKey:o}=zt(),{data:l}=N1((e==null?void 0:e.id)??""),c=l??e,[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState("comments"),[y,w]=h.useState(!1),[N,j]=h.useState(new Set),k=Tu((c==null?void 0:c.id)??"",t),{data:b}=ua(t),S=h.useMemo(()=>b?b.members.filter(Z=>Z.user).map(Z=>Z.user):void 0,[b]),_=h.useMemo(()=>S==null?void 0:S.map(Z=>({id:Z.id,label:`${Z.first_name??""} ${Z.last_name??""}`.trim()||Z.email,email:Z.email})),[S]),{data:C}=Mo(t),{data:P}=Po(t||void 0),{data:D}=lc(t||void 0),{data:E}=Gl(t||void 0),{data:I}=jx(),{data:F=[]}=Nx(new Date().getFullYear()),Q=(P??[]).filter(Z=>Z.status!=="completed"),{data:Y}=VN(),X=(Y==null?void 0:Y.maxChildIssueDepth)??1,ee=(c?U6(c,E??[]):0)<X,T=c!=null&&c.parent_id?E==null?void 0:E.find(Z=>Z.id===c.parent_id):null,M=(E==null?void 0:E.filter(Z=>Z.parent_id===(c==null?void 0:c.id)))??[],$=c!=null&&c.task_list_id?D==null?void 0:D.find(Z=>Z.id===c.task_list_id):null,K=C&&C.length>0?Object.fromEntries(C.map(Z=>[Z.key,Z.name])):ui;if(h.useEffect(()=>{c&&(m(c.title),x(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const z=()=>{if(!f.trim())return;const Z=[];new DOMParser().parseFromString(p,"text/html").querySelectorAll("[data-type='mention']").forEach(Fe=>{const $e=Fe.getAttribute("data-id");$e&&!Z.includes($e)&&Z.push($e)}),k.mutate({title:f.trim(),description:p.trim()||void 0,mentioned_user_ids:Z.length>0?Z:void 0},{onSuccess:()=>{u(!1),U.success("Issue updated")},onError:()=>U.error("Failed to update issue")})},G=()=>{m(c.title),x(c.description??""),u(!1)},A=Z=>{k.mutate({status:Z},{onSuccess:()=>U.success("Status updated"),onError:()=>U.error("Failed to update status")})},O=Z=>{k.mutate({priority:Z},{onSuccess:()=>U.success("Priority updated"),onError:()=>U.error("Failed to update priority")})},J=Z=>{k.mutate({type:Z},{onSuccess:()=>U.success("Type updated"),onError:()=>U.error("Failed to update type")})},B=Z=>{k.mutate({assignee_ids:Z},{onSuccess:()=>U.success("Assignees updated"),onError:()=>U.error("Failed to update assignees")})},ae=Z=>{k.mutate({sprint_id:Z},{onSuccess:()=>U.success(Z?"Sprint assigned":"Removed from sprint"),onError:()=>U.error("Failed to update sprint")})},R=Z=>{k.mutate({task_list_id:Z},{onSuccess:()=>U.success(Z?"Moved to list":"Removed from list"),onError:()=>U.error("Failed to update list")})},q=Z=>{k.mutate({start_date:Z?fe(Z,"yyyy-MM-dd"):null},{onSuccess:()=>U.success(Z?"Start date set":"Start date cleared"),onError:()=>U.error("Failed to update start date")})},se=Z=>{k.mutate({due_date:Z?fe(Z,"yyyy-MM-dd"):null},{onSuccess:()=>U.success(Z?"Due date set":"Due date cleared"),onError:()=>U.error("Failed to update due date")})},V=Z=>{if(Z){const Ae=c.start_date?new Date(c.start_date):new Date,Te=new Date(Ae);Te.setDate(Te.getDate()+7),k.mutate({recurrence_frequency:"weekly",next_occurrence_date:fe(Te,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>U.success("Recurrence enabled"),onError:()=>U.error("Failed to enable recurrence")})}else k.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>U.success("Recurrence stopped"),onError:()=>U.error("Failed to stop recurrence")})},ie=Z=>{const Ae=c.start_date?new Date(c.start_date):new Date,Te=new Date(Ae);Z==="weekly"?Te.setDate(Te.getDate()+7):Te.setMonth(Te.getMonth()+1),k.mutate({recurrence_frequency:Z,next_occurrence_date:fe(Te,"yyyy-MM-dd")},{onSuccess:()=>U.success("Frequency updated"),onError:()=>U.error("Failed to update frequency")})},pe=Z=>{k.mutate({recurrence_end_date:Z?fe(Z,"yyyy-MM-dd"):null},{onSuccess:()=>U.success(Z?"End date set":"End date cleared"),onError:()=>U.error("Failed to update end date")})},ue=C==null?void 0:C.find(Z=>Z.category==="completed"),ve=!!ue&&c.status===ue.key,be=(Z,Ae,Te)=>{const Fe=Z;return a.jsx("button",{title:Ae,onClick:Te,className:"h-8 w-8 flex items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(Fe,{className:"h-4 w-4"})},Ae)};return a.jsxs(a.Fragment,{children:[a.jsx(Si,{open:r,onOpenChange:Z=>!Z&&n(),dismissible:!1,children:a.jsxs(Ci,{className:"flex flex-col p-0 w-full max-w-2xl overflow-hidden bg-white dark:bg-zinc-950",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[a.jsxs("button",{onClick:()=>{var Z;ue&&A(ve?((Z=C==null?void 0:C.find(Ae=>Ae.category==="unstarted"||Ae.category==="backlog"))==null?void 0:Z.key)??c.status:ue.key)},className:L("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",ve?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/30":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/40"),children:[a.jsx(Xt,{className:"h-3.5 w-3.5"}),ve?"Completed":"Mark complete"]}),a.jsxs("div",{className:"flex items-center",children:[be(A5,"Upvote"),be(tx,"Attachments"),ee&&be(ta,"Add sub-issue",()=>w(!0)),be(oi,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),U.success("Link copied")}),be(j5,"Open full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}),d?a.jsxs("div",{className:"flex items-center gap-1 ml-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:G,children:"Cancel"}),a.jsxs(ne,{size:"sm",className:"h-7 text-xs",onClick:z,disabled:!f.trim()||k.isPending,children:[a.jsx(Xt,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:be(Ea,"More options")}),a.jsx(Er,{align:"end",className:"w-40",children:a.jsxs(st,{onClick:()=>u(!0),children:[a.jsx(Ns,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),be(Je,"Close",n)]})]}),a.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?a.jsx(Me,{value:f,onChange:Z=>m(Z.target.value),className:"text-sm font-medium h-8",autoFocus:!0}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2.5",children:[a.jsx("span",{className:"text-[11px] font-mono font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/60 px-1.5 py-0.5 rounded",children:c.identifier}),a.jsx("span",{className:"text-[10px] font-semibold tracking-widest uppercase text-violet-500 dark:text-violet-400",children:Da[c.type]??c.type}),c.recurrence_frequency&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/50 border border-emerald-200 dark:border-emerald-800 px-1.5 py-0.5 rounded",children:[a.jsx(Qi,{className:"h-2.5 w-2.5"}),"Repeats ",c.recurrence_frequency==="weekly"?"Weekly":"Monthly"]}),c.recurrence_source_id&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded",children:[a.jsx(Qi,{className:"h-2.5 w-2.5"}),"Recurring instance"]})]}),a.jsx("h2",{className:"text-[17px] font-semibold leading-snug text-zinc-900 dark:text-zinc-50",children:c.title})]})}),a.jsxs(Jk,{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[a.jsx(_r,{zone:"issue.details.before",props:{issue:c}}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx(Wn,{children:"Status"}),a.jsxs(qe,{value:c.status,onValueChange:A,children:[a.jsx(We,{className:"h-8 text-xs min-w-0",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(K).map(([Z,Ae])=>{const Te=C==null?void 0:C.find(Fe=>Fe.key===Z);return a.jsx(ke,{value:Z,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:L("h-2 w-2 rounded-full shrink-0 flex-none",K6(Te==null?void 0:Te.category,Z))}),a.jsx("span",{children:Ae})]})},Z)})})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Wn,{children:"Priority"}),a.jsxs(qe,{value:c.priority,onValueChange:O,children:[a.jsx(We,{className:"h-8 text-xs min-w-0",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(an).map(([Z,Ae])=>a.jsx(ke,{value:Z,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:L("h-2 w-2 rounded-full shrink-0 flex-none",H6[Z]??"bg-zinc-400")}),a.jsx("span",{children:Ae})]})},Z))})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Wn,{children:"Type"}),a.jsxs(qe,{value:c.type,onValueChange:J,children:[a.jsx(We,{className:"h-8 text-xs min-w-0",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:Object.entries(Da).map(([Z,Ae])=>a.jsx(ke,{value:Z,className:"text-xs",children:Ae},Z))})]})]})]}),a.jsx(nl,{}),a.jsxs("div",{children:[a.jsx(Wn,{children:"Assignees"}),a.jsx(cc,{value:c.assignee_ids??[],onChange:B,disabled:k.isPending,users:S})]}),a.jsx(nl,{}),a.jsxs("div",{className:"flex gap-3 items-start min-w-0",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Wn,{children:"Sprint"}),a.jsxs(qe,{value:c.sprint_id??"none",onValueChange:Z=>ae(Z==="none"?null:Z),children:[a.jsx(We,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Kr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Xe,{placeholder:"No sprint"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),Q.map(Z=>{const Ae=q6(Z);return a.jsx(ke,{value:Z.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:Z.name}),Ae&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:Ae})]})},Z.id)})]})]})]}),(D??[]).length>0&&a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Wn,{children:"List"}),a.jsxs(qe,{value:c.task_list_id??"none",onValueChange:Z=>R(Z==="none"?null:Z),children:[a.jsx(We,{className:"h-8 text-xs min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0 overflow-hidden",children:[a.jsx(Jp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Xe,{placeholder:"No list",children:$?$.name:"No list"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(D??[]).map(Z=>a.jsx(ke,{value:Z.id,className:"text-xs",children:Z.name},Z.id))]})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Wn,{children:"Start Date"}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.start_date?"text-foreground":"text-muted-foreground"}`,children:c.start_date?fe(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",children:[a.jsx(yr,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:q,initialFocus:!0}),c.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>q(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(I==null?void 0:I.working_days)&&(()=>{const Z=Ch(new Date(c.start_date),new Date(c.due_date),I.working_days,F);return a.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[Z," biz day",Z!==1?"s":""]})})(),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Wn,{children:"Due Date"}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-8 w-full min-w-0 px-2 rounded border border-input text-xs hover:bg-accent transition-colors overflow-hidden",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:`truncate ${c.due_date?"text-foreground":"text-muted-foreground"}`,children:c.due_date?fe(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",children:[a.jsx(yr,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:se,initialFocus:!0}),c.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>se(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),a.jsx(nl,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Wn,{children:"Recurring"}),a.jsx(Oo,{checked:!!c.recurrence_frequency,onCheckedChange:V,disabled:k.isPending})]}),c.recurrence_frequency&&a.jsxs("div",{className:"space-y-2 pl-3 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:"Frequency"}),a.jsxs(qe,{value:c.recurrence_frequency,onValueChange:Z=>ie(Z),children:[a.jsx(We,{className:"h-7 text-xs",children:a.jsx(Xe,{})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-[10px] font-medium text-muted-foreground mb-1",children:["Until ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1 h-7 w-full px-2 rounded border border-input text-xs hover:bg-accent transition-colors text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:c.recurrence_end_date?"text-foreground":"text-muted-foreground",children:c.recurrence_end_date?fe(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",children:[a.jsx(yr,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:pe,initialFocus:!0}),c.recurrence_end_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>pe(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),a.jsx(nl,{}),ee&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-semibold tracking-[0.08em] uppercase text-zinc-900 dark:text-zinc-100",children:"Child Issues"}),a.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded-md bg-indigo-50 dark:bg-indigo-950/50 text-indigo-700 dark:text-indigo-300 text-[11px] font-medium hover:bg-indigo-100 dark:hover:bg-indigo-900/60 transition-colors",children:[a.jsx(ut,{className:"h-3 w-3"}),"Add"]})]}),T&&a.jsxs("button",{onClick:()=>s(`/${i}/projects/${o}/issues/${T.id}`),className:"flex items-center gap-2 w-full px-3 py-1.5 rounded-md bg-zinc-100 dark:bg-zinc-800/60 border border-zinc-200 dark:border-zinc-700 hover:border-indigo-300 dark:hover:border-indigo-700 transition-colors text-left",children:[a.jsx(Gp,{className:"h-3.5 w-3.5 text-zinc-400 shrink-0"}),a.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-400 shrink-0",children:"Parent:"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:T.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:T.title})]}),M.length===0?a.jsxs("button",{onClick:()=>w(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Create child issue"]}):a.jsx("div",{className:"space-y-1",children:M.map(Z=>{const Ae=(E??[]).filter($e=>$e.parent_id===Z.id),Te=Ae.length>0,Fe=N.has(Z.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/40 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all group",children:[Te?a.jsx("button",{onClick:()=>j($e=>{const et=new Set($e);return et.has(Z.id)?et.delete(Z.id):et.add(Z.id),et}),className:"shrink-0 text-indigo-400 dark:text-indigo-500 hover:text-indigo-600 dark:hover:text-indigo-300 transition-colors",children:Fe?a.jsx(ca,{className:"h-3.5 w-3.5"}):a.jsx(hr,{className:"h-3.5 w-3.5"})}):a.jsx(On,{className:"h-3.5 w-3.5 text-indigo-400 dark:text-indigo-500 shrink-0"}),a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${Z.id}`)},className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-700 dark:text-indigo-300 shrink-0",children:Z.identifier}),a.jsx("span",{className:"text-xs text-zinc-700 dark:text-zinc-300 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:Z.title}),Te&&a.jsxs("span",{className:"ml-auto shrink-0 flex items-center gap-0.5 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(On,{className:"h-2.5 w-2.5"}),Ae.length]})]})]}),Te&&Fe&&a.jsx("div",{className:"mt-1 ml-6 space-y-1",children:Ae.map($e=>a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${$e.id}`)},className:"w-full flex items-center gap-2.5 px-3 py-2 rounded-lg bg-indigo-50/20 dark:bg-indigo-950/20 border border-indigo-100 dark:border-indigo-900 hover:bg-indigo-100/70 hover:border-indigo-400 dark:hover:bg-indigo-950/50 dark:hover:border-indigo-600 hover:shadow-sm transition-all text-left group",children:[a.jsx(On,{className:"h-3.5 w-3.5 text-indigo-300 dark:text-indigo-600 shrink-0"}),a.jsx("span",{className:"font-mono text-[11px] font-medium text-indigo-600 dark:text-indigo-400 shrink-0",children:$e.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-400 truncate group-hover:text-zinc-900 dark:group-hover:text-zinc-100 transition-colors",children:$e.title})]},$e.id))})]},Z.id)})})]}),a.jsx(nl,{}),a.jsxs("div",{children:[a.jsx(Wn,{children:"Description"}),d?a.jsx(rf,{content:p,onChange:x,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input",users:_},`${c.id}-edit`):c.description?a.jsx("div",{className:"rounded-lg bg-zinc-50 dark:bg-zinc-900/60 border border-zinc-100 dark:border-zinc-800 px-3.5 py-3",children:a.jsx(Mx,{html:c.description,className:"text-sm"})}):a.jsxs("button",{onClick:()=>u(!0),className:"w-full flex items-center justify-center gap-2 py-3.5 rounded-lg border-2 border-dashed border-zinc-200 dark:border-zinc-800 text-xs text-zinc-400 dark:text-zinc-500 hover:border-indigo-300 hover:text-indigo-500 dark:hover:border-indigo-700 dark:hover:text-indigo-400 transition-all",children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),a.jsx("div",{className:"px-6 py-4",children:a.jsx(_r,{zone:"issue.details.after",props:{issue:c}})}),a.jsx(Sk,{issueId:c.id,projectId:t,className:"border-t border-border",compact:!0,hideCommentInput:!0,onTabChange:v,onViewMore:()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)}})]}),g==="comments"&&a.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:a.jsx(kk,{issueId:c.id,projectId:t,compact:!0})})]})}),a.jsx(of,{open:y,onClose:()=>w(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function Y6(){const{projectKey:e,workspace:t}=zt(),r=rN(),[n,s]=h.useState(null),[i,o]=h.useState(!1),[l,c]=h.useState({}),{data:d}=Ha(e??""),u=(d==null?void 0:d.id)??"",{data:f,isLoading:m}=Gl(u||void 0,l),{data:p,isLoading:x}=Mo(u||void 0),{data:g}=ua(u),{data:v}=_s(),y=h4(u),w=h.useMemo(()=>!(g!=null&&g.members)||!v?[]:g.members.map(k=>{const b=v.get(k.user_id);return b?{userId:k.user_id,name:b.name,initials:b.initials}:null}).filter(k=>k!==null),[g,v]);if(r&&e&&t)return a.jsx(Zn,{to:`/${t}/projects/${e}/issues`,replace:!0});if(!e)return null;const N=m||x||!d,j=k=>{y.mutate(k)};return a.jsxs("div",{className:"flex flex-col h-full gap-0",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0",children:[a.jsx(I4,{statuses:p??[],members:w,filters:l,onChange:c}),a.jsxs(ne,{size:"sm",onClick:()=>o(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"Create"]})]}),a.jsx(_r,{zone:"project.board.before",props:{projectId:u}}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:N?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(k=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(le,{className:"h-[82px] w-full rounded-lg"}),a.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},k))}):a.jsx(GN,{issues:f??[],projectId:u,statuses:p??[],onIssueClick:s,onColumnsReorder:j,filters:l})})]}),a.jsx(_r,{zone:"project.board.after",props:{projectId:u}}),a.jsx(tS,{issue:n,projectId:u,open:!!n,onClose:()=>s(null)}),a.jsx(of,{open:i,onClose:()=>o(!1),projectId:u})]})}const Eh=({priority:e,className:t})=>{const r=L("h-3.5 w-3.5 shrink-0",oc[e],t);switch(e){case"urgent":return a.jsx(da,{className:r});case"high":return a.jsx(ji,{className:r});case"medium":return a.jsx(qa,{className:r});case"low":return a.jsx(wi,{className:r});default:return a.jsx(Pr,{className:L("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},Ah="grid-cols-[110px_250px_150px_120px_130px_140px_130px_32px]";function rS({issue:e,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:d=!1,depth:u=0,children:f=[],childrenMap:m,onAddChild:p}){const x=pt(),[g,v]=h.useState(null),[y,w]=h.useState(!1),N=Tu(e.id,t),{data:j}=ua(t),k=h.useMemo(()=>j?j.members.filter(P=>P.user).map(P=>P.user):void 0,[j]);function b(P){N.mutate(P),v(null)}const S=(s==null?void 0:s[e.status])??"#94a3b8",_=i.find(P=>P.id===e.sprint_id),C=f.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>c(e),className:L(`group grid ${Ah} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-zinc-50/80 dark:bg-zinc-800/30",N.isPending&&"opacity-70"),children:[a.jsx("span",{className:L("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 transition-colors",d?"bg-zinc-50/80 dark:bg-zinc-800/30 group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30":"bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30"),style:{paddingLeft:`${1.5+u*1.25}rem`},children:e.identifier}),a.jsxs("div",{className:L("flex items-center gap-1 min-w-0 pr-3","sticky left-[110px] z-10 transition-colors",d?"bg-zinc-50/80 dark:bg-zinc-800/30 group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30":"bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30"),children:[C?a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:P=>{P.stopPropagation(),w(!y)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:y?a.jsx(ca,{className:"h-3.5 w-3.5"}):a.jsx(hr,{className:"h-3.5 w-3.5"})})}),a.jsx(Pn,{side:"top",children:y?"Collapse":"Expand"})]}):d?a.jsx(On,{className:"h-3 w-3 text-muted-foreground shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:L("text-sm text-foreground truncate",d&&"text-primary"),children:e.title}),C&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(On,{className:"h-2.5 w-2.5"}),f.length]})]}),a.jsx("div",{onClick:P=>P.stopPropagation(),children:a.jsxs(Pt,{open:g==="status",onOpenChange:P=>v(P?"status":null),children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 max-w-full px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:S}}),a.jsx("span",{className:"text-xs text-primary truncate",children:n[e.status]??e.status})]})}),a.jsx(_t,{className:"w-52 p-1",align:"start",onClick:P=>P.stopPropagation(),children:a.jsx(Zs,{children:a.jsx(Js,{children:a.jsx(fs,{children:r.map(P=>a.jsxs(mn,{value:P.name,onSelect:()=>b({status:P.key}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:P.color}}),a.jsx("span",{className:"text-xs flex-1",children:P.name}),e.status===P.key&&a.jsx(Xt,{className:"h-3.5 w-3.5 text-indigo-500"})]},P.key))})})})})]})}),a.jsx("div",{onClick:P=>P.stopPropagation(),children:a.jsxs(Pt,{open:g==="priority",onOpenChange:P=>v(P?"priority":null),children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(Eh,{priority:e.priority}),a.jsx("span",{className:"text-xs text-primary",children:an[e.priority]??e.priority})]})}),a.jsx(_t,{className:"w-44 p-1",align:"start",onClick:P=>P.stopPropagation(),children:a.jsx(Zs,{children:a.jsx(Js,{children:a.jsx(fs,{children:Object.entries(an).map(([P,D])=>a.jsxs(mn,{value:D,onSelect:()=>b({priority:P}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Eh,{priority:P}),a.jsx("span",{className:"text-xs flex-1",children:D}),e.priority===P&&a.jsx(Xt,{className:"h-3.5 w-3.5 text-indigo-500"})]},P))})})})})]})}),a.jsx("div",{onClick:P=>P.stopPropagation(),children:a.jsxs(Pt,{open:g==="sprint",onOpenChange:P=>v(P?"sprint":null),children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring max-w-full",children:[a.jsx(Kr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:L("text-xs truncate",_?"text-foreground":"text-muted-foreground"),children:(_==null?void 0:_.name)??"No sprint"})]})}),a.jsx(_t,{className:"w-56 p-1",align:"start",onClick:P=>P.stopPropagation(),children:a.jsx(Zs,{children:a.jsx(Js,{children:a.jsxs(fs,{children:[a.jsxs(mn,{value:"no-sprint",onSelect:()=>b({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Je,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs flex-1 text-muted-foreground",children:"No sprint"}),!e.sprint_id&&a.jsx(Xt,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(P=>P.status!=="completed").map(P=>a.jsxs(mn,{value:P.name,onSelect:()=>b({sprint_id:P.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Kr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-xs truncate",children:P.name}),(P.start_date||P.end_date)&&a.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[P.start_date?fe(new Date(P.start_date),"MMM d"):"—"," → ",P.end_date?fe(new Date(P.end_date),"MMM d"):"—"]})]}),e.sprint_id===P.id&&a.jsx(Xt,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},P.id))]})})})})]})}),a.jsx("div",{onClick:P=>P.stopPropagation(),children:a.jsxs(Pt,{open:g==="due",onOpenChange:P=>v(P?"due":null),children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-1.5 py-1 rounded hover:bg-accent transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:L("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?fe(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",onClick:P=>P.stopPropagation(),children:[a.jsx(yr,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:P=>b({due_date:P?fe(P,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>b({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx("div",{onClick:P=>P.stopPropagation(),children:a.jsx(cc,{value:e.assignee_ids??[],onChange:P=>N.mutate({assignee_ids:P}),users:k})}),a.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:P=>P.stopPropagation(),children:[!d&&p&&a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>p(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(On,{className:"h-3.5 w-3.5"})})}),a.jsx(Pn,{side:"top",children:"Add child issue"})]}),a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>x(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(Zp,{className:"h-3.5 w-3.5"})})}),a.jsx(Pn,{side:"top",children:"Open full page"})]})]})]}),y&&f.map(P=>a.jsx(rS,{issue:P,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,depth:u+1,children:(m==null?void 0:m[P.id])??[],childrenMap:m,onAddChild:p},P.id))]})}function Ty({taskList:e,issues:t,childrenMap:r,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,onAddIssue:f,onAddChild:m,onRenameList:p,onDeleteList:x}){const[g,v]=h.useState(!1),[y,w]=h.useState(!1),[N,j]=h.useState((e==null?void 0:e.name)??""),k=t.reduce((_,C)=>{var P;return _+(((P=r[C.id])==null?void 0:P.length)??0)},0),b=t.length+k,S=()=>{e&&N.trim()&&p&&p(e.id,N.trim()),w(!1)};return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border group/header",children:[a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>v(!g),className:"text-muted-foreground hover:text-foreground transition-colors",children:g?a.jsx(hr,{className:"h-3.5 w-3.5"}):a.jsx(ca,{className:"h-3.5 w-3.5"})})}),a.jsx(Pn,{side:"right",children:g?"Expand":"Collapse"})]}),e?y?a.jsx("input",{autoFocus:!0,value:N,onChange:_=>j(_.target.value),onBlur:S,onKeyDown:_=>{_.key==="Enter"&&S(),_.key==="Escape"&&(w(!1),j(e.name))},className:"text-xs font-semibold text-foreground bg-transparent border-b border-indigo-400 outline-none px-0.5"}):a.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.name}):a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"No List"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:b}),a.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[a.jsxs("button",{onClick:()=>f((e==null?void 0:e.id)??null),className:"flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors px-1.5 py-0.5 rounded hover:bg-muted",children:[a.jsx(ut,{className:"h-3 w-3"}),"Add issue"]}),e&&a.jsxs(Yr,{children:[a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Ea,{className:"h-3.5 w-3.5"})})})}),a.jsx(Pn,{side:"top",children:"More options"})]}),a.jsxs(Er,{align:"end",className:"w-36",children:[a.jsxs(st,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{w(!0),j(e.name)},children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),"Rename"]}),a.jsxs(st,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>x==null?void 0:x(e.id),children:[a.jsx(Or,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!g&&a.jsx("div",{className:"divide-y divide-border/60",children:t.length===0?a.jsx("div",{className:"px-14 py-3 text-xs text-muted-foreground/50 italic",children:"No issues in this list"}):t.map(_=>a.jsx(rS,{issue:_,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[_.id]??[],childrenMap:r,onAddChild:m},_.id))})]})}function G6(){var B,ae;const e=pt(),{workspace:t,projectKey:r}=zt(),[n,s]=h.useState(null),[i,o]=h.useState({open:!1}),[l,c]=h.useState(""),[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,x]=h.useState("all"),[g,v]=h.useState("all"),[y,w]=h.useState("all"),{data:N}=Ha(r??""),j=(N==null?void 0:N.id)??"",{data:k,isLoading:b}=Gl(j||void 0),{data:S}=Mo(j||void 0),{data:_}=Po(j||void 0),{data:C}=lc(j||void 0),P=K4(j),D=Y4(j),E=G4(j),I=S&&S.length>0?S:Object.entries(ui).map(([R,q],se)=>({id:R,project_id:j,key:R,name:q,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[R]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[R]??"backlog",position:se})),F=Object.fromEntries(I.map(R=>[R.key,R.name])),Q=Object.fromEntries(I.map(R=>[R.key,R.color])),Y=_??[];if(!r||!t)return null;const X=(k??[]).filter(R=>{const q=!f||R.title.toLowerCase().includes(f.toLowerCase())||R.identifier.toLowerCase().includes(f.toLowerCase()),se=p==="all"||R.status===p,V=g==="all"||R.priority===g,ie=y==="all"||(y==="none"?!R.sprint_id:R.sprint_id===y);return q&&se&&V&&ie}).sort((R,q)=>{const se=parseInt(R.identifier.split("-")[1]??"0",10),V=parseInt(q.identifier.split("-")[1]??"0",10);return se-V}),re=new Map((k??[]).map(R=>[R.id,R])),ee=new Set(X.map(R=>R.id)),T=new Set(ee);for(const R of X){let q=R.parent_id;for(;q&&!T.has(q);)T.add(q),q=((B=re.get(q))==null?void 0:B.parent_id)??null}const M={};for(const R of T){const q=re.get(R);q.parent_id&&T.has(q.parent_id)&&(M[q.parent_id]||(M[q.parent_id]=[]),M[q.parent_id].push(q))}for(const R of Object.values(M))R.sort((q,se)=>{const V=parseInt(q.identifier.split("-")[1]??"0",10),ie=parseInt(se.identifier.split("-")[1]??"0",10);return V-ie});const $=Array.from(T).map(R=>re.get(R)).filter(R=>!R.parent_id||!T.has(R.parent_id)).sort((R,q)=>{const se=parseInt(R.identifier.split("-")[1]??"0",10),V=parseInt(q.identifier.split("-")[1]??"0",10);return se-V}),K=X.length,z=new Set((C??[]).map(R=>R.id)),G={__none__:[]};for(const R of C??[])G[R.id]=[];for(const R of $){const q=R.task_list_id&&z.has(R.task_list_id)?R.task_list_id:"__none__";G[q].push(R)}function A(){l.trim()&&P.mutate({name:l.trim()},{onSuccess:()=>{c(""),u(!1),U.success("List created")},onError:()=>U.error("Failed to create list")})}function O(R,q){D.mutate({id:R,name:q},{onError:()=>U.error("Failed to rename list")})}function J(R){const q=C==null?void 0:C.find(se=>se.id===R);confirm(`Delete list "${q==null?void 0:q.name}"? Issues in this list will be moved to No List.`)&&E.mutate(R,{onSuccess:()=>U.success("List deleted"),onError:()=>U.error("Failed to delete list")})}return a.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[a.jsx(_r,{zone:"project.issues.before",props:{projectId:j}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs("div",{className:"flex items-center gap-2",children:[d?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Me,{autoFocus:!0,placeholder:"List name...",value:l,onChange:R=>c(R.target.value),onKeyDown:R=>{R.key==="Enter"&&A(),R.key==="Escape"&&(u(!1),c(""))},className:"h-8 text-xs w-36"}),a.jsx(ne,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:A,disabled:!l.trim()||P.isPending,children:"Add"}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),c("")},children:"Cancel"})]}):a.jsxs(ne,{size:"sm",variant:"outline",onClick:()=>u(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"New List"]}),a.jsxs(ne,{size:"sm",onClick:()=>o({open:!0}),children:[a.jsx(ut,{className:"h-4 w-4"}),"Create"]})]})}),a.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 border-b border-border md:flex-row md:items-center md:justify-between md:gap-3",children:[a.jsxs("div",{className:"flex items-center gap-2 md:overflow-x-auto md:scrollbar-none",children:[a.jsxs(qe,{value:y,onValueChange:w,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[140px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Sprint"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),Y.map(R=>a.jsx(ke,{value:R.id,className:"text-xs",children:R.name},R.id))]})]}),a.jsxs(qe,{value:p,onValueChange:x,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Status"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),I.map(({key:R,name:q})=>a.jsx(ke,{value:R,className:"text-xs",children:q},R))]})]}),a.jsxs(qe,{value:g,onValueChange:v,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Priority"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(an).map(([R,q])=>a.jsx(ke,{value:R,className:"text-xs",children:q},R))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(ki,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Me,{placeholder:"Search...",value:f,onChange:R=>m(R.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"hidden md:block overflow-x-auto",children:a.jsxs("div",{className:"min-w-[1025px]",children:[a.jsxs("div",{className:L("grid items-center py-2.5 border-b border-border",Ah),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[110px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"}),a.jsx("span",{className:"pr-6"})]}),b?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(R=>a.jsxs("div",{className:L("grid items-center px-6 py-3 gap-4",Ah),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"}),a.jsx("span",{})]},R))}):K===0&&(k??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first issue to start tracking work."}),a.jsxs(ne,{size:"sm",onClick:()=>o({open:!0}),children:[a.jsx(ut,{className:"h-4 w-4"}),"Create issue"]})]}):$.length===0&&(k??[]).length>0?a.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No issues match your filters."})}):a.jsx(Du,{delayDuration:200,children:a.jsxs("div",{className:"divide-y divide-border",children:[(C??[]).map(R=>a.jsx(Ty,{taskList:R,issues:G[R.id]??[],childrenMap:M,projectId:j,statuses:I,statusLabels:F,statusColorMap:Q,sprints:Y,workspace:t,projectKey:r,onOpen:s,onAddIssue:q=>o({open:!0,defaultTaskListId:q}),onAddChild:q=>o({open:!0,defaultParentId:q}),onRenameList:O,onDeleteList:J},R.id)),(((ae=G.__none__)==null?void 0:ae.length)>0||(C??[]).length===0)&&a.jsx(Ty,{taskList:null,issues:G.__none__??[],childrenMap:M,projectId:j,statuses:I,statusLabels:F,statusColorMap:Q,sprints:Y,workspace:t,projectKey:r,onOpen:s,onAddIssue:R=>o({open:!0,defaultTaskListId:R}),onAddChild:R=>o({open:!0,defaultParentId:R})})]})})]})}),a.jsx("div",{className:"md:hidden divide-y divide-border/60",children:b?[1,2,3,4].map(R=>a.jsx("div",{className:"flex items-start gap-3 px-4 py-3",children:a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-3 w-10 bg-muted rounded animate-pulse"}),a.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"})]}),a.jsx("div",{className:"h-3 w-32 bg-muted rounded animate-pulse"})]})},R)):$.length===0?null:$.map(R=>{const q=(Q==null?void 0:Q[R.status])??"#94a3b8",se=Y.find(V=>V.id===R.sprint_id);return a.jsx("div",{onClick:()=>e(`/${t}/projects/${r}/issues/${R.id}`),className:"flex items-start gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",children:a.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:R.identifier}),a.jsx("span",{className:"text-sm text-foreground truncate font-medium",children:R.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(Eh,{priority:R.priority}),a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:q}}),F[R.status]??R.status]}),se&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate max-w-[120px]",children:se.name}),R.due_date&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:fe(new Date(R.due_date),"MMM d")})]})]})},R.id)})}),!b&&K>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[K," issue",K!==1?"s":""]})})]}),a.jsx(_r,{zone:"project.issues.after",props:{projectId:j}}),a.jsx(tS,{issue:n,projectId:j,open:!!n,onClose:()=>s(null)}),a.jsx(of,{open:i.open,onClose:()=>o({open:!1}),projectId:j,defaultTaskListId:i.defaultTaskListId,defaultParentId:i.defaultParentId})]})}const Lr=20;function V6({member:e,onRequestRemove:t}){var l;const r=e.user,n=(r==null?void 0:r.first_name)??"",s=(r==null?void 0:r.last_name)??"",i=`${n} ${s}`.trim()||(r==null?void 0:r.email)||"Unknown",o=(n[0]??s[0]??((l=r==null?void 0:r.email)==null?void 0:l[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx(Rt,{className:"h-8 w-8 shrink-0",children:a.jsx($t,{className:"text-xs font-medium",children:o})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:i}),(r==null?void 0:r.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:r.email})]}),a.jsx(Dn,{className:L("shrink-0 text-[11px] border-0 w-20 justify-center",e.role==="manager"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400":"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400"),children:e.role}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})}function X6({teamEntry:e,onRemove:t}){const r=e.team;return a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsx("div",{className:"h-8 w-8 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(li,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:(r==null?void 0:r.name)??"Unknown team"}),r&&a.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[r.member_count," ",r.member_count===1?"member":"members"]})]}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})}function Q6(){const{projectKey:e}=zt(),{workspace:t}=Ie(),r=(t==null?void 0:t.id)??"",{data:n}=Ha(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=ua(s),{data:l}=Zl(r),{data:c}=zu(r),d=Q1(s),u=Z1(s),f=J1(s),m=eN(s),[p,x]=h.useState([]),[g,v]=h.useState([]),[y,w]=h.useState(0),[N,j]=h.useState(0),[k,b]=h.useState(null),S=new Set((i==null?void 0:i.members.map(F=>F.user_id))??[]),_=new Set((i==null?void 0:i.teams.map(F=>F.team_id))??[]),C=(l??[]).filter(F=>!S.has(F.user_id)),P=(c??[]).filter(F=>!_.has(F.id)),D=(i==null?void 0:i.members.length)??0,E=(i==null?void 0:i.teams.length)??0;function I(){k&&u.mutate(k.userId,{onSuccess:()=>{U.success("Access removed"),b(null)},onError:()=>U.error("Failed to remove")})}return a.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Access"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Manage who has access to this project."})]}),!o&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[D," member",D!==1?"s":""," • ",E," team",E!==1?"s":""]})]}),o?a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"})}),a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(F=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full"}),a.jsx(le,{className:"h-4 w-44"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-5 w-20"})]},F))}),a.jsx("div",{className:"px-6 py-2 border-y border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"})}),a.jsx("div",{className:"divide-y divide-border",children:[1].map(F=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-lg"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},F))})]}):a.jsxs("div",{children:[a.jsxs("div",{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["People",D>0&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:D})]}),C.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsx(Ma,{options:C.map(F=>{const Q=F.user,Y=(Q==null?void 0:Q.first_name)??"",X=(Q==null?void 0:Q.last_name)??"";return{value:F.user_id,label:`${Y} ${X}`.trim()||(Q==null?void 0:Q.email)||"Unknown"}}),selected:p,onSelectionChange:x,placeholder:"Add people…",className:"w-full sm:w-56"}),a.jsxs(ne,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:p.length===0||d.isPending,onClick:()=>d.mutate({userIds:p},{onSuccess:F=>{U.success(`${F.added} member${F.added===1?"":"s"} added`),x([])},onError:()=>U.error("Failed to grant access")}),children:[a.jsx(yo,{className:"h-3.5 w-3.5"}),p.length<=1?"Add":`Add ${p.length}`]})]})]}),D===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.members)??[]).slice(y*Lr,(y+1)*Lr).map(F=>a.jsx(V6,{member:F,onRequestRemove:(Q,Y)=>b({userId:Q,displayName:Y})},F.id))}),D>Lr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[y*Lr+1,"–",Math.min((y+1)*Lr,D)," of ",D]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>w(F=>F-1),disabled:y===0,children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[y+1," / ",Math.ceil(D/Lr)]}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>w(F=>F+1),disabled:(y+1)*Lr>=D,children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]})]})]}),a.jsxs("div",{className:"border-t border-border",children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Teams",E>0&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:E})]}),P.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsx(Ma,{options:P.map(F=>({value:F.id,label:F.name})),selected:g,onSelectionChange:v,placeholder:"Add teams…",className:"w-full sm:w-56"}),a.jsxs(ne,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:g.length===0||f.isPending,onClick:()=>f.mutate(g,{onSuccess:F=>{U.success(`${F.added} team${F.added===1?"":"s"} added`),v([])},onError:()=>U.error("Failed to add teams")}),children:[a.jsx(li,{className:"h-3.5 w-3.5"}),g.length<=1?"Add":`Add ${g.length}`]})]})]}),E===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:((i==null?void 0:i.teams)??[]).slice(N*Lr,(N+1)*Lr).map(F=>a.jsx(X6,{teamEntry:F,onRemove:Q=>m.mutate(Q,{onSuccess:()=>U.success("Team access removed"),onError:()=>U.error("Failed to remove team")})},F.id))}),E>Lr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[N*Lr+1,"–",Math.min((N+1)*Lr,E)," of ",E]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>j(F=>F-1),disabled:N===0,children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[N+1," / ",Math.ceil(E/Lr)]}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>j(F=>F+1),disabled:(N+1)*Lr>=E,children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]})]})]}),D===0&&E===0&&C.length===0&&P.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center border-t border-border",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(li,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No access entries yet"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Add workspace people or teams first to grant project access."})]})]})]}),a.jsx(ei,{open:!!k,onOpenChange:F=>{F||b(null)},children:a.jsxs(ms,{className:"sm:max-w-md",children:[a.jsxs(hs,{children:[a.jsx(xs,{children:"Remove member access?"}),a.jsx(gs,{children:k?`${k.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),a.jsxs(ps,{children:[a.jsx(ys,{disabled:u.isPending,children:"Cancel"}),a.jsx(vs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:F=>{F.preventDefault(),I()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function Z6(e,t){let r=0,n=e;for(;n!=null&&n.parent_id&&(r++,n=t.find(s=>s.id===n.parent_id),!!n););return r}function Iy(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function ya({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const J6={backlog:a.jsx(Pr,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(Pr,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Rn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(Ni,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(aa,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Vp,{className:"h-3 w-3 text-zinc-400"})},ez={urgent:a.jsx(da,{className:"h-3 w-3 text-red-500"}),high:a.jsx(ji,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(qa,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(wi,{className:"h-3 w-3 text-blue-400"})},tz={bug:a.jsx(_1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(z1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx($u,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Yp,{className:"h-3 w-3 text-zinc-500"})};function Lm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(qe,{value:e,onValueChange:t,children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(O1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Ue,{children:Object.entries(r).map(([i,o])=>a.jsx(ke,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function rz(){const{workspace:e,projectKey:t,issueId:r}=zt(),n=pt(),[s,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(!1),{data:m}=Ha(t??""),p=(m==null?void 0:m.id)??"",{data:x,isLoading:g}=N1(r??""),v=Tu(r??"",p),{data:y}=ua(p),w=h.useMemo(()=>y?y.members.filter(M=>M.user).map(M=>M.user):void 0,[y]),N=h.useMemo(()=>w==null?void 0:w.map(M=>({id:M.id,label:`${M.first_name??""} ${M.last_name??""}`.trim()||M.email,email:M.email})),[w]),{data:j}=Mo(p||void 0),{data:k}=Po(p||void 0),{data:b}=lc(p||void 0),{data:S}=Gl(p||void 0),_=(k??[]).filter(M=>M.status!=="completed"),{data:C}=VN(),P=(C==null?void 0:C.maxChildIssueDepth)??1,E=(x?Z6(x,S??[]):0)<P,I=x!=null&&x.parent_id?S==null?void 0:S.find(M=>M.id===x.parent_id):null,F=(S==null?void 0:S.filter(M=>M.parent_id===r))??[],Q=x!=null&&x.task_list_id?b==null?void 0:b.find(M=>M.id===x.task_list_id):null,Y=j&&j.length>0?Object.fromEntries(j.map(M=>[M.key,M.name])):ui,X=j&&j.length>0?Object.fromEntries(j.map(M=>[M.key,M.category==="completed"?a.jsx(aa,{className:"h-3 w-3",style:{color:M.color}}):M.category==="started"?a.jsx(Rn,{className:"h-3 w-3",style:{color:M.color}}):a.jsx(Pr,{className:"h-3 w-3",style:{color:M.color}})])):J6;if(h.useEffect(()=>{x&&(l(x.title),d(x.description??"")),i(!1)},[x==null?void 0:x.id]),!t||!r)return null;const re=()=>{if(!o.trim())return;const M=[];new DOMParser().parseFromString(c,"text/html").querySelectorAll("[data-type='mention']").forEach(z=>{const G=z.getAttribute("data-id");G&&!M.includes(G)&&M.push(G)}),v.mutate({title:o.trim(),description:c.trim()||void 0,mentioned_user_ids:M.length>0?M:void 0},{onSuccess:()=>{i(!1),U.success("Issue updated")},onError:()=>U.error("Failed to update issue")})},ee=()=>{x&&(l(x.title),d(x.description??"")),i(!1)},T=(M,$)=>{v.mutate(M,{onSuccess:()=>U.success(`${$} updated`),onError:()=>U.error(`Failed to update ${$.toLowerCase()}`)})};return g||!x?a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsx("div",{className:"sticky top-0 z-10 h-[57px] bg-white dark:bg-card border-b border-border"}),a.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 space-y-4 shadow-sm",children:[a.jsx(le,{className:"h-7 w-3/4"}),a.jsx(le,{className:"h-32 w-full"})]}),a.jsx(le,{className:"h-24 w-full rounded-xl"}),a.jsx(le,{className:"h-48 w-full rounded-xl"})]}),a.jsx(le,{className:"h-[280px] w-full rounded-xl"})]})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>n(`/${e}/projects/${t}/issues`),children:[a.jsx(na,{className:"h-3.5 w-3.5"}),(m==null?void 0:m.name)??"Issues"]}),a.jsx("span",{className:"text-border",children:"/"}),a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x.identifier}),a.jsx(Dn,{variant:"muted",className:"text-[10px] ml-1",children:Da[x.type]??x.type})]}),a.jsx("div",{className:"flex items-center gap-2",children:s?a.jsxs(a.Fragment,{children:[a.jsx(ne,{variant:"ghost",size:"sm",onClick:ee,children:"Discard"}),a.jsx(ne,{size:"sm",onClick:re,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),a.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(_r,{zone:"issue.details.before",props:{issue:x}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:s?a.jsx("input",{autoFocus:!0,value:o,onChange:M=>l(M.target.value),onKeyDown:M=>{M.key==="Enter"&&M.preventDefault()},className:L("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")}):a.jsx("h1",{className:"text-xl font-semibold text-foreground leading-snug",children:x.title})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),s?a.jsx(rf,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]",users:N}):x.description?a.jsx("div",{className:"border-t border-border/50",children:a.jsx(Mx,{html:x.description,className:"px-5 py-4"})}):a.jsx("div",{className:"border-t border-border/50 px-6 py-4",children:a.jsx("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})})]}),E&&a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsxs("div",{className:"px-5 py-3 border-b border-border/60 flex items-center justify-between",children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Child Issues"}),a.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),F.length===0?a.jsx("div",{className:"px-5 py-4 text-xs text-muted-foreground/50 italic",children:"No child issues yet"}):a.jsx("div",{className:"px-5 py-2 divide-y divide-border/40",children:F.map(M=>a.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[a.jsx(On,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${M.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:M.identifier}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${M.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:M.title})]},M.id))})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:a.jsx(Sk,{issueId:r,projectId:p,scrollMarginTop:57})}),a.jsx(_r,{zone:"issue.details.after",props:{issue:x}})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(_r,{zone:"issue.details.sidebar",props:{issue:x}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(ya,{label:"Status",children:a.jsx(Lm,{value:x.status,onValueChange:M=>T({status:M},"Status"),options:Y,icons:X})}),a.jsx(ya,{label:"Priority",children:a.jsx(Lm,{value:x.priority,onValueChange:M=>T({priority:M},"Priority"),options:an,icons:ez})}),a.jsx(ya,{label:"Type",children:a.jsx(Lm,{value:x.type,onValueChange:M=>T({type:M},"Type"),options:Da,icons:tz})}),a.jsx(ya,{label:"Assignees",children:a.jsx(cc,{value:x.assignee_ids??[],onChange:M=>T({assignee_ids:M},"Assignees"),disabled:v.isPending,users:w})}),a.jsx(ya,{label:"Sprint",children:a.jsxs(qe,{value:x.sprint_id??"none",onValueChange:M=>T({sprint_id:M==="none"?null:M},"Sprint"),children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Kr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),x.sprint_id?(()=>{const M=_.find(K=>K.id===x.sprint_id)??(k==null?void 0:k.find(K=>K.id===x.sprint_id));if(!M)return a.jsxs("span",{className:"truncate",children:[x.sprint_id.slice(0,8),"…"]});const $=Iy(M);return a.jsxs("span",{className:"truncate",children:[M.name,$&&a.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",$]})]})})():a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),_.map(M=>{const $=Iy(M);return a.jsx(ke,{value:M.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:M.name}),$&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:$})]})},M.id)})]})]})}),(b??[]).length>0&&a.jsx(ya,{label:"List",children:a.jsxs(qe,{value:x.task_list_id??"none",onValueChange:M=>T({task_list_id:M==="none"?null:M},"List"),children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Jp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:Q?"truncate":"text-muted-foreground",children:(Q==null?void 0:Q.name)??"No list"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(b??[]).map(M=>a.jsx(ke,{value:M.id,className:"text-xs",children:M.name},M.id))]})]})}),a.jsx(ya,{label:"Start Date",children:a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:x.start_date?"text-foreground":"text-muted-foreground",children:x.start_date?fe(new Date(x.start_date),"MMM d, yyyy"):"No start date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",children:[a.jsx(yr,{mode:"single",selected:x.start_date?new Date(x.start_date):void 0,onSelect:M=>T({start_date:M?fe(M,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),x.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>T({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx(ya,{label:"Due Date",children:a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:x.due_date?"text-foreground":"text-muted-foreground",children:x.due_date?fe(new Date(x.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(_t,{className:"w-auto p-0",align:"start",children:[a.jsx(yr,{mode:"single",selected:x.due_date?new Date(x.due_date):void 0,onSelect:M=>T({due_date:M?fe(M,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),x.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>T({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(Je,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),I&&a.jsx(ya,{label:"Parent",children:a.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${I.id}`),className:"flex items-center gap-1.5 text-xs hover:text-foreground transition-colors text-left w-full min-w-0",children:[a.jsx(Gp,{className:"h-3 w-3 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:I.identifier}),a.jsx("span",{className:"text-foreground truncate",children:I.title})]})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Details"})}),a.jsxs("div",{className:"px-4 pt-3 pb-4 space-y-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Created"}),a.jsx("span",{className:"text-foreground",children:fe(new Date(x.created_at),"MMM d, yyyy")})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:"text-muted-foreground",children:"Updated"}),a.jsx("span",{className:"text-foreground",children:fe(new Date(x.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),a.jsx(of,{open:u,onClose:()=>f(!1),projectId:p,defaultParentId:r,defaultTaskListId:x.task_list_id})]})}function ba({label:e,children:t}){return a.jsxs("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-border/60 last:border-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground shrink-0 w-20",children:e}),a.jsx("div",{className:"flex-1 min-w-0",children:t})]})}const nz={backlog:a.jsx(Pr,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(Pr,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Rn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(Ni,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(aa,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Vp,{className:"h-3 w-3 text-zinc-400"})},az={urgent:a.jsx(da,{className:"h-3 w-3 text-red-500"}),high:a.jsx(ji,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(qa,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(wi,{className:"h-3 w-3 text-blue-400"})},sz={bug:a.jsx(_1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(z1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx($u,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx(Yp,{className:"h-3 w-3 text-zinc-500"})};function Fm({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(qe,{value:e,onValueChange:t,children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[n[e]??a.jsx(O1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Ue,{children:Object.entries(r).map(([i,o])=>a.jsx(ke,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function iz(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?fe(new Date(e.start_date),"MMM d"):"—",r=e.end_date?fe(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function oz(){const{workspace:e,projectKey:t}=zt(),r=pt(),{workspace:n}=Ie(),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("backlog"),[u,f]=h.useState("medium"),[m,p]=h.useState("task"),[x,g]=h.useState([]),[v,y]=h.useState(""),[w,N]=h.useState(""),[j,k]=h.useState(void 0),[b,S]=h.useState(void 0),[_,C]=h.useState(!1),[P,D]=h.useState("weekly"),[E,I]=h.useState(void 0),{data:F}=Ha(t??""),Q=(F==null?void 0:F.id)??"",Y=k1(),{data:X}=ua(Q),re=h.useMemo(()=>X?X.members.filter(O=>O.user).map(O=>O.user):void 0,[X]),ee=h.useMemo(()=>re==null?void 0:re.map(O=>({id:O.id,label:`${O.first_name??""} ${O.last_name??""}`.trim()||O.email,email:O.email})),[re]),{data:T}=Mo(Q||void 0),{data:M}=Po(Q||void 0),{data:$}=lc(Q||void 0),K=(M??[]).filter(O=>O.status!=="completed"),z=T&&T.length>0?Object.fromEntries(T.map(O=>[O.key,O.name])):ui,G=T&&T.length>0?Object.fromEntries(T.map(O=>[O.key,O.category==="completed"?a.jsx(aa,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?a.jsx(Rn,{className:"h-3 w-3",style:{color:O.color}}):a.jsx(Pr,{className:"h-3 w-3",style:{color:O.color}})])):nz;if(!t||!Q)return null;const A=()=>{if(!s.trim()){U.error("Title is required");return}const O=[];o&&new DOMParser().parseFromString(o,"text/html").querySelectorAll("[data-type='mention']").forEach(ae=>{const R=ae.getAttribute("data-id");R&&!O.includes(R)&&O.push(R)}),Y.mutate({title:s.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:Q,workspace_id:n.id,assignee_ids:x.length>0?x:void 0,sprint_id:v||null,task_list_id:w||null,start_date:j?fe(j,"yyyy-MM-dd"):null,due_date:b?fe(b,"yyyy-MM-dd"):null,recurrence_frequency:_?P:void 0,recurrence_end_date:_&&E?fe(E,"yyyy-MM-dd"):void 0,mentioned_user_ids:O.length>0?O:void 0},{onSuccess:J=>{U.success("Issue created"),r(`/${e}/projects/${t}/issues/${J.issue.id}`,{replace:!0})},onError:J=>U.error(J.message??"Failed to create issue")})};return a.jsxs("div",{className:"min-h-full bg-[hsl(60_5%_96%)] dark:bg-background",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 h-[57px] bg-white dark:bg-card border-b border-border",children:[a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-7 gap-1 text-muted-foreground hover:text-foreground px-2",onClick:()=>r(`/${e}/projects/${t}/issues`),children:[a.jsx(na,{className:"h-3.5 w-3.5"}),(F==null?void 0:F.name)??"Issues"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),a.jsx(ne,{size:"sm",onClick:A,disabled:!s.trim()||Y.isPending,className:"px-4",children:Y.isPending?"Creating…":"Create issue"})]})]}),a.jsx("div",{className:"px-2 py-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"flex flex-col gap-4 md:grid md:grid-cols-[1fr_256px] md:gap-5 md:items-start",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:[a.jsx("div",{className:"px-6 pt-6 pb-3",children:a.jsx("input",{autoFocus:!0,value:s,onChange:O=>i(O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()},placeholder:"Issue title…",className:L("w-full text-xl font-semibold leading-snug text-foreground","bg-transparent border-0 outline-none resize-none","placeholder:text-muted-foreground/40")})}),a.jsx("div",{className:"flex items-center gap-2 px-6 pb-2",children:a.jsx("span",{className:"text-[11px] font-medium text-muted-foreground/60 uppercase tracking-widest",children:"Description"})}),a.jsx(rf,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]",users:ee})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[a.jsx("div",{className:"px-4 py-3 border-b border-border/60",children:a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Properties"})}),a.jsxs("div",{className:"px-4 py-1",children:[a.jsx(ba,{label:"Status",children:a.jsx(Fm,{value:c,onValueChange:d,options:z,icons:G})}),a.jsx(ba,{label:"Priority",children:a.jsx(Fm,{value:u,onValueChange:f,options:an,icons:az})}),a.jsx(ba,{label:"Type",children:a.jsx(Fm,{value:m,onValueChange:p,options:Da,icons:sz})}),a.jsx(ba,{label:"Assignees",children:a.jsx(cc,{value:x,onChange:g,users:re})}),K.length>0&&a.jsx(ba,{label:"Sprint",children:a.jsxs(qe,{value:v||"none",onValueChange:O=>y(O==="none"?"":O),children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Kr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Xe,{placeholder:"No sprint"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),K.map(O=>{const J=iz(O);return a.jsx(ke,{value:O.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:O.name}),J&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:J})]})},O.id)})]})]})}),($??[]).length>0&&a.jsx(ba,{label:"List",children:a.jsxs(qe,{value:w||"none",onValueChange:O=>N(O==="none"?"":O),children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx(Jp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Xe,{placeholder:"No list"})]})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),($??[]).map(O=>a.jsx(ke,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),a.jsx(ba,{label:"Start Date",children:a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:j?"text-foreground":"text-muted-foreground",children:j?fe(j,"MMM d, yyyy"):"No start date"}),j&&a.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),k(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3 w-3"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:j,onSelect:k,initialFocus:!0})})]})}),a.jsx(ba,{label:"Due Date",children:a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:b?"text-foreground":"text-muted-foreground",children:b?fe(b,"MMM d, yyyy"):"No due date"}),b&&a.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),S(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3 w-3"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:b,onSelect:S,initialFocus:!0})})]})}),a.jsx(ba,{label:"Recurring",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2 pl-1",children:[a.jsx(Oo,{id:"new-recurring",checked:_,onCheckedChange:C}),a.jsxs(mt,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[a.jsx(Qi,{className:"h-3 w-3 text-muted-foreground"}),_?P.charAt(0).toUpperCase()+P.slice(1):"Off"]})]}),_&&a.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs(qe,{value:P,onValueChange:O=>D(O),children:[a.jsx(We,{className:"h-7 text-xs border-0 bg-transparent px-0 gap-1.5 focus:ring-0 hover:bg-accent rounded-md pl-1",children:a.jsx(Xe,{})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(ke,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs("button",{type:"button",className:"flex items-center gap-1.5 h-7 px-1 rounded text-xs bg-transparent hover:bg-accent transition-colors focus:outline-none w-full text-left",children:[a.jsx(Wt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:E?"text-foreground":"text-muted-foreground",children:E?fe(E,"MMM d, yyyy"):"No end date"}),E&&a.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),I(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(Je,{className:"h-3 w-3"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:E,onSelect:I,initialFocus:!0})})]})]})]})})]}),a.jsx("div",{className:"px-4 pt-2 pb-3 mt-1 border-t border-border/60",children:a.jsxs("p",{className:"text-[11px] text-muted-foreground/50 leading-relaxed",children:["Press ",a.jsx("kbd",{className:"px-1 py-0.5 rounded border border-border bg-muted font-mono text-[10px]",children:"⌘ Enter"})," to submit"]})})]})]})})]})}const nS={all:["my-tasks"],filtered:e=>[...nS.all,e??{}]};function lz(e){return Le({queryKey:nS.filtered(e),queryFn:()=>{var r,n,s,i;const t=new URLSearchParams;return t.set("limit","200"),(r=e==null?void 0:e.workspace_id)!=null&&r.length&&t.set("workspace_id",e.workspace_id.join(",")),(n=e==null?void 0:e.priority)!=null&&n.length&&t.set("priority",e.priority.join(",")),(s=e==null?void 0:e.type)!=null&&s.length&&t.set("type",e.type.join(",")),(i=e==null?void 0:e.category)!=null&&i.length&&t.set("category",e.category.join(",")),oe.get(`/admin/my/tasks?${t}`)},select:t=>t.issues})}const cz=({priority:e})=>{const t=L("h-3 w-3 shrink-0",oc[e]);switch(e){case"urgent":return a.jsx(da,{className:t});case"high":return a.jsx(ji,{className:t});case"medium":return a.jsx(qa,{className:t});case"low":return a.jsx(wi,{className:t});default:return a.jsx(Pr,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function dz({issue:e,onClick:t}){var n,s;const{data:r}=_s();return a.jsxs("div",{onClick:t,className:L("bg-white dark:bg-card border border-border rounded-lg px-3 py-2.5 cursor-pointer select-none","hover:border-zinc-300 dark:hover:border-zinc-600 transition-colors"),children:[a.jsx("p",{className:"text-[13px] text-foreground leading-snug line-clamp-2 mb-2",children:e.title}),a.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground mb-2",children:[a.jsx(Wt,{className:"h-2.5 w-2.5 shrink-0"}),a.jsx("span",{children:e.start_date?fe(new Date(e.start_date),"MMM d"):"?"}),a.jsx("span",{children:"→"}),a.jsx("span",{children:e.due_date?fe(new Date(e.due_date),"MMM d"):"?"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("span",{className:"text-[11px] font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded shrink-0",children:e.identifier}),e._project&&a.jsx("span",{className:"text-[10px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded shrink-0",children:e._project.identifier}),a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e._status.color}}),a.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:e._status.name})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[(e.assignee_ids??[]).length>0&&a.jsxs("div",{className:"flex -space-x-1",children:[(e.assignee_ids??[]).slice(0,2).map(i=>{const o=r==null?void 0:r.get(i);return a.jsx(Rt,{className:"h-4 w-4 border border-background",children:a.jsx($t,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(o==null?void 0:o.initials)??"?"})},i)}),(((n=e.assignee_ids)==null?void 0:n.length)??0)>2&&a.jsxs("span",{className:"text-[9px] text-muted-foreground ml-1.5 self-center",children:["+",(((s=e.assignee_ids)==null?void 0:s.length)??0)-2]})]}),a.jsx(cz,{priority:e.priority})]})]})]})}const Ry=[{key:"backlog",label:"Backlog",color:"#94a3b8"},{key:"unstarted",label:"Unstarted",color:"#64748b"},{key:"started",label:"Started",color:"#6366f1"},{key:"completed",label:"Completed",color:"#10b981"},{key:"cancelled",label:"Cancelled",color:"#9ca3af"}];function $y(e,t){const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),s=parseInt(r.substring(2,4),16),i=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(s)||isNaN(i)?`rgba(148,163,184,${t})`:`rgba(${n},${s},${i},${t})`}const uz=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(aa,{className:r,style:n});case"started":return a.jsx(Rn,{className:r,style:n});default:return a.jsx(Pr,{className:r,style:n})}};function fz({issues:e,onIssueClick:t}){const r=h.useMemo(()=>{const n={};for(const s of Ry)n[s.key]=[];for(const s of e){const i=s._status.category;n[i]?n[i].push(s):n.backlog.push(s)}return n},[e]);return a.jsx("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:Ry.map(n=>{const s=r[n.key],i=$y(n.color,.08);return a.jsxs("div",{className:"flex flex-col min-w-[260px] max-w-[280px] w-full",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[a.jsx(uz,{category:n.key,color:n.color}),a.jsx("span",{className:"text-xs font-medium text-foreground",children:n.label}),a.jsx("span",{className:"ml-1 text-[11px] font-medium rounded-full px-1.5 py-0.5 tabular-nums min-w-[18px] text-center",style:{backgroundColor:$y(n.color,.12),color:n.color},children:s.length})]}),a.jsxs("div",{className:"flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors",style:{backgroundColor:i},children:[s.map(o=>a.jsx(dz,{issue:o,onClick:()=>t==null?void 0:t(o)},o.id)),s.length===0&&a.jsx("div",{className:"flex-1 flex items-center justify-center min-h-[120px]",children:a.jsx("p",{className:"text-xs text-muted-foreground/40",children:"No tasks"})})]})]},n.key)})})}const aS=({priority:e,className:t})=>{const r=L("h-3.5 w-3.5 shrink-0",oc[e],t);switch(e){case"urgent":return a.jsx(da,{className:r});case"high":return a.jsx(ji,{className:r});case"medium":return a.jsx(qa,{className:r});case"low":return a.jsx(wi,{className:r});default:return a.jsx(Pr,{className:L("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},mz={backlog:"Backlog",unstarted:"Unstarted",started:"Started",completed:"Completed",cancelled:"Cancelled"},Dh="grid-cols-[70px_1fr_100px_140px_100px_110px_32px]";function hz({issue:e,workspace:t,onNavigate:r}){var i,o;const n=pt(),s=((i=e._project)==null?void 0:i.identifier)??"";return a.jsxs("div",{onClick:()=>r(e),className:L(`group grid ${Dh} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors"),children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate pl-6",children:e.identifier}),a.jsx("span",{className:"text-sm text-foreground truncate pr-3",children:e.title}),a.jsx("span",{className:"text-[11px] font-medium text-zinc-500 dark:text-zinc-400 bg-zinc-100 dark:bg-zinc-800 px-1.5 py-0.5 rounded truncate w-fit",children:((o=e._project)==null?void 0:o.identifier)??"—"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:e._status.color}}),a.jsx("span",{className:"text-xs text-primary truncate",children:e._status.name})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(aS,{priority:e.priority}),a.jsx("span",{className:"text-xs text-primary",children:an[e.priority]??e.priority})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:L("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?fe(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),a.jsx("div",{className:"pr-6",onClick:l=>l.stopPropagation(),children:a.jsx("button",{onClick:()=>n(`/${t}/projects/${s}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(Zp,{className:"h-3.5 w-3.5"})})})]})}function pz(){const e=pt(),{workspace:t}=zt(),r=t??"",{workspace:n}=Ie(),{data:s}=bo(),[i,o]=h.useState(()=>localStorage.getItem("meridian_my_tasks_view")??"list"),[l,c]=h.useState(""),[d,u]=h.useState([]),[f,m]=h.useState("all"),[p,x]=h.useState("all"),[g,v]=h.useState("all");h.useEffect(()=>{n!=null&&n.id&&d.length===0&&u([n.id])},[n==null?void 0:n.id]);const y=h.useMemo(()=>(s??[]).map(C=>({value:C.id,label:C.name})),[s]),w=h.useMemo(()=>{const C={};return d.length>0&&(C.workspace_id=d),f!=="all"&&(C.priority=[f]),p!=="all"&&(C.type=[p]),g!=="all"&&(C.category=[g]),C},[d,f,p,g]),{data:N,isLoading:j}=lz(w),k=C=>{o(C),localStorage.setItem("meridian_my_tasks_view",C)},b=h.useMemo(()=>{if(!N)return[];if(!l)return N;const C=l.toLowerCase();return N.filter(P=>{var D,E;return P.title.toLowerCase().includes(C)||P.identifier.toLowerCase().includes(C)||(((D=P._project)==null?void 0:D.identifier)??"").toLowerCase().includes(C)||(((E=P._project)==null?void 0:E.name)??"").toLowerCase().includes(C)})},[N,l]),S=C=>{var D;const P=(D=C._project)==null?void 0:D.identifier;P&&e(`/${r}/projects/${P}/issues/${C.id}`)},_=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"My Tasks"}),a.jsxs("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-0.5",children:[a.jsxs("button",{onClick:()=>k("list"),className:L("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",i==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[a.jsx(ex,{className:"h-3.5 w-3.5"}),"List"]}),a.jsxs("button",{onClick:()=>k("board"),className:L("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-colors",i==="board"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[a.jsx(I1,{className:"h-3.5 w-3.5"}),"Board"]})]})]}),a.jsxs("div",{className:"flex flex-col gap-2 px-4 md:px-6 py-3 border-b border-border md:flex-row md:items-center md:justify-between md:gap-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2 md:overflow-x-auto md:scrollbar-none",children:[a.jsx(Ma,{options:y,selected:d,onSelectionChange:u,placeholder:"All workspaces",className:"md:w-[160px]"}),a.jsxs(qe,{value:f,onValueChange:m,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Priority"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(an).map(([C,P])=>a.jsx(ke,{value:C,className:"text-xs",children:P},C))]})]}),a.jsxs(qe,{value:p,onValueChange:x,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Type"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All types"}),Object.entries(Da).map(([C,P])=>a.jsx(ke,{value:C,className:"text-xs",children:P},C))]})]}),a.jsxs(qe,{value:g,onValueChange:v,children:[a.jsx(We,{className:"h-8 text-xs flex-1 md:flex-none md:w-[130px] md:shrink-0 bg-transparent",children:a.jsx(Xe,{placeholder:"Category"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All categories"}),Object.entries(mz).map(([C,P])=>a.jsx(ke,{value:C,className:"text-xs",children:P},C))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(ki,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Me,{placeholder:"Search tasks...",value:l,onChange:C=>c(C.target.value),className:"pl-8 h-8 w-full md:w-[200px] text-xs bg-transparent"})]})]})]});return i==="board"?a.jsx("div",{className:"flex flex-col h-full gap-0",children:a.jsxs("div",{className:"flex flex-col flex-1 min-h-0 bg-white dark:bg-card",children:[_,a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:j?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4,5].map(C=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(le,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(le,{className:"h-[82px] w-full rounded-lg"}),a.jsx(le,{className:"h-[82px] w-full rounded-lg"})]})]},C))}):a.jsx(fz,{issues:b,onIssueClick:S})})]})}):a.jsx("div",{className:"p-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[_,a.jsx("div",{className:"hidden md:block overflow-x-auto",children:a.jsxs("div",{className:"min-w-[800px]",children:[a.jsxs("div",{className:L("grid items-center py-2.5 border-b border-border",Dh),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Project"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"pr-6"})]}),j?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(C=>a.jsxs("div",{className:L("grid items-center px-6 py-3 gap-4",Dh),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-16"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx("span",{})]},C))}):b.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("p",{className:"text-sm font-medium mb-1",children:(N??[]).length===0?"No tasks assigned to you":"No tasks match your filters"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:(N??[]).length===0?"Issues assigned to you across all projects will appear here.":"Try adjusting your search or filters."})]}):a.jsx("div",{className:"divide-y divide-border/60",children:b.map(C=>a.jsx(hz,{issue:C,workspace:r,onNavigate:S},C.id))})]})}),a.jsx("div",{className:"md:hidden divide-y divide-border/60",children:j?[1,2,3,4].map(C=>a.jsx("div",{className:"flex items-start gap-3 px-4 py-3",children:a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx("div",{className:"h-4 w-48 bg-muted rounded animate-pulse"}),a.jsx("div",{className:"h-3 w-32 bg-muted rounded animate-pulse"})]})},C)):b.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center py-12 text-center px-4",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"No tasks found"})}):b.map(C=>a.jsx("div",{onClick:()=>S(C),className:"flex items-start gap-3 px-4 py-3 hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",children:a.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-[10px] font-mono text-muted-foreground shrink-0",children:C.identifier}),a.jsx("span",{className:"text-sm text-foreground truncate font-medium",children:C.title})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(aS,{priority:C.priority}),a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground",children:[a.jsx("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:C._status.color}}),C._status.name]}),C._project&&a.jsx("span",{className:"text-[10px] font-medium text-zinc-500 bg-zinc-100 dark:bg-zinc-800 px-1 py-0.5 rounded",children:C._project.identifier}),C.due_date&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:fe(new Date(C.due_date),"MMM d")})]})]})},C.id))}),!j&&b.length>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[b.length," task",b.length!==1?"s":""]})})]})})}const xz={issue:{icon:ta,label:"Issue"},project:{icon:Kr,label:"Project"},comment:{icon:$1,label:"Comment"},sprint:{icon:da,label:"Sprint"}};function zy(e){const t=new Date(e);return i4(t)?JI(t,{addSuffix:!0}):o4(t)?`Yesterday ${fe(t,"h:mm a")}`:fe(t,"MMM d, yyyy")}function gz(){const{workspace:e}=zt(),t=pt(),{data:r,isLoading:n}=VD(),{data:s=[]}=jo(),i=XD(),o=QD(),l=(r==null?void 0:r.filter(u=>!u.read).length)??0,c=Object.fromEntries(s.map(u=>[u.id,u]));function d(u){var f;if(u.entity_type==="issue"&&((f=u.metadata)!=null&&f.project_id)){const m=c[u.metadata.project_id];if(m)return`/${e}/projects/${m.identifier}/issues/${u.entity_id}`}if(u.entity_type==="project"){const m=c[u.entity_id];if(m)return`/${e}/projects/${m.identifier}/board`}return null}return a.jsx("div",{className:"p-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Notifications"}),l>0&&a.jsxs(ne,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>o.mutate(void 0,{onSuccess:()=>U.success("All marked as read"),onError:()=>U.error("Failed")}),disabled:o.isPending,children:[a.jsx(Kv,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),a.jsxs("div",{className:"hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-2.5 border-b border-border",children:[a.jsx("span",{}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Type"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Message"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Time"}),a.jsx("span",{})]}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(u=>a.jsxs("div",{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[a.jsx("div",{}),a.jsx(le,{className:"h-5 w-20 rounded-full"}),a.jsx(le,{className:"h-4 w-3/4"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx("div",{})]}),a.jsxs("div",{className:"md:hidden flex items-start gap-3 px-4 py-3",children:[a.jsx(le,{className:"h-4 w-4 rounded-full mt-1 shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(le,{className:"h-4 w-24 rounded-full"}),a.jsx(le,{className:"h-4 w-full"})]})]})]},u))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(u=>{const f=xz[u.entity_type]??{icon:si,label:u.entity_type},m=f.icon,p=d(u),x=()=>{p&&(u.read||i.mutate(u.id),t(p))};return a.jsxs("div",{children:[a.jsxs("div",{className:L("hidden md:grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",p&&"cursor-pointer"),onClick:x,children:[a.jsx("div",{className:"flex items-center justify-center",children:!u.read&&a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500 shrink-0"})}),a.jsx("div",{children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full",children:[a.jsx(m,{className:"h-3 w-3"}),f.label]})}),a.jsx("p",{className:L("text-sm truncate",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message}),a.jsx("span",{className:"text-xs text-muted-foreground",children:zy(u.created_at)}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>i.mutate(u.id,{onError:()=>U.error("Failed")}),children:"Mark read"})})]}),a.jsxs("div",{className:L("md:hidden flex items-start gap-3 px-4 py-3 transition-colors",!u.read&&"bg-[#eff6ff] dark:bg-indigo-950/20","hover:bg-[#f9fafb] dark:hover:bg-muted/30",p&&"cursor-pointer"),onClick:x,children:[a.jsx("div",{className:"mt-1 shrink-0",children:u.read?a.jsx("div",{className:"h-1.5 w-1.5"}):a.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-indigo-500"})}),a.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-2 py-0.5 rounded-full shrink-0",children:[a.jsx(m,{className:"h-3 w-3"}),f.label]}),a.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:zy(u.created_at)})]}),a.jsx("p",{className:L("text-sm",u.read?"text-muted-foreground":"font-medium text-foreground"),children:u.message})]}),!u.read&&a.jsx("div",{onClick:g=>g.stopPropagation(),className:"shrink-0",children:a.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i.mutate(u.id,{onError:()=>U.error("Failed")}),children:a.jsx(Kv,{className:"h-3.5 w-3.5"})})})]})]},u.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(si,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No notifications"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"You're all caught up."})]}),!n&&!!(r!=null&&r.length)&&a.jsx("div",{className:"px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[r.length," notification",r.length!==1?"s":"",l>0?` · ${l} unread`:""]})})]})})}function vz({open:e,onClose:t,projectId:r}){const[n,s]=h.useState(""),[i,o]=h.useState(""),[l,c]=h.useState(),[d,u]=h.useState(),[f,m]=h.useState(!1),[p,x]=h.useState(!1),g=U4(r);function v(){s(""),o(""),c(void 0),u(void 0),t()}async function y(w){w.preventDefault(),n.trim()&&g.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?fe(l,"yyyy-MM-dd"):null,end_date:d?fe(d,"yyyy-MM-dd"):null},{onSuccess:()=>{U.success("Sprint created"),v()},onError:()=>U.error("Failed to create sprint")})}return a.jsx(Si,{open:e,onOpenChange:w=>!w&&v(),children:a.jsxs(Ci,{className:"sm:max-w-md",children:[a.jsx(ko,{children:a.jsx(Co,{children:"New Sprint"})}),a.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(So,{className:"space-y-4 py-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{htmlFor:"sprint-name",children:["Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Me,{id:"sprint-name",placeholder:"e.g. Sprint 1",value:n,onChange:w=>s(w.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(mt,{htmlFor:"sprint-goal",children:["Goal ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(hx,{id:"sprint-goal",placeholder:"What do you want to achieve in this sprint?",value:i,onChange:w=>o(w.target.value),className:"resize-none text-sm",rows:2})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"Start Date"}),a.jsxs(Pt,{open:f,onOpenChange:m,children:[a.jsx(Ot,{asChild:!0,children:a.jsxs(ne,{variant:"outline",className:L("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[a.jsx(Wt,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?fe(l,"MMM d, yyyy"):"Pick date"]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:l,onSelect:w=>{c(w),m(!1)},disabled:w=>d?w>d:!1,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(mt,{children:"End Date"}),a.jsxs(Pt,{open:p,onOpenChange:x,children:[a.jsx(Ot,{asChild:!0,children:a.jsxs(ne,{variant:"outline",className:L("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[a.jsx(Wt,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?fe(d,"MMM d, yyyy"):"Pick date"]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:d,onSelect:w=>{u(w),x(!1)},disabled:w=>l?w<l:!1,initialFocus:!0})})]})]})]})]}),a.jsxs(sc,{children:[a.jsx(ne,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),a.jsx(ne,{type:"submit",disabled:!n.trim()||g.isPending,children:g.isPending?"Creating…":"Create Sprint"})]})]})]})})}const yz={active:{label:"Active",icon:jl,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:Rn,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:aa,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function bz({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:s=[]}){const i=q4(e.id,t),o=H4(t),l=yz[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>U.success(`"${e.name}" started`),onError:()=>U.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>U.success(`"${e.name}" completed`),onError:g=>U.error((g==null?void 0:g.message)??"Failed to complete sprint")})}function f(){confirm(`Delete sprint "${e.name}"? This cannot be undone.`)&&o.mutate(e.id,{onSuccess:()=>U.success("Sprint deleted"),onError:()=>U.error("Failed to delete sprint")})}const m=!!e.start_date,p=!!e.end_date,x=a.jsx(a.Fragment,{children:m||p?a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ii,{className:"h-3.5 w-3.5 shrink-0"}),m?fe(new Date(e.start_date),"MMM d"):"—"," → ",p?fe(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=Ch(new Date(e.start_date),new Date(e.end_date),n,s);return a.jsxs("span",{className:"ml-1 text-[11px] text-muted-foreground/70",children:["(",g,"d)"]})})()]}):a.jsx("span",{className:"italic text-muted-foreground/60",children:"No dates"})});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden md:flex items-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors group",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:L("flex h-7 w-7 items-center justify-center rounded-full shrink-0",e.status==="active"?"bg-emerald-100 dark:bg-emerald-900/30":e.status==="completed"?"bg-blue-100 dark:bg-blue-900/30":"bg-zinc-100 dark:bg-zinc-800"),children:a.jsx(c,{className:L("h-3.5 w-3.5",e.status==="active"?"text-emerald-600 dark:text-emerald-400":e.status==="completed"?"text-blue-600 dark:text-blue-400":"text-zinc-500")})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.name}),e.goal&&a.jsxs("p",{className:"text-xs text-muted-foreground truncate mt-0.5 flex items-center gap-1",children:[a.jsx(Yv,{className:"h-3 w-3 shrink-0"}),e.goal]})]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0 w-64",children:[a.jsx(ii,{className:"h-3.5 w-3.5 shrink-0"}),m||p?a.jsxs("span",{children:[m?fe(new Date(e.start_date),"MMM d"):"—"," → ",p?fe(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=Ch(new Date(e.start_date),new Date(e.end_date),n,s);return a.jsxs("span",{className:"ml-1.5 text-[11px] text-muted-foreground/70",children:["(",g," biz day",g!==1?"s":"",")"]})})()]}):a.jsx("span",{className:"italic",children:"No dates set"})]}),a.jsxs("div",{className:"text-xs text-muted-foreground shrink-0 w-20 text-right",children:[r," issue",r!==1?"s":""]}),a.jsx(Dn,{className:L("shrink-0 text-[11px] border-0 w-20 justify-center",l.badge),children:l.label}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.status==="planned"&&a.jsxs(ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(jl,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(aa,{className:"h-3 w-3"}),"Complete"]}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:a.jsx(Or,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"md:hidden px-4 py-3 hover:bg-muted/30 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:L("flex h-7 w-7 items-center justify-center rounded-full shrink-0",e.status==="active"?"bg-emerald-100 dark:bg-emerald-900/30":e.status==="completed"?"bg-blue-100 dark:bg-blue-900/30":"bg-zinc-100 dark:bg-zinc-800"),children:a.jsx(c,{className:L("h-3.5 w-3.5",e.status==="active"?"text-emerald-600 dark:text-emerald-400":e.status==="completed"?"text-blue-600 dark:text-blue-400":"text-zinc-500")})}),a.jsx("p",{className:"text-sm font-medium truncate flex-1 min-w-0",children:e.name}),a.jsx(Dn,{className:L("shrink-0 text-[11px] border-0",l.badge),children:l.label})]}),e.goal&&a.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2 ml-10 flex items-center gap-1",children:[a.jsx(Yv,{className:"h-3 w-3 shrink-0"}),e.goal]}),a.jsxs("div",{className:"flex items-center gap-2 ml-10",children:[a.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground flex-1 min-w-0 flex-wrap",children:[x,a.jsx("span",{children:"·"}),a.jsxs("span",{className:"shrink-0",children:[r," issue",r!==1?"s":""]})]}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.status==="planned"&&a.jsxs(ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(jl,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(aa,{className:"h-3 w-3"}),"Complete"]}),a.jsx(ne,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:f,disabled:o.isPending,children:a.jsx(Or,{className:"h-3.5 w-3.5"})})]})]})]})]})}function wz(){const{projectKey:e}=zt(),[t,r]=h.useState(!1),{data:n}=Ha(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=Po(s||void 0),{data:l}=Gl(s||void 0),{data:c}=jx(),{data:d=[]}=Nx(new Date().getFullYear()),u=(l??[]).reduce((p,x)=>(x.sprint_id&&(p[x.sprint_id]=(p[x.sprint_id]??0)+1),p),{}),f={active:(i??[]).filter(p=>p.status==="active"),planned:(i??[]).filter(p=>p.status==="planned"),completed:(i??[]).filter(p=>p.status==="completed")},m=[{key:"active",label:"Active Sprint",items:f.active},{key:"planned",label:"Planned",items:f.planned},{key:"completed",label:"Completed",items:f.completed}];return a.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[a.jsx(_r,{zone:"project.sprints.before",props:{projectId:s}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsx("div",{className:"flex items-center justify-end px-6 py-3 border-b border-border",children:a.jsxs(ne,{size:"sm",onClick:()=>r(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"New Sprint"]})}),o?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(p=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-5 w-20"})]},p))}):(i??[]).length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(ii,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No sprints yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a sprint to start planning your work in time-boxed iterations."}),a.jsxs(ne,{size:"sm",onClick:()=>r(!0),children:[a.jsx(ut,{className:"h-4 w-4"}),"New Sprint"]})]}):a.jsx("div",{children:m.map(({key:p,label:x,items:g})=>g.length===0?null:a.jsxs("div",{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:x})}),a.jsx("div",{className:"divide-y divide-border",children:g.map(v=>a.jsx(bz,{sprint:v,projectId:s,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},p))})]}),a.jsx(_r,{zone:"project.sprints.after",props:{projectId:s}}),a.jsx(vz,{open:t,onClose:()=>r(!1),projectId:s})]})}function jz(e,t=300){const[r,n]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>n(e),t);return()=>clearTimeout(s)},[e,t]),r}const no={all:["roles"],list:()=>[...no.all,"list"],detail:e=>[...no.all,e]};function lf(){return Le({queryKey:no.list(),queryFn:()=>oe.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function Nz(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:no.list()})}})}function kz(e){const t=Ne();return ge({mutationFn:r=>oe.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:no.list()})}})}function Sz(){const e=Ne();return ge({mutationFn:t=>oe.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:no.list()})}})}function sS(){const e=Ne();return ge({mutationFn:({userId:t,appRoleId:r})=>oe.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["users"]})}})}const Od=[{group:"Workspace Admin",permissions:[{key:"workspace:admin",label:"Workspace admin (full access to workspace settings, reports, and member management)"}]},{group:"Members & Invitations",permissions:[{key:"member:invite",label:"Invite members"},{key:"member:remove",label:"Remove members"},{key:"member:update_role",label:"Change member roles"}]},{group:"Workspaces",permissions:[{key:"workspace:create",label:"Create workspaces"},{key:"workspace:update",label:"Update workspace settings"},{key:"workspace:delete",label:"Delete workspaces"}]},{group:"Projects",permissions:[{key:"project:create",label:"Create projects"},{key:"project:update",label:"Update project settings"},{key:"project:delete",label:"Delete projects"},{key:"project:archive",label:"Archive projects"},{key:"project:manage_access",label:"Manage project access"}]},{group:"Issues",permissions:[{key:"issue:create",label:"Create issues"},{key:"issue:update",label:"Update issues"},{key:"issue:delete",label:"Delete issues"},{key:"issue:assign",label:"Assign issues"},{key:"issue:update_status",label:"Update issue status"}]},{group:"Sprints",permissions:[{key:"sprint:create",label:"Create sprints"},{key:"sprint:start",label:"Start sprints"},{key:"sprint:complete",label:"Complete sprints"},{key:"sprint:delete",label:"Delete sprints"}]},{group:"Teams",permissions:[{key:"team:create",label:"Create teams"},{key:"team:update",label:"Update teams"},{key:"team:delete",label:"Delete teams"},{key:"team:manage_members",label:"Manage team members"}]},{group:"Roles",permissions:[{key:"role:create",label:"Create roles"},{key:"role:update",label:"Update roles"},{key:"role:delete",label:"Delete roles"},{key:"role:assign",label:"Assign roles to users"}]}];function Ed({value:e,className:t}){const[r,n]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)};return a.jsx("button",{onClick:s,className:L("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?a.jsx(Xt,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Xp,{className:"h-3.5 w-3.5"})})}function Ly({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:a.jsxs(qe,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[a.jsx(We,{className:"h-9",children:a.jsx(Xe,{placeholder:"No custom role"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>a.jsx(ke,{value:n.id,children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{children:n.name}),n.description&&a.jsx("span",{className:"text-xs text-muted-foreground",children:n.description})]})},n.id))]})]})}function Cz({open:e,onClose:t,workspaceId:r}){const[n,s]=h.useState("existing"),[i,o]=h.useState(""),[l,c]=h.useState([]),[d,u]=h.useState(""),[f,m]=h.useState(""),[p,x]=h.useState(""),[g,v]=h.useState(null),y=jz(i,300),{data:w,isFetching:N}=UN({q:y}),j=(w==null?void 0:w.users)??[],{data:k=[]}=Zl(r),b=V5(r),S=K5(r),{data:_}=lf(),C=h.useMemo(()=>new Set(k.map(I=>I.user_id)),[k]),P=h.useMemo(()=>j.filter(I=>!C.has(I.id)),[j,C]);h.useEffect(()=>{e&&(o(""),c([]),u(""),m(""),x(""),v(null),s("existing"))},[e]);const D=()=>{l.length!==0&&b.mutate({user_ids:l,role:"member",app_role_id:d||null},{onSuccess:I=>{U.success(`${I.added} member${I.added===1?"":"s"} added`),t()},onError:I=>U.error(I.message||"Failed to add members")})},E=I=>{I.preventDefault(),S.mutate({email:f.trim()||void 0,role:"member",app_role_id:p||null},{onSuccess:F=>{v(F.invitation),U.success("Invitation created")},onError:F=>U.error(F.message||"Failed to create invitation")})};return a.jsx(Ka,{open:e,onOpenChange:I=>!I&&t(),children:a.jsxs(fa,{className:"sm:max-w-[520px] bg-white dark:bg-card",children:[a.jsx(Ya,{children:a.jsx(Ga,{children:"Add member"})}),!g&&a.jsxs("div",{className:"flex rounded-lg border border-border p-0.5 bg-muted/40 gap-0.5",children:[a.jsx("button",{type:"button",onClick:()=>s("existing"),className:L("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="existing"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Existing user"}),a.jsx("button",{type:"button",onClick:()=>s("invite"),className:L("flex-1 text-sm py-1.5 rounded-md font-medium transition-colors",n==="invite"?"bg-white dark:bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:"Send invite"})]}),n==="existing"&&!g&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(Me,{placeholder:"Search by name or email…",value:i,onChange:I=>o(I.target.value),className:"h-9",autoFocus:!0}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:N&&i!==y?a.jsx("div",{className:"py-6 text-center",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching…"})}):P.length===0&&i.trim()?a.jsx("div",{className:"py-6 text-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',i,'"']})}):P.length===0?a.jsxs("div",{className:"py-8 text-center px-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"All users are already members."}),a.jsx("button",{className:"mt-2 text-xs text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",onClick:()=>s("invite"),children:"Send an invite instead"})]}):a.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:P.map(I=>{const F=I.first_name??"",Q=I.last_name??"",Y=`${F} ${Q}`.trim()||I.email,X=(F[0]??Q[0]??I.email[0]??"U").toUpperCase(),re=l.includes(I.id);return a.jsxs("button",{type:"button",onClick:()=>c(ee=>re?ee.filter(T=>T!==I.id):[...ee,I.id]),className:L("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",re?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[a.jsx(Rt,{className:"h-7 w-7 shrink-0",children:a.jsx($t,{className:"text-[11px] font-medium",children:X})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:Y}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:I.email})]}),re&&a.jsx(Xt,{className:"h-4 w-4 text-indigo shrink-0"})]},I.id)})})}),P.length>0&&a.jsxs(a.Fragment,{children:[_&&_.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ly,{value:d,onChange:u,appRoles:_})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ne,{type:"button",size:"sm",disabled:l.length===0||b.isPending,onClick:D,children:b.isPending?"Adding…":l.length<=1?"Add to workspace":`Add ${l.length} members`})]})]})]}),n==="invite"&&!g&&a.jsxs("form",{onSubmit:E,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Email ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Me,{type:"email",placeholder:"colleague@example.com",value:f,onChange:I=>m(I.target.value),className:"h-9",autoFocus:!0}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),_&&_.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Role ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Ly,{value:p,onChange:x,appRoles:_})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ne,{type:"submit",size:"sm",disabled:S.isPending,children:S.isPending?"Creating…":"Create invitation"})]})]}),g&&a.jsxs("div",{className:"space-y-4 pt-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",g.email?a.jsx("span",{className:"font-medium text-foreground",children:g.email}):"anyone you want to invite","."]}),a.jsxs("div",{className:"flex items-start gap-2 p-3 bg-muted/50 rounded-lg border border-border",children:[a.jsx(oi,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 mt-0.5"}),a.jsx("span",{className:"text-xs font-mono text-foreground flex-1 min-w-0 break-all",children:`${window.location.origin}/invite/${g.token}`}),a.jsx(Ed,{value:`${window.location.origin}/invite/${g.token}`,className:"shrink-0"})]}),a.jsxs("div",{className:"flex items-center justify-between pt-1",children:[a.jsx("button",{className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>v(null),children:"Create another"}),a.jsx(ne,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function _z({invitation:e,workspaceId:t}){const r=Y5(t),n=G5(t),[s,i]=h.useState(!1),o=`${window.location.origin}/invite/${e.token}`;return a.jsxs("div",{className:"px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(oi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),a.jsx("span",{className:L("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",e.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":e.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:e.role==="super-admin"?"Super Admin":e.role==="admin"?"Admin":"Member"})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[280px]",children:o}),a.jsx(Ed,{value:o})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:fe(new Date(e.created_at),"MMM d")}),e.email&&a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>i(!0),disabled:n.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(Nd,{className:L("h-3.5 w-3.5",n.isPending&&"animate-spin")})})}),a.jsx(Pn,{children:"Resend invite"})]}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>U.success("Invitation revoked"),onError:()=>U.error("Failed to revoke")}),disabled:r.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"md:hidden space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(oi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:e.email??"Shareable link"}),a.jsx("span",{className:L("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",e.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":e.role==="admin"?"bg-indigo/10 text-indigo":"bg-muted text-muted-foreground"),children:e.role==="super-admin"?"Super Admin":e.role==="admin"?"Admin":"Member"})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.email&&a.jsx("button",{onClick:()=>i(!0),disabled:n.isPending,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(Nd,{className:L("h-3.5 w-3.5",n.isPending&&"animate-spin")})}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>U.success("Invitation revoked"),onError:()=>U.error("Failed to revoke")}),disabled:r.isPending,className:"text-muted-foreground hover:text-destructive disabled:opacity-50",title:"Revoke invitation",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pl-10",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate flex-1 min-w-0",children:o}),a.jsx(Ed,{value:o}),a.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:fe(new Date(e.created_at),"MMM d")})]})]}),a.jsx(ro,{open:s,onClose:()=>i(!1),onConfirm:()=>n.mutate(e.id,{onSuccess:()=>{U.success("Invitation resent"),i(!1)},onError:()=>U.error("Failed to resend invitation")}),title:"Resend invitation?",description:`A new invitation email will be sent to ${e.email}.`,confirmLabel:"Resend",loading:n.isPending})]})}function Mz({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=Ie(),{data:n,isLoading:s}=bo(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=W5(e),l=U5(e),c=q5(e),d=h.useRef(null),[u,f]=h.useState("");h.useEffect(()=>{i&&f(i.name)},[i==null?void 0:i.name]);const m=i?u.trim()!==i.name:!1,p=()=>{!u.trim()||!i||o.mutate({name:u.trim()},{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:y.workspace.logo_url}),U.success("Workspace updated")},onError:()=>U.error("Failed to update workspace")})},x=y=>{var N;const w=(N=y.target.files)==null?void 0:N[0];w&&(l.mutate(w,{onSuccess:j=>{r({id:j.workspace.id,name:j.workspace.name,slug:j.workspace.slug,logo_url:j.workspace.logo_url}),U.success("Logo updated")},onError:()=>U.error("Failed to upload logo")}),d.current&&(d.current.value=""))},g=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),U.success("Logo removed")},onError:()=>U.error("Failed to remove logo")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Workspace details"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Logo"}),s?a.jsx("div",{className:"flex items-center gap-3",children:a.jsx("div",{className:"size-12 rounded-lg bg-muted animate-pulse"})}):a.jsxs("div",{className:"flex items-center gap-3",children:[i!=null&&i.logo_url?a.jsx("img",{src:i.logo_url,alt:"Workspace logo",className:"size-12 rounded-lg object-cover shrink-0 border border-border"}):a.jsx("div",{className:"flex size-12 items-center justify-center rounded-lg bg-foreground text-background shrink-0",children:a.jsx("span",{className:"text-lg font-bold",children:(((v=i==null?void 0:i.name)==null?void 0:v[0])??"M").toUpperCase()})}),a.jsx("input",{ref:d,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",className:"hidden",onChange:x}),a.jsx(ne,{size:"sm",variant:"outline",className:"h-8",onClick:()=>{var y;return(y=d.current)==null?void 0:y.click()},disabled:l.isPending,children:l.isPending?"Uploading…":"Upload logo"}),(i==null?void 0:i.logo_url)&&a.jsx(ne,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:g,disabled:c.isPending,children:c.isPending?"Removing…":"Remove"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),s?a.jsx(le,{className:"h-8 w-64"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Me,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&a.jsx(ne,{size:"sm",className:"h-8",onClick:p,disabled:!u.trim()||o.isPending,children:o.isPending?"Saving…":"Save"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"URL slug"}),s?a.jsx(le,{className:"h-4 w-40"}):a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx("span",{className:"font-mono text-foreground",children:i==null?void 0:i.slug}),a.jsx(Ed,{value:(i==null?void 0:i.slug)??""})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),s?a.jsx(le,{className:"h-4 w-16"}):a.jsx("span",{className:"text-sm capitalize",children:(i==null?void 0:i.plan)??"free"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Visibility"}),s?a.jsx(le,{className:"h-4 w-28"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox",checked:(i==null?void 0:i.is_private)??!1,onChange:y=>{o.mutate({is_private:y.target.checked},{onSuccess:()=>U.success(y.target.checked?"Workspace is now public":"Workspace is now private"),onError:()=>U.error("Failed to update visibility")})},className:"size-4 rounded border-border accent-indigo-600"}),a.jsx(Aa,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-sm",children:"Private"})]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:i!=null&&i.is_private?"Only members can see this workspace":"Admins can see this workspace without being a member"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),s?a.jsx(le,{className:"h-4 w-28"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?fe(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}const Is=20;function Pz({workspaceId:e,onInvite:t}){var g;const{data:r,isLoading:n}=Zl(e),{data:s,isLoading:i}=H5(e),o=X5(e),l=sS(),{data:c}=lf(),{user:d}=Ie(),[u,f]=h.useState(null),[m,p]=h.useState(0),x=(s==null?void 0:s.filter(v=>v.status==="pending"))??[];return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Members",!n&&r&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:r.length})]})}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(v=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-32"}),a.jsx(le,{className:"h-3 w-48"})]})]},v))}):r!=null&&r.length?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"divide-y divide-border",children:(r??[]).slice(m*Is,(m+1)*Is).map(v=>{var S;const y=v.user,w=(y==null?void 0:y.first_name)??"",N=(y==null?void 0:y.last_name)??"",j=`${w} ${N}`.trim()||(y==null?void 0:y.email)||"Unknown",k=(w[0]??N[0]??((S=y==null?void 0:y.email)==null?void 0:S[0])??"U").toUpperCase(),b=(y==null?void 0:y.id)===(d==null?void 0:d.id);return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx(Rt,{className:"h-7 w-7 shrink-0",children:a.jsx($t,{className:"text-[11px] font-medium",children:k})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:j}),b&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(y==null?void 0:y.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.email})]}),c&&c.length>0&&a.jsxs(qe,{value:v.app_role_id??"none",onValueChange:_=>l.mutate({userId:v.user_id,appRoleId:_==="none"?null:_},{onSuccess:()=>U.success("Custom role updated"),onError:()=>U.error("Failed to update custom role")}),children:[a.jsx(We,{className:"h-7 text-[11px] w-32 shrink-0",children:a.jsx(Xe,{placeholder:"Custom role"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),c.map(_=>a.jsx(ke,{value:_.id,children:_.name},_.id))]})]}),!b&&a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(Ea,{className:"h-4 w-4"})})}),a.jsxs(Er,{align:"end",className:"w-44",children:[a.jsx(st,{onClick:()=>{fetch(`/admin/users/${v.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>U.success("Sessions revoked — user will be signed out")).catch(()=>U.error("Failed to revoke sessions"))},children:"Revoke sessions"}),a.jsx(An,{}),a.jsxs(st,{className:"text-destructive focus:text-destructive",onClick:()=>f(v),children:[a.jsx(Or,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},v.id)})}),((r==null?void 0:r.length)??0)>Is&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[m*Is+1,"–",Math.min((m+1)*Is,r.length)," of ",r.length]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v-1),disabled:m===0,children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[m+1," / ",Math.ceil(r.length/Is)]}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>p(v=>v+1),disabled:(m+1)*Is>=r.length,children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Na,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No members yet"}),a.jsx("button",{onClick:t,className:"text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}),a.jsxs("div",{className:"px-6 py-2 border-t border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Pending invitations",!i&&x.length>0&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:x.length})]}),a.jsxs("button",{onClick:t,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(ut,{className:"h-3 w-3"}),"Invite"]})]}),i?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(v=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-3.5 w-48"}),a.jsx(le,{className:"h-3 w-64"})]})]},v))}):x.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No pending invitations."}),a.jsx("button",{onClick:t,className:"mt-2 text-sm text-muted-foreground hover:text-foreground underline underline-offset-2 transition-colors",children:"Invite someone"})]}):a.jsx("div",{className:"divide-y divide-border",children:x.map(v=>a.jsx(_z,{invitation:v,workspaceId:e},v.id))}),a.jsx(ro,{open:!!u,onClose:()=>f(null),onConfirm:()=>{u&&o.mutate(u.user_id,{onSuccess:()=>{U.success("Member removed"),f(null)},onError:()=>{U.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((g=u==null?void 0:u.user)==null?void 0:g.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending})]})}function Oz({workspaceId:e,teamId:t,allMembers:r}){var y,w;const{data:n,isLoading:s}=J5(e,t),i=eD(e,t),o=tD(e,t),[l,c]=h.useState(""),[d,u]=h.useState(null),[f,m]=h.useState(null),p=new Set((n==null?void 0:n.map(N=>N.user_id))??[]),x=r.filter(N=>!p.has(N.user_id)),g=n==null?void 0:n.find(N=>N.user_id===d),v=r.find(N=>N.user_id===f);return a.jsxs("div",{className:"bg-muted/10 border-t border-border",children:[s?a.jsx("div",{className:"px-8 py-3",children:a.jsx(le,{className:"h-3 w-40"})}):(n==null?void 0:n.length)===0?a.jsx("p",{className:"px-8 py-3 text-xs text-muted-foreground",children:"No members in this team yet."}):a.jsx("div",{className:"divide-y divide-border/50",children:n==null?void 0:n.map(N=>{var C;const j=N.user,k=(j==null?void 0:j.first_name)??"",b=(j==null?void 0:j.last_name)??"",S=`${k} ${b}`.trim()||(j==null?void 0:j.email)||"Unknown",_=(k[0]??b[0]??((C=j==null?void 0:j.email)==null?void 0:C[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-3 px-8 py-2.5 group hover:bg-muted/20 transition-colors",children:[a.jsx(Rt,{className:"h-6 w-6 shrink-0",children:a.jsx($t,{className:"text-[10px] font-medium",children:_})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:S}),a.jsx("button",{onClick:()=>u(N.user_id),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Remove from team",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]},N.id)})}),x.length>0&&a.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[a.jsx(yo,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(qe,{value:l,onValueChange:c,children:[a.jsx(We,{className:"h-7 text-xs flex-1 max-w-[200px]",children:a.jsx(Xe,{placeholder:"Add member…"})}),a.jsx(Ue,{children:x.map(N=>{const j=N.user,k=(j==null?void 0:j.first_name)??"",b=(j==null?void 0:j.last_name)??"",S=`${k} ${b}`.trim()||(j==null?void 0:j.email)||"Unknown";return a.jsx(ke,{value:N.user_id,children:S},N.user_id)})})]}),l&&a.jsx(ne,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),a.jsx(ro,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{U.success("Removed from team"),u(null)},onError:()=>{U.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=g==null?void 0:g.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),a.jsx(ro,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{U.success("Added to team"),m(null),c("")},onError:()=>{U.error("Failed to add"),m(null)}})},title:"Add to team",description:`Add ${((w=v==null?void 0:v.user)==null?void 0:w.email)??"this member"} to the team?`,confirmLabel:"Add",loading:i.isPending})]})}function Ez({workspaceId:e}){const{data:t,isLoading:r}=zu(e),{data:n}=Zl(e),s=Q5(e),i=Z5(e),[o,l]=h.useState(new Set),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,p]=h.useState(null),x=t==null?void 0:t.find(y=>y.id===m),g=y=>{l(w=>{const N=new Set(w);return N.has(y)?N.delete(y):N.add(y),N})},v=y=>{y.preventDefault(),u.trim()&&s.mutate({name:u.trim()},{onSuccess:()=>{U.success("Team created"),f(""),d(!1)},onError:()=>U.error("Failed to create team")})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/20 flex items-center justify-between",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:["Teams",!r&&t&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",t.length]})]}),a.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(ut,{className:"h-3 w-3"}),"New team"]})]}),c&&a.jsx("div",{className:"px-6 py-3 border-b border-border bg-muted/5",children:a.jsxs("form",{onSubmit:v,className:"flex items-center gap-2",children:[a.jsx(Me,{autoFocus:!0,placeholder:"Team name",value:u,onChange:y=>f(y.target.value),className:"h-8 text-sm flex-1 max-w-[240px]"}),a.jsx(ne,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||s.isPending,children:s.isPending?"Creating…":"Create"}),a.jsx(ne,{type:"button",variant:"ghost",size:"sm",className:"h-8",onClick:()=>{d(!1),f("")},children:"Cancel"})]})}),r?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(y=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(le,{className:"h-7 w-7 rounded-lg shrink-0"}),a.jsx(le,{className:"h-3.5 w-32"})]},y))}):t!=null&&t.length?a.jsx("div",{className:"divide-y divide-border",children:t.map(y=>{const w=o.has(y.id);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors group",children:[a.jsx("button",{onClick:()=>g(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:w?a.jsx(ca,{className:"h-4 w-4"}):a.jsx(hr,{className:"h-4 w-4"})}),a.jsx("div",{className:"h-7 w-7 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(li,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:y.name}),y.description&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y.description})]}),a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[y.member_count," ",y.member_count===1?"member":"members"]}),a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(Ea,{className:"h-4 w-4"})})}),a.jsx(Er,{align:"end",className:"w-36",children:a.jsxs(st,{className:"text-destructive focus:text-destructive",onClick:()=>p(y.id),children:[a.jsx(Or,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),w&&a.jsx(Oz,{workspaceId:e,teamId:y.id,allMembers:n??[]})]},y.id)})}):a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(li,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No teams yet"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Teams make it easy to grant project access to groups of people."}),a.jsx(ne,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),a.jsx(ro,{open:!!m,onClose:()=>p(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{U.success("Team deleted"),p(null)},onError:()=>{U.error("Failed to delete team"),p(null)}})},title:"Delete team",description:`Delete "${(x==null?void 0:x.name)??"this team"}"? All members will be removed from the team. Projects will not be affected.`,confirmLabel:"Delete team",variant:"destructive",loading:i.isPending})]})}const Az=["general","members","teams"];function Dz(){const{workspace:e}=Ie(),t=(e==null?void 0:e.id)??"",[r,n]=Hl(),s=r.get("tab"),[i,o]=h.useState(Az.includes(s)?s:"general"),l=u=>{o(u),n({tab:u},{replace:!0})},[c,d]=h.useState(!1);return a.jsxs("div",{className:"p-2 pb-24 md:pb-2",children:[a.jsx(_r,{zone:"workspace.settings.before",props:{workspaceId:t}}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-border px-2",children:[a.jsx("div",{className:"flex overflow-x-auto scrollbar-none",children:["general","members","teams"].map(u=>a.jsx("button",{onClick:()=>l(u),className:L("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize whitespace-nowrap shrink-0",i===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),i==="members"&&a.jsxs(ne,{size:"sm",onClick:()=>d(!0),className:"shrink-0 ml-2",children:[a.jsx(ut,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"Add member"})]})]}),i==="general"&&a.jsx(Mz,{workspaceId:t}),i==="members"&&a.jsx(Pz,{workspaceId:t,onInvite:()=>d(!0)}),i==="teams"&&a.jsx(Ez,{workspaceId:t})]}),a.jsx(_r,{zone:"workspace.settings.after",props:{workspaceId:t}}),a.jsx(Cz,{open:c,onClose:()=>d(!1),workspaceId:t})]})}function Tz({open:e,onClose:t}){const[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(new Set),c=Nz();h.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=Od.flatMap(g=>g.permissions.map(v=>v.key)),u=d.every(g=>o.has(g)),f=!u&&d.some(g=>o.has(g)),m=()=>{l(u?new Set:new Set(d))},p=g=>{l(v=>{const y=new Set(v);return y.has(g)?y.delete(g):y.add(g),y})},x=g=>{g.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{U.success("Role created"),t()},onError:v=>U.error(v.message||"Failed to create role")})};return a.jsx(Ka,{open:e,onOpenChange:g=>!g&&t(),children:a.jsxs(fa,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[a.jsxs(Ya,{children:[a.jsx(Ga,{children:"Create role"}),a.jsx(No,{children:"Define a new custom role with a specific permission set."})]}),a.jsxs("form",{onSubmit:x,className:"space-y-5 pt-2",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Me,{value:r,onChange:g=>n(g.target.value),placeholder:"e.g. Developer, PM, Viewer",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Description ",a.jsx("span",{className:"font-normal",children:"(optional)"})]}),a.jsx(Me,{value:s,onChange:g=>i(g.target.value),placeholder:"What is this role for?",className:"h-9"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:m,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:u?"Deselect all":"Select all"})]}),Od.map(g=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:g.group}),a.jsx("div",{className:"space-y-1.5",children:g.permissions.map(v=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(v.key),onChange:()=>p(v.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm group-hover:text-foreground text-muted-foreground transition-colors",children:v.label})]},v.key))})]},g.group))]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ne,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function Iz({role:e,onDeleted:t}){const[r,n]=h.useState(e.name),[s,i]=h.useState(e.description??""),[o,l]=h.useState(new Set(e.permissions)),[c,d]=h.useState(!1),u=kz(e.id),f=Sz();h.useEffect(()=>{n(e.name),i(e.description??""),l(new Set(e.permissions))},[e.id,e.name,e.description,e.permissions]);const m=r!==e.name||s!==(e.description??"")||o.size!==e.permissions.length||Array.from(o).some(j=>!e.permissions.includes(j)),p=Od.flatMap(j=>j.permissions.map(k=>k.key)),x=p.every(j=>o.has(j)),g=!x&&p.some(j=>o.has(j)),v=()=>{l(x?new Set:new Set(p))},y=j=>{l(k=>{const b=new Set(k);return b.has(j)?b.delete(j):b.add(j),b})},w=()=>{u.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>U.success("Role saved"),onError:j=>U.error(j.message||"Failed to save role")})},N=()=>{f.mutate(e.id,{onSuccess:()=>{U.success("Role deleted"),t(),d(!1)},onError:j=>U.error(j.message||"Failed to delete role")})};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold",children:e.name}),e.is_system&&a.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:[a.jsx(Aa,{className:"h-3 w-3"}),"System"]})]}),!e.is_system&&a.jsx("button",{onClick:()=>d(!0),className:"text-muted-foreground hover:text-destructive transition-colors",title:"Delete role",children:a.jsx(Or,{className:"h-4 w-4"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-5",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Me,{value:r,onChange:j=>n(j.target.value),className:"h-8 text-sm"})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Description"}),a.jsx(Me,{value:s,onChange:j=>i(j.target.value),placeholder:"What is this role for?",className:"h-8 text-sm"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Permissions"}),a.jsx("button",{type:"button",onClick:v,className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:x?"Deselect all":"Select all"})]}),Od.map(j=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:j.group}),a.jsx("div",{className:"space-y-2",children:j.permissions.map(k=>a.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer group",children:[a.jsx("input",{type:"checkbox",checked:o.has(k.key),onChange:()=>y(k.key),className:"h-3.5 w-3.5 rounded border-border accent-foreground cursor-pointer"}),a.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:k.label})]},k.key))})]},j.group))]}),a.jsx("div",{className:"shrink-0 px-6 py-4 border-t border-border flex justify-end",children:a.jsx(ne,{size:"sm",onClick:w,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),a.jsx(ei,{open:c,onOpenChange:d,children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsxs(xs,{children:['Delete "',e.name,'"?']}),a.jsx(gs,{children:"This role will be removed from all users assigned to it. This action cannot be undone."})]}),a.jsxs(ps,{children:[a.jsx(ys,{children:"Cancel"}),a.jsx(vs,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function Rz(){const{data:e,isLoading:t}=lf(),[r,n]=h.useState(null),[s,i]=h.useState(!1),o=(e==null?void 0:e.filter(d=>d.is_system))??[],l=(e==null?void 0:e.filter(d=>!d.is_system))??[];h.useEffect(()=>{e&&e.length>0&&!r&&n(e[0].id)},[e]);const c=(e==null?void 0:e.find(d=>d.id===r))??null;return a.jsx("div",{className:"p-2 pb-24 md:pb-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(bh,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Roles & Permissions"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Define what users with each custom role can do across the application."})]})]}),a.jsxs(ne,{size:"sm",onClick:()=>i(!0),children:[a.jsx(ut,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),a.jsxs("div",{className:"flex flex-col md:flex-row flex-1 min-h-0",children:[a.jsx("div",{className:"w-full md:w-56 shrink-0 md:border-r border-b md:border-b-0 border-border flex flex-col overflow-y-auto md:overflow-y-auto max-h-48 md:max-h-none",children:t?a.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>a.jsx(le,{className:"h-8 w-full"},d))}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"System Roles"})}),o.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:L("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(Aa,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),l.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-3 pb-1",children:a.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom Roles"})}),l.map(d=>a.jsxs("button",{onClick:()=>n(d.id),className:L("w-full flex items-center gap-2 px-3 py-2 text-left text-sm transition-colors",r===d.id?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx("div",{className:"h-3 w-3 shrink-0"}),a.jsx("span",{className:"truncate",children:d.name})]},d.id))]}),!t&&(!e||e.length===0)&&a.jsx("div",{className:"flex flex-col items-center justify-center py-10 px-3 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No roles yet."})})]})}),a.jsx("div",{className:"flex-1 min-w-0",children:c?a.jsx(Iz,{role:c,onDeleted:()=>{var u;const d=(e==null?void 0:e.filter(f=>f.id!==c.id))??[];n(((u=d[0])==null?void 0:u.id)??null)}},c.id):a.jsx("div",{className:"flex items-center justify-center h-full text-center p-8",children:a.jsxs("div",{children:[a.jsx(bh,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Select a role to edit"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Or"," ",a.jsx("button",{onClick:()=>i(!0),className:"underline underline-offset-2 hover:text-foreground transition-colors",children:"create a new role"})]})]})})})]}),a.jsx(Tz,{open:s,onClose:()=>i(!1)})]})})}function $z(e){return Le({queryKey:["invite",e],queryFn:()=>oe.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function zz(){const{token:e}=zt(),{isAuthenticated:t}=Ie(),r=pt(),{data:n,isLoading:s,error:i}=$z(e??""),{data:o}=Lu(),l=oD(e??""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(!1);if(t&&n)return r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0}),null;const w=(n==null?void 0:n.invitation.email)??null,N=j=>{j.preventDefault();const k=w??m.trim();if(!k){U.error("Email is required");return}l.mutate({email:k,password:x,first_name:c,last_name:u},{onSuccess:()=>{r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0})},onError:b=>U.error(b.message??"Registration failed")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[380px]",children:[a.jsx("div",{className:"flex justify-center mb-8",children:a.jsx(nc,{})}),s?a.jsxs("div",{className:"space-y-3",children:[a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-48 mx-auto"}),a.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-32 mx-auto"})]}):i?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-3",children:[a.jsx("p",{className:"text-sm font-medium",children:"Invalid or expired invitation"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is no longer valid. Ask for a new one."}),a.jsx(Mr,{to:"/login",children:a.jsx(ne,{variant:"outline",size:"sm",className:"mt-2",children:"Go to login"})})]}):n?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"px-5 py-4 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(M1,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"You've been invited to"})]}),a.jsx("p",{className:"text-base font-semibold",children:n.workspace?n.workspace.name:"Meridian"})]}),a.jsxs("div",{className:"px-5 py-3 flex items-center gap-2.5",children:[n.invitation.role==="admin"?a.jsx(P5,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):a.jsx(z5,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:["Joining as"," ",a.jsx("span",{className:"font-medium text-foreground capitalize",children:n.invitation.role}),n.invitation.role==="admin"?" — full access":" — can view and edit"]})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-5",children:[a.jsx("p",{className:"text-sm font-medium mb-4",children:"Create your account"}),a.jsxs("form",{onSubmit:N,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Me,{placeholder:"First name",value:c,onChange:j=>d(j.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),a.jsx(Me,{placeholder:"Last name",value:u,onChange:j=>f(j.target.value),required:!0,className:"h-9 bg-transparent"})]}),w?a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:"email",value:w,readOnly:!0,className:"h-9 bg-muted/50 text-muted-foreground cursor-not-allowed"}),a.jsx("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:"locked"})]}):a.jsx(Me,{type:"email",placeholder:"Email",value:m,onChange:j=>p(j.target.value),required:!0,className:"h-9 bg-transparent",autoComplete:"email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:x,onChange:j=>g(j.target.value),required:!0,minLength:8,className:"h-9 bg-transparent pr-10",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>y(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:v?a.jsx(Xl,{className:"h-4 w-4"}):a.jsx(Ni,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(ne,{type:"submit",className:"w-full h-9 font-medium",disabled:l.isPending,children:l.isPending?"Creating account…":"Accept invitation"})})]})]}),(o==null?void 0:o.googleOAuthEnabled)&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-px flex-1 bg-border"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),a.jsx("div",{className:"h-px flex-1 bg-border"})]}),a.jsx(ux,{flow:"invite",inviteToken:e,label:"Accept with Google"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground",children:["Already have an account?"," ",a.jsx(Mr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}const iS={all:["reporting"],timeLogs:e=>[...iS.all,"time-logs",e]};function oS(e,t){return Le({queryKey:iS.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{s&&((n==="workspace_ids"||n==="user_ids"||n==="project_ids")&&Array.isArray(s)?s.length>0&&r.set(n,s.join(",")):typeof s=="string"?r.set(n,s):typeof s=="number"&&r.set(n,String(s)))}),oe.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)!==!1})}function Lz(e,t){return Le({queryKey:["reporting","members",e,t],queryFn:()=>{const r=new URLSearchParams;return e.length&&r.set("workspace_ids",e.join(",")),t.length&&r.set("project_ids",t.join(",")),oe.get(`/admin/reporting/members?${r}`)},select:r=>r.members})}function Ad({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return a.jsxs(Pt,{children:[a.jsx(Ot,{asChild:!0,children:a.jsxs(ne,{variant:"outline",className:L("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[a.jsx(Wt,{className:"h-3.5 w-3.5 shrink-0"}),e?fe(e,"MMM d, yyyy"):a.jsx("span",{children:r}),e&&a.jsx("span",{role:"button",className:"ml-auto hover:text-foreground",onClick:s=>{s.stopPropagation(),t(void 0)},children:a.jsx(Je,{className:"h-3 w-3"})})]})}),a.jsx(_t,{className:"w-auto p-0",align:"start",children:a.jsx(yr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}var Fz=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Tx(e){if(typeof e!="string")return!1;var t=Fz;return t.includes(e)}var Bz=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Wz=new Set(Bz);function lS(e){return typeof e!="string"?!1:Wz.has(e)}function cS(e){return typeof e=="string"&&e.startsWith("data-")}function Ta(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(lS(r)||cS(r))&&(t[r]=e[r]);return t}function Ix(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ta(t)}return typeof e=="object"&&!Array.isArray(e)?Ta(e):null}function xn(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(lS(r)||cS(r)||Tx(r))&&(t[r]=e[r]);return t}var Uz=["children","width","height","viewBox","className","style","title","desc"];function Th(){return Th=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Th.apply(null,arguments)}function qz(e,t){if(e==null)return{};var r,n,s=Hz(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Hz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dS=h.forwardRef((e,t)=>{var{children:r,width:n,height:s,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=qz(e,Uz),f=i||{width:n,height:s,x:0,y:0},m=ot("recharts-surface",o);return h.createElement("svg",Th({},xn(u),{className:m,width:n,height:s,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,d),r)}),Kz=["children","className"];function Ih(){return Ih=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ih.apply(null,arguments)}function Yz(e,t){if(e==null)return{};var r,n,s=Gz(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Gz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ia=h.forwardRef((e,t)=>{var{children:r,className:n}=e,s=Yz(e,Kz),i=ot("recharts-layer",n);return h.createElement("g",Ih({className:i},xn(s),{ref:t}),r)}),Vz=h.createContext(null);function dt(e){return function(){return e}}const uS=Math.cos,Dd=Math.sin,$n=Math.sqrt,Td=Math.PI,cf=2*Td,Rh=Math.PI,$h=2*Rh,Ls=1e-6,Xz=$h-Ls;function fS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Qz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return fS;const r=10**t;return function(n){this._+=n[0];for(let s=1,i=n.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class Zz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?fS:Qz(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,i,o){this._append`C${+t},${+r},${+n},${+s},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,s,i){if(t=+t,r=+r,n=+n,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,d=s-r,u=o-t,f=l-r,m=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>Ls)if(!(Math.abs(f*c-d*u)>Ls)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,x=s-l,g=c*c+d*d,v=p*p+x*x,y=Math.sqrt(g),w=Math.sqrt(m),N=i*Math.tan((Rh-Math.acos((g+m-v)/(2*y*w)))/2),j=N/w,k=N/y;Math.abs(j-1)>Ls&&this._append`L${t+j*u},${r+j*f}`,this._append`A${i},${i},0,0,${+(f*p>u*x)},${this._x1=t+k*c},${this._y1=r+k*d}`}}arc(t,r,n,s,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),c=n*Math.sin(s),d=t+l,u=r+c,f=1^o,m=o?s-i:i-s;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Ls||Math.abs(this._y1-u)>Ls)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%$h+$h),m>Xz?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:m>Ls&&this._append`A${n},${n},0,${+(m>=Rh)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function Rx(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Zz(t)}function $x(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mS(e){this._context=e}mS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function df(e){return new mS(e)}function hS(e){return e[0]}function pS(e){return e[1]}function xS(e,t){var r=dt(!0),n=null,s=df,i=null,o=Rx(l);e=typeof e=="function"?e:e===void 0?hS:dt(e),t=typeof t=="function"?t:t===void 0?pS:dt(t);function l(c){var d,u=(c=$x(c)).length,f,m=!1,p;for(n==null&&(i=s(p=o())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+e(f,d,c),+t(f,d,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:dt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:dt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:dt(!!c),l):r},l.curve=function(c){return arguments.length?(s=c,n!=null&&(i=s(n)),l):s},l.context=function(c){return arguments.length?(c==null?n=i=null:i=s(n=c),l):n},l}function Hc(e,t,r){var n=null,s=dt(!0),i=null,o=df,l=null,c=Rx(d);e=typeof e=="function"?e:e===void 0?hS:dt(+e),t=typeof t=="function"?t:dt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?pS:dt(+r);function d(f){var m,p,x,g=(f=$x(f)).length,v,y=!1,w,N=new Array(g),j=new Array(g);for(i==null&&(l=o(w=c())),m=0;m<=g;++m){if(!(m<g&&s(v=f[m],m,f))===y)if(y=!y)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=p;--x)l.point(N[x],j[x]);l.lineEnd(),l.areaEnd()}y&&(N[m]=+e(v,m,f),j[m]=+t(v,m,f),l.point(n?+n(v,m,f):N[m],r?+r(v,m,f):j[m]))}if(w)return l=null,w+""||null}function u(){return xS().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:dt(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:dt(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:dt(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:dt(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:dt(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:dt(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(s=typeof f=="function"?f:dt(!!f),d):s},d.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),d):o},d.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),d):i},d}class gS{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Jz(e){return new gS(e,!0)}function eL(e){return new gS(e,!1)}const zx={draw(e,t){const r=$n(t/Td);e.moveTo(r,0),e.arc(0,0,r,0,cf)}},tL={draw(e,t){const r=$n(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},vS=$n(1/3),rL=vS*2,nL={draw(e,t){const r=$n(t/rL),n=r*vS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},aL={draw(e,t){const r=$n(t),n=-r/2;e.rect(n,n,r,r)}},sL=.8908130915292852,yS=Dd(Td/10)/Dd(7*Td/10),iL=Dd(cf/10)*yS,oL=-uS(cf/10)*yS,lL={draw(e,t){const r=$n(t*sL),n=iL*r,s=oL*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=cf*i/5,l=uS(o),c=Dd(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},Bm=$n(3),cL={draw(e,t){const r=-$n(t/(Bm*3));e.moveTo(0,r*2),e.lineTo(-Bm*r,-r),e.lineTo(Bm*r,-r),e.closePath()}},cn=-.5,dn=$n(3)/2,zh=1/$n(12),dL=(zh/2+1)*3,uL={draw(e,t){const r=$n(t/dL),n=r/2,s=r*zh,i=n,o=r*zh+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(cn*n-dn*s,dn*n+cn*s),e.lineTo(cn*i-dn*o,dn*i+cn*o),e.lineTo(cn*l-dn*c,dn*l+cn*c),e.lineTo(cn*n+dn*s,cn*s-dn*n),e.lineTo(cn*i+dn*o,cn*o-dn*i),e.lineTo(cn*l+dn*c,cn*c-dn*l),e.closePath()}};function fL(e,t){let r=null,n=Rx(s);e=typeof e=="function"?e:dt(e||zx),t=typeof t=="function"?t:dt(t===void 0?64:+t);function s(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:dt(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:dt(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function Id(){}function Rd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function bS(e){this._context=e}bS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mL(e){return new bS(e)}function wS(e){this._context=e}wS.prototype={areaStart:Id,areaEnd:Id,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Rd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hL(e){return new wS(e)}function jS(e){this._context=e}jS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Rd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pL(e){return new jS(e)}function NS(e){this._context=e}NS.prototype={areaStart:Id,areaEnd:Id,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function xL(e){return new NS(e)}function Fy(e){return e<0?-1:1}function By(e,t,r){var n=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(n||s<0&&-0),o=(r-e._y1)/(s||n<0&&-0),l=(i*s+o*n)/(n+s);return(Fy(i)+Fy(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function Wy(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Wm(e,t,r){var n=e._x0,s=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,s+l*t,i-l,o-l*r,i,o)}function $d(e){this._context=e}$d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Wm(this,this._t0,Wy(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Wm(this,Wy(this,r=By(this,e,t)),r);break;default:Wm(this,this._t0,r=By(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function kS(e){this._context=new SS(e)}(kS.prototype=Object.create($d.prototype)).point=function(e,t){$d.prototype.point.call(this,t,e)};function SS(e){this._context=e}SS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,s,i){this._context.bezierCurveTo(t,e,n,r,i,s)}};function gL(e){return new $d(e)}function vL(e){return new kS(e)}function CS(e){this._context=e}CS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Uy(e),s=Uy(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],s[0][i],n[1][i],s[1][i],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Uy(e){var t,r=e.length-1,n,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(s[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(o[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function yL(e){return new CS(e)}function uf(e,t){this._context=e,this._t=t}uf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function bL(e){return new uf(e,.5)}function wL(e){return new uf(e,0)}function jL(e){return new uf(e,1)}function fi(e,t){if((o=e.length)>1)for(var r=1,n,s,i=e[t[0]],o,l=i.length;r<o;++r)for(s=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function Lh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function NL(e,t){return e[t]}function kL(e){const t=[];return t.key=e,t}function SL(){var e=dt([]),t=Lh,r=fi,n=NL;function s(i){var o=Array.from(e.apply(this,arguments),kL),l,c=o.length,d=-1,u;for(const f of i)for(l=0,++d;l<c;++l)(o[l][d]=[0,+n(f,o[l].key,d,i)]).data=f;for(l=0,u=$x(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:dt(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:dt(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?Lh:typeof i=="function"?i:dt(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??fi,s):r},s}function CL(e,t){if((n=e.length)>0){for(var r,n,s=0,i=e[0].length,o;s<i;++s){for(o=r=0;r<n;++r)o+=e[r][s][1]||0;if(o)for(r=0;r<n;++r)e[r][s][1]/=o}fi(e,t)}}function _L(e,t){if((s=e.length)>0){for(var r=0,n=e[t[0]],s,i=n.length;r<i;++r){for(var o=0,l=0;o<s;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}fi(e,t)}}function ML(e,t){if(!(!((o=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,n=1,s,i,o;n<i;++n){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],f=u[n][1]||0,m=u[n-1][1]||0,p=(f-m)/2,x=0;x<l;++x){var g=e[t[x]],v=g[n][1]||0,y=g[n-1][1]||0;p+=v-y}c+=f,d+=p*f}s[n-1][1]+=s[n-1][0]=r,c&&(r-=d/c)}s[n-1][1]+=s[n-1][0]=r,fi(e,t)}}var ff={},_S={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(_S);var Lx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(Lx);var mf={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t})(mf);var hf={},MS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(MS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MS,r=mf;function n(s){if(Array.isArray(s))return s.map(r.toKey);if(typeof s=="symbol")return[s];s=t.toString(s);const i=[],o=s.length;if(o===0)return i;let l=0,c="",d="",u=!1;for(s.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const f=s[l];d?f==="\\"&&l+1<o?(l++,c+=s[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,i.push(c),c=""):c+=f:f==="["?(u=!0,c&&(i.push(c),c="")):f==="."?c&&(i.push(c),c=""):c+=f,l++}return c&&i.push(c),i}e.toPath=n})(hf);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_S,r=Lx,n=mf,s=hf;function i(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?i(l,s.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function o(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=i})(ff);var PL=ff.get;const ao=Ua(PL);var OL=4;function us(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:OL,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Ct(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((s,i,o)=>{var l=r[o-1];return typeof l=="string"?s+l+i:l!==void 0?s+us(l)+i:s+i},"")}var Wr=e=>e===0?0:e>0?1:-1,sa=e=>typeof e=="number"&&e!=+e,mi=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!sa(e),ia=e=>Ce(e)||typeof e=="string",EL=0,_l=e=>{var t=++EL;return"".concat(e||"").concat(t)},Tn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&typeof t!="string")return n;var i;if(mi(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return sa(i)&&(i=n),s&&r!=null&&i>r&&(i=r),i},PS=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function dr(e,t,r){return Ce(e)&&Ce(t)?us(e+r*(t-e)):t}function AL(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):ao(n,t))===r)}var Qt=e=>e===null||typeof e>"u",fc=e=>Qt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ur(e){return e!=null}function Eo(){}var DL=["type","size","sizeType"];function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fh.apply(null,arguments)}function qy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qy(Object(r),!0).forEach(function(n){TL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TL(e,t,r){return(t=IL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IL(e){var t=RL(e,"string");return typeof t=="symbol"?t:t+""}function RL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $L(e,t){if(e==null)return{};var r,n,s=zL(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function zL(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var OS={symbolCircle:zx,symbolCross:tL,symbolDiamond:nL,symbolSquare:aL,symbolStar:lL,symbolTriangle:cL,symbolWye:uL},LL=Math.PI/180,FL=e=>{var t="symbol".concat(fc(e));return OS[t]||zx},BL=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*LL;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},WL=(e,t)=>{OS["symbol".concat(fc(e))]=t},ES=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,s=$L(e,DL),i=Hy(Hy({},s),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=FL(o),p=fL().type(m).size(BL(r,n,o)),x=p();if(x!==null)return x},{className:c,cx:d,cy:u}=i,f=xn(i);return Ce(d)&&Ce(u)&&Ce(r)?h.createElement("path",Fh({},f,{className:ot("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};ES.registerSymbol=WL;var AS=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,UL=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(s=>{Tx(s)&&(n[s]=i=>r[s](r,i))}),n},qL=(e,t,r)=>n=>(e(t,r,n),null),Fx=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(s=>{var i=e[s];Tx(s)&&typeof i=="function"&&(n||(n={}),n[s]=qL(i,t,r))}),n};function Ky(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ky(Object(r),!0).forEach(function(n){KL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ky(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KL(e,t,r){return(t=YL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YL(e){var t=GL(e,"string");return typeof t=="symbol"?t:t+""}function GL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ln(e,t){var r=HL({},e),n=t,s=Object.keys(t),i=s.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return i}var DS={},TS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const s=new Map;for(let i=0;i<r.length;i++){const o=r[i],l=n(o,i,r);s.has(l)||s.set(l,o)}return Array.from(s.values())}e.uniqBy=t})(TS);var IS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return function(...s){return r.apply(this,s.slice(0,n))}}e.ary=t})(IS);var Bx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Bx);var RS={},pf={},$S={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})($S);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$S;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(pf);var zS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(zS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pf,r=zS;function n(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=n})(RS);var LS={},FS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ff;function r(n){return function(s){return t.get(s,n)}}e.property=r})(FS);var BS={},Wx={},WS={},Ux={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(Ux);var qx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(qx);var Hx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.isEqualsSameValueZero=t})(Hx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ux,r=qx,n=Hx;function s(u,f,m){return typeof m!="function"?s(u,f,()=>{}):i(u,f,function p(x,g,v,y,w,N){const j=m(x,g,v,y,w,N);return j!==void 0?!!j:i(x,g,p,N)},new Map)}function i(u,f,m,p){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,m,p);case"function":return Object.keys(f).length>0?i(u,{...f},m,p):n.isEqualsSameValueZero(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.isEqualsSameValueZero(u,f)}}function o(u,f,m,p){if(f==null)return!0;if(Array.isArray(f))return c(u,f,m,p);if(f instanceof Map)return l(u,f,m,p);if(f instanceof Set)return d(u,f,m,p);const x=Object.keys(f);if(u==null||r.isPrimitive(u))return x.length===0;if(x.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===u;p==null||p.set(f,u);try{for(let g=0;g<x.length;g++){const v=x[g];if(!r.isPrimitive(u)&&!(v in u)||f[v]===void 0&&u[v]!==void 0||f[v]===null&&u[v]!==null||!m(u[v],f[v],v,u,f,p))return!1}return!0}finally{p==null||p.delete(f)}}function l(u,f,m,p){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[x,g]of f.entries()){const v=u.get(x);if(m(v,g,x,u,f,p)===!1)return!1}return!0}function c(u,f,m,p){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const x=new Set;for(let g=0;g<f.length;g++){const v=f[g];let y=!1;for(let w=0;w<u.length;w++){if(x.has(w))continue;const N=u[w];let j=!1;if(m(N,v,g,u,f,p)&&(j=!0),j){x.add(w),y=!0;break}}if(!y)return!1}return!0}function d(u,f,m,p){return f.size===0?!0:u instanceof Set?c([...u],[...f],m,p):!1}e.isMatchWith=s,e.isSetMatch=d})(WS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WS;function r(n,s){return t.isMatchWith(n,s,()=>{})}e.isMatch=r})(Wx);var US={},Kx={},qS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(qS);var xf={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(xf);var Yx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",s="[object Boolean]",i="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",m="[object ArrayBuffer]",p="[object Object]",x="[object Error]",g="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",w="[object Uint16Array]",N="[object Uint32Array]",j="[object BigUint64Array]",k="[object Int8Array]",b="[object Int16Array]",S="[object Int32Array]",_="[object BigInt64Array]",C="[object Float32Array]",P="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=_,e.bigUint64ArrayTag=j,e.booleanTag=s,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=C,e.float64ArrayTag=P,e.functionTag=f,e.int16ArrayTag=b,e.int32ArrayTag=S,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=n,e.objectTag=p,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=w,e.uint32ArrayTag=N,e.uint8ArrayTag=v,e.uint8ClampedArrayTag=y})(Yx);var HS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(HS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qS,r=xf,n=Yx,s=qx,i=HS;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,p=new Map,x=void 0){const g=x==null?void 0:x(u,f,m,p);if(g!==void 0)return g;if(s.isPrimitive(u))return u;if(p.has(u))return p.get(u);if(Array.isArray(u)){const v=new Array(u.length);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);return Object.hasOwn(u,"index")&&(v.index=u.index),Object.hasOwn(u,"input")&&(v.input=u.input),v}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const v=new RegExp(u.source,u.flags);return v.lastIndex=u.lastIndex,v}if(u instanceof Map){const v=new Map;p.set(u,v);for(const[y,w]of u)v.set(y,l(w,y,m,p,x));return v}if(u instanceof Set){const v=new Set;p.set(u,v);for(const y of u)v.add(l(y,void 0,m,p,x));return v}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(i.isTypedArray(u)){const v=new(Object.getPrototypeOf(u)).constructor(u.length);p.set(u,v);for(let y=0;y<u.length;y++)v[y]=l(u[y],y,m,p,x);return v}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const v=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return p.set(u,v),c(v,u,m,p,x),v}if(typeof File<"u"&&u instanceof File){const v=new File([u],u.name,{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(typeof Blob<"u"&&u instanceof Blob){const v=new Blob([u],{type:u.type});return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Error){const v=new u.constructor;return p.set(u,v),v.message=u.message,v.name=u.name,v.stack=u.stack,v.cause=u.cause,c(v,u,m,p,x),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof Number){const v=new Number(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(u instanceof String){const v=new String(u.valueOf());return p.set(u,v),c(v,u,m,p,x),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return p.set(u,v),c(v,u,m,p,x),v}return u}function c(u,f,m=u,p,x){const g=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<g.length;v++){const y=g[v],w=Object.getOwnPropertyDescriptor(u,y);(w==null||w.writable)&&(u[y]=l(f[y],y,m,p,x))}}function d(u){switch(r.getTag(u)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(Kx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kx;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(US);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wx,r=US;function n(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=n})(BS);var KS={},YS={},GS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kx,r=xf,n=Yx;function s(i,o){return t.cloneDeepWith(i,(l,c,d,u)=>{const f=o==null?void 0:o(l,c,d,u);if(f!==void 0)return f;if(typeof i=="object"){if(r.getTag(i)===n.objectTag&&typeof i.constructor!="function"){const m={};return u.set(i,m),t.copyProperties(m,i,d,u),m}switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const m=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(m,i),m}case n.argumentsTag:{const m={};return t.copyProperties(m,i),m.length=i.length,m[Symbol.iterator]=i[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=s})(GS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GS;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(YS);var VS={},Gx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,s=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<s;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(Gx);var XS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xf;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(XS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lx,r=Gx,n=XS,s=hf;function i(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=s.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let u=0;u<c.length;u++){const f=c[u];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||n.isArguments(d))&&r.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=i})(VS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wx,r=mf,n=YS,s=ff,i=VS;function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=r.toKey(l);break}}return c=n.cloneDeep(c),function(d){const u=s.get(d,l);return u===void 0?i.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=o})(KS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bx,r=FS,n=BS,s=KS;function i(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?s.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=i})(LS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TS,r=IS,n=Bx,s=RS,i=LS;function o(l,c=n.identity){return s.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(DS);var VL=DS.uniqBy;const Yy=Ua(VL);function XL(e,t,r){return t===!0?Yy(e,r):typeof t=="function"?Yy(e,t):e}var Vx=h.createContext(null),QL=e=>e,Et=()=>{var e=h.useContext(Vx);return e?e.store.dispatch:QL},xd=()=>{},ZL=()=>xd,JL=(e,t)=>e===t;function De(e){var t=h.useContext(Vx),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:xd,[t,e]);return AE.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ZL,t?t.store.getState:xd,t?t.store.getState:xd,r,JL)}function eF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function tF(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rF(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Gy=e=>Array.isArray(e)?e:[e];function nF(e){const t=Array.isArray(e[0])?e[0]:e;return rF(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function aF(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var sF=class{constructor(e){this.value=e}deref(){return this.value}},iF=typeof WeakRef<"u"?WeakRef:sF,oF=0,Vy=1;function Kc(){return{s:oF,v:void 0,o:null,p:null}}function QS(e,t={}){let r=Kc();const{resultEqualityCheck:n}=t;let s,i=0;function o(){var f;let l=r;const{length:c}=arguments;for(let m=0,p=c;m<p;m++){const x=arguments[m];if(typeof x=="function"||typeof x=="object"&&x!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(x);v===void 0?(l=Kc(),g.set(x,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(x);v===void 0?(l=Kc(),g.set(x,l)):l=v}}const d=l;let u;if(l.s===Vy)u=l.v;else if(u=e.apply(null,arguments),i++,n){const m=((f=s==null?void 0:s.deref)==null?void 0:f.call(s))??s;m!=null&&n(m,u)&&(u=m,i!==0&&i--),s=typeof u=="object"&&u!==null||typeof u=="function"?new iF(u):u}return d.s=Vy,d.v=u,u}return o.clearCache=()=>{r=Kc(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function lF(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...s)=>{let i=0,o=0,l,c={},d=s.pop();typeof d=="object"&&(c=d,d=s.pop()),eF(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:p=QS,argsMemoizeOptions:x=[]}=u,g=Gy(m),v=Gy(x),y=nF(s),w=f(function(){return i++,d.apply(null,arguments)},...g),N=p(function(){o++;const k=aF(y,arguments);return l=w.apply(null,k),l},...v);return Object.assign(N,{resultFunc:d,memoizedResultFunc:w,dependencies:y,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var te=lF(QS),cF=Object.assign((e,t=te)=>{tF(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((o,l,c)=>(o[r[c]]=l,o),{}))},{withTypes:()=>cF}),ZS={},JS={},e2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,s,i)=>{if(n!==s){const o=t(n),l=t(s);if(o===l&&o===0){if(n<s)return i==="desc"?1:-1;if(n>s)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};e.compareValues=r})(e2);var t2={},Xx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Xx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xx,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function s(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!r.test(i))||o!=null&&Object.hasOwn(o,i)}e.isKey=s})(t2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e2,r=t2,n=hf;function s(i,o,l,c){if(i==null)return[];l=c?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(p=>String(p));const d=(p,x)=>{let g=p;for(let v=0;v<x.length&&g!=null;++v)g=g[x[v]];return g},u=(p,x)=>x==null||p==null?x:typeof p=="object"&&"key"in p?Object.hasOwn(x,p.key)?x[p.key]:d(x,p.path):typeof p=="function"?p(x):Array.isArray(p)?d(x,p):typeof x=="object"?x[p]:x,f=o.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||r.isKey(p)?p:{key:p,path:n.toPath(p)}));return i.map(p=>({original:p,criteria:f.map(x=>u(x,p))})).slice().sort((p,x)=>{for(let g=0;g<f.length;g++){const v=t.compareValues(p.criteria[g],x.criteria[g],l[g]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=s})(JS);var r2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const s=[],i=Math.floor(n),o=(l,c)=>{for(let d=0;d<l.length;d++){const u=l[d];Array.isArray(u)&&c<i?o(u,c+1):s.push(u)}};return o(r,0),s}e.flatten=t})(r2);var Qx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Gx,r=pf,n=Ux,s=Hx;function i(o,l,c){return n.isObject(c)&&(typeof l=="number"&&r.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?s.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=i})(Qx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JS,r=r2,n=Qx;function s(i,...o){const l=o.length;return l>1&&n.isIterateeCall(i,o[0],o[1])?o=[]:l>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(i,r.flatten(o),["asc"])}e.sortBy=s})(ZS);var dF=ZS.sortBy;const gf=Ua(dF);var n2=e=>e.legend.settings,uF=e=>e.legend.size,fF=e=>e.legend.payload;te([fF,n2],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?gf(n,r):n});var Yc=1;function mF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=h.useState({height:0,left:0,top:0,width:0}),n=h.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),o={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(o.height-t.height)>Yc||Math.abs(o.left-t.left)>Yc||Math.abs(o.top-t.top)>Yc||Math.abs(o.width-t.width)>Yc)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function lr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hF=typeof Symbol=="function"&&Symbol.observable||"@@observable",Xy=hF,Um=()=>Math.random().toString(36).substring(7).split("").join("."),pF={INIT:`@@redux/INIT${Um()}`,REPLACE:`@@redux/REPLACE${Um()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Um()}`},zd=pF;function Zx(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function a2(e,t,r){if(typeof e!="function")throw new Error(lr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(lr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(lr(1));return r(a2)(e,t)}let n=e,s=t,i=new Map,o=i,l=0,c=!1;function d(){o===i&&(o=new Map,i.forEach((v,y)=>{o.set(y,v)}))}function u(){if(c)throw new Error(lr(3));return s}function f(v){if(typeof v!="function")throw new Error(lr(4));if(c)throw new Error(lr(5));let y=!0;d();const w=l++;return o.set(w,v),function(){if(y){if(c)throw new Error(lr(6));y=!1,d(),o.delete(w),i=null}}}function m(v){if(!Zx(v))throw new Error(lr(7));if(typeof v.type>"u")throw new Error(lr(8));if(typeof v.type!="string")throw new Error(lr(17));if(c)throw new Error(lr(9));try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(w=>{w()}),v}function p(v){if(typeof v!="function")throw new Error(lr(10));n=v,m({type:zd.REPLACE})}function x(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(lr(11));function w(){const j=y;j.next&&j.next(u())}return w(),{unsubscribe:v(w)}},[Xy](){return this}}}return m({type:zd.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:p,[Xy]:x}}function xF(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:zd.INIT})>"u")throw new Error(lr(12));if(typeof r(void 0,{type:zd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(lr(13))})}function s2(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const o=t[i];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let s;try{xF(r)}catch(i){s=i}return function(o={},l){if(s)throw s;let c=!1;const d={};for(let u=0;u<n.length;u++){const f=n[u],m=r[f],p=o[f],x=m(p,l);if(typeof x>"u")throw l&&l.type,new Error(lr(14));d[f]=x,c=c||x!==p}return c=c||n.length!==Object.keys(o).length,c?d:o}}function Ld(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function gF(...e){return t=>(r,n)=>{const s=t(r,n);let i=()=>{throw new Error(lr(15))};const o={getState:s.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=Ld(...l)(s.dispatch),{...s,dispatch:i}}}function i2(e){return Zx(e)&&"type"in e&&typeof e.type=="string"}var o2=Symbol.for("immer-nothing"),Qy=Symbol.for("immer-draftable"),Tr=Symbol.for("immer-state");function Sn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rn=Object,so=rn.getPrototypeOf,Fd="constructor",vf="prototype",Bh="configurable",Bd="enumerable",gd="writable",Ml="value",Ra=e=>!!e&&!!e[Tr];function In(e){var t;return e?l2(e)||bf(e)||!!e[Qy]||!!((t=e[Fd])!=null&&t[Qy])||wf(e)||jf(e):!1}var vF=rn[vf][Fd].toString(),Zy=new WeakMap;function l2(e){if(!e||!Jx(e))return!1;const t=so(e);if(t===null||t===rn[vf])return!0;const r=rn.hasOwnProperty.call(t,Fd)&&t[Fd];if(r===Object)return!0;if(!Bi(r))return!1;let n=Zy.get(r);return n===void 0&&(n=Function.toString.call(r),Zy.set(r,n)),n===vF}function yf(e,t,r=!0){mc(e)===0?(r?Reflect.ownKeys(e):rn.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function mc(e){const t=e[Tr];return t?t.type_:bf(e)?1:wf(e)?2:jf(e)?3:0}var Jy=(e,t,r=mc(e))=>r===2?e.has(t):rn[vf].hasOwnProperty.call(e,t),Wh=(e,t,r=mc(e))=>r===2?e.get(t):e[t],Wd=(e,t,r,n=mc(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function yF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var bf=Array.isArray,wf=e=>e instanceof Map,jf=e=>e instanceof Set,Jx=e=>typeof e=="object",Bi=e=>typeof e=="function",qm=e=>typeof e=="boolean";function bF(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var wa=e=>e.copy_||e.base_,eg=e=>e.modified_?e.copy_:e.base_;function Uh(e,t){if(wf(e))return new Map(e);if(jf(e))return new Set(e);if(bf(e))return Array[vf].slice.call(e);const r=l2(e);if(t===!0||t==="class_only"&&!r){const n=rn.getOwnPropertyDescriptors(e);delete n[Tr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l[gd]===!1&&(l[gd]=!0,l[Bh]=!0),(l.get||l.set)&&(n[o]={[Bh]:!0,[gd]:!0,[Bd]:l[Bd],[Ml]:e[o]})}return rn.create(so(e),n)}else{const n=so(e);if(n!==null&&r)return{...e};const s=rn.create(n);return rn.assign(s,e)}}function tg(e,t=!1){return Nf(e)||Ra(e)||!In(e)||(mc(e)>1&&rn.defineProperties(e,{set:Gc,add:Gc,clear:Gc,delete:Gc}),rn.freeze(e),t&&yf(e,(r,n)=>{tg(n,!0)},!1)),e}function wF(){Sn(2)}var Gc={[Ml]:wF};function Nf(e){return e===null||!Jx(e)?!0:rn.isFrozen(e)}var Ud="MapSet",qh="Patches",e0="ArrayMethods",c2={};function hi(e){const t=c2[e];return t||Sn(0,e),t}var t0=e=>!!c2[e],Pl,d2=()=>Pl,jF=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:t0(Ud)?hi(Ud):void 0,arrayMethodsPlugin_:t0(e0)?hi(e0):void 0});function r0(e,t){t&&(e.patchPlugin_=hi(qh),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hh(e){Kh(e),e.drafts_.forEach(NF),e.drafts_=null}function Kh(e){e===Pl&&(Pl=e.parent_)}var n0=e=>Pl=jF(Pl,e);function NF(e){const t=e[Tr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function a0(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Tr].modified_&&(Hh(t),Sn(4)),In(e)&&(e=s0(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[Tr].base_,e,t)}else e=s0(t,r);return kF(t,e,!0),Hh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==o2?e:void 0}function s0(e,t){if(Nf(t))return t;const r=t[Tr];if(!r)return qd(t,e.handledSet_,e);if(!kf(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);m2(r,e)}return r.copy_}function kF(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tg(t,r)}function u2(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var kf=(e,t)=>e.scope_===t,SF=[];function f2(e,t,r,n){const s=wa(e),i=e.type_;if(n!==void 0&&Wh(s,n,i)===t){Wd(s,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;yf(s,(c,d)=>{if(Ra(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??SF;for(const l of o)Wd(s,l,r,i)}function CF(e,t,r){e.callbacks_.push(function(s){var l;const i=t;if(!i||!kf(i,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(i);const o=eg(i);f2(e,i.draft_??i,o,r),m2(i,s)})}function m2(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}u2(e)}}function _F(e,t,r){const{scope_:n}=e;if(Ra(r)){const s=r[Tr];kf(s,n)&&s.callbacks_.push(function(){vd(e);const o=eg(s);f2(e,r,o,t)})}else In(r)&&e.callbacks_.push(function(){const i=wa(e);e.type_===3?i.has(r)&&qd(r,n.handledSet_,n):Wh(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&qd(Wh(e.copy_,t,e.type_),n.handledSet_,n)})}function qd(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Ra(e)||t.has(e)||!In(e)||Nf(e)||(t.add(e),yf(e,(n,s)=>{if(Ra(s)){const i=s[Tr];if(kf(i,r)){const o=eg(i);Wd(e,n,o,e.type_),u2(i)}}else In(s)&&qd(s,t,r)})),e}function MF(e,t){const r=bf(e),n={type_:r?1:0,scope_:t?t.scope_:d2(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=n,i=Hd;r&&(s=[n],i=Ol);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,[l,n]}var Hd={get(e,t){if(t===Tr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=wa(e);if(!Jy(s,t,e.type_))return PF(e,s,t);const i=s[t];if(e.finalized_||!In(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&bF(t))return i;if(i===Hm(e.base_,t)){vd(e);const o=e.type_===1?+t:t,l=Gh(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in wa(e)},ownKeys(e){return Reflect.ownKeys(wa(e))},set(e,t,r){const n=h2(wa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Hm(wa(e),t),i=s==null?void 0:s[Tr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(yF(r,s)&&(r!==void 0||Jy(e.base_,t,e.type_)))return!0;vd(e),Yh(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),_F(e,t,r)),!0},deleteProperty(e,t){return vd(e),Hm(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Yh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=wa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[gd]:!0,[Bh]:e.type_!==1||t!=="length",[Bd]:n[Bd],[Ml]:r[t]}},defineProperty(){Sn(11)},getPrototypeOf(e){return so(e.base_)},setPrototypeOf(){Sn(12)}},Ol={};for(let e in Hd){let t=Hd[e];Ol[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Ol.deleteProperty=function(e,t){return Ol.set.call(this,e,t,void 0)};Ol.set=function(e,t,r){return Hd.set.call(this,e[0],t,r,e[0])};function Hm(e,t){const r=e[Tr];return(r?wa(r):e)[t]}function PF(e,t,r){var s;const n=h2(t,r);return n?Ml in n?n[Ml]:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function h2(e,t){if(!(t in e))return;let r=so(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=so(r)}}function Yh(e){e.modified_||(e.modified_=!0,e.parent_&&Yh(e.parent_))}function vd(e){e.copy_||(e.assigned_=new Map,e.copy_=Uh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var OF=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,s)=>{if(Bi(r)&&!Bi(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}Bi(n)||Sn(6),s!==void 0&&!Bi(s)&&Sn(7);let i;if(In(r)){const o=n0(this),l=Gh(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?Hh(o):Kh(o)}return r0(o,s),a0(i,o)}else if(!r||!Jx(r)){if(i=n(r),i===void 0&&(i=r),i===o2&&(i=void 0),this.autoFreeze_&&tg(i,!0),s){const o=[],l=[];hi(qh).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),s(o,l)}return i}else Sn(1,r)},this.produceWithPatches=(r,n)=>{if(Bi(r))return(l,...c)=>this.produceWithPatches(l,d=>r(d,...c));let s,i;return[this.produce(r,n,(l,c)=>{s=l,i=c}),s,i]},qm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),qm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),qm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){In(t)||Sn(8),Ra(t)&&(t=En(t));const r=n0(this),n=Gh(r,t,void 0);return n[Tr].isManual_=!0,Kh(r),n}finishDraft(t,r){const n=t&&t[Tr];(!n||!n.isManual_)&&Sn(9);const{scope_:s}=n;return r0(s,r),a0(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const i=r[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(r=r.slice(n+1));const s=hi(qh).applyPatches_;return Ra(t)?s(t,r):this.produce(t,i=>s(i,r))}};function Gh(e,t,r,n){const[s,i]=wf(t)?hi(Ud).proxyMap_(t,r):jf(t)?hi(Ud).proxySet_(t,r):MF(t,r);return((r==null?void 0:r.scope_)??d2()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?CF(r,i,n):i.callbacks_.push(function(c){var u;(u=c.mapSetPlugin_)==null||u.fixSetContents(i);const{patchPlugin_:d}=c;i.modified_&&d&&d.generatePatches_(i,[],c)}),s}function En(e){return Ra(e)||Sn(10,e),p2(e)}function p2(e){if(!In(e)||Nf(e))return e;const t=e[Tr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Uh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Uh(e,!0);return yf(r,(s,i)=>{Wd(r,s,p2(i))},n),t&&(t.finalized_=!1),r}var EF=new OF,x2=EF.produce;function g2(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var AF=g2(),DF=g2,TF=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ld:Ld.apply(null,arguments)};function gn(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(nn(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>i2(n)&&n.type===e,r}var v2=class pl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,pl.prototype)}static get[Symbol.species](){return pl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new pl(...t[0].concat(this)):new pl(...t.concat(this))}};function i0(e){return In(e)?x2(e,()=>{}):e}function Vc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function IF(e){return typeof e=="boolean"}var RF=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new v2;return r&&(IF(r)?o.push(AF):o.push(DF(r.extraArgument))),o},y2="RTK_autoBatch",gt=()=>e=>({payload:e,meta:{[y2]:!0}}),o0=e=>t=>{setTimeout(t,e)},b2=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let s=!0,i=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:o0(10):e.type==="callback"?e.queueNotification:o0(e.timeout),d=()=>{o=!1,i&&(i=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>s&&u(),m=n.subscribe(f);return l.add(u),()=>{m(),l.delete(u)}},dispatch(u){var f;try{return s=!((f=u==null?void 0:u.meta)!=null&&f[y2]),i=!s,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{s=!0}}})},$F=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new v2(e);return n&&s.push(b2(typeof n=="object"?n:void 0)),s};function zF(e){const t=RF(),{reducer:r=void 0,middleware:n,devTools:s=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Zx(r))l=s2(r);else throw new Error(nn(1));let c;typeof n=="function"?c=n(t):c=t();let d=Ld;s&&(d=TF({trace:!1,...typeof s=="object"&&s}));const u=gF(...c),f=$F(u);let m=typeof o=="function"?o(f):f();const p=d(...m);return a2(l,i,p)}function w2(e){const t={},r=[];let n;const s={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(nn(28));if(l in t)throw new Error(nn(29));return t[l]=o,s},addAsyncThunk(i,o){return o.pending&&(t[i.pending.type]=o.pending),o.rejected&&(t[i.rejected.type]=o.rejected),o.fulfilled&&(t[i.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:i.settled,reducer:o.settled}),s},addMatcher(i,o){return r.push({matcher:i,reducer:o}),s},addDefaultCase(i){return n=i,s}};return e(s),[t,r,n]}function LF(e){return typeof e=="function"}function FF(e,t){let[r,n,s]=w2(t),i;if(LF(e))i=()=>i0(e());else{const l=i0(e);i=()=>l}function o(l=i(),c){let d=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[s]),d.reduce((u,f)=>{if(f)if(Ra(u)){const p=f(u,c);return p===void 0?u:p}else{if(In(u))return x2(u,m=>f(m,c));{const m=f(u,c);if(m===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return u},l)}return o.getInitialState=i,o}var BF="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",WF=(e=21)=>{let t="",r=e;for(;r--;)t+=BF[Math.random()*64|0];return t},UF=Symbol.for("rtk-slice-createasyncthunk");function qF(e,t){return`${e}/${t}`}function HF({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[UF];return function(s){const{name:i,reducerPath:o=i}=s;if(!i)throw new Error(nn(11));const l=(typeof s.reducers=="function"?s.reducers(YF()):s.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(j,k){const b=typeof j=="string"?j:j.type;if(!b)throw new Error(nn(12));if(b in d.sliceCaseReducersByType)throw new Error(nn(13));return d.sliceCaseReducersByType[b]=k,u},addMatcher(j,k){return d.sliceMatchers.push({matcher:j,reducer:k}),u},exposeAction(j,k){return d.actionCreators[j]=k,u},exposeCaseReducer(j,k){return d.sliceCaseReducersByName[j]=k,u}};c.forEach(j=>{const k=l[j],b={reducerName:j,type:qF(i,j),createNotation:typeof s.reducers=="function"};VF(k)?QF(b,k,u,t):GF(b,k,u)});function f(){const[j={},k=[],b=void 0]=typeof s.extraReducers=="function"?w2(s.extraReducers):[s.extraReducers],S={...j,...d.sliceCaseReducersByType};return FF(s.initialState,_=>{for(let C in S)_.addCase(C,S[C]);for(let C of d.sliceMatchers)_.addMatcher(C.matcher,C.reducer);for(let C of k)_.addMatcher(C.matcher,C.reducer);b&&_.addDefaultCase(b)})}const m=j=>j,p=new Map,x=new WeakMap;let g;function v(j,k){return g||(g=f()),g(j,k)}function y(){return g||(g=f()),g.getInitialState()}function w(j,k=!1){function b(_){let C=_[j];return typeof C>"u"&&k&&(C=Vc(x,b,y)),C}function S(_=m){const C=Vc(p,k,()=>new WeakMap);return Vc(C,_,()=>{const P={};for(const[D,E]of Object.entries(s.selectors??{}))P[D]=KF(E,_,()=>Vc(x,_,y),k);return P})}return{reducerPath:j,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const N={name:i,reducer:v,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:y,...w(o),injectInto(j,{reducerPath:k,...b}={}){const S=k??o;return j.inject({reducerPath:S,reducer:v},b),{...N,...w(S,!0)}}};return N}}function KF(e,t,r,n){function s(i,...o){let l=t(i);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return s.unwrapped=e,s}var Xr=HF();function YF(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function GF({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!XF(n))throw new Error(nn(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?gn(e,o):gn(e))}function VF(e){return e._reducerDefinitionType==="asyncThunk"}function XF(e){return e._reducerDefinitionType==="reducerWithPrepare"}function QF({type:e,reducerName:t},r,n,s){if(!s)throw new Error(nn(18));const{payloadCreator:i,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=s(e,i,u);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),l&&n.addCase(f.pending,l),c&&n.addCase(f.rejected,c),d&&n.addMatcher(f.settled,d),n.exposeCaseReducer(t,{fulfilled:o||Xc,pending:l||Xc,rejected:c||Xc,settled:d||Xc})}function Xc(){}var ZF="task",j2="listener",N2="completed",rg="cancelled",JF=`task-${rg}`,e8=`task-${N2}`,Vh=`${j2}-${rg}`,t8=`${j2}-${N2}`,Sf=class{constructor(e){fm(this,"name","TaskAbortError");fm(this,"message");this.code=e,this.message=`${ZF} ${rg} (reason: ${e})`}},ng=(e,t)=>{if(typeof e!="function")throw new TypeError(nn(32))},Kd=()=>{},k2=(e,t=Kd)=>(e.catch(t),e),S2=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ti=e=>{if(e.aborted)throw new Sf(e.reason)};function C2(e,t){let r=Kd;return new Promise((n,s)=>{const i=()=>s(new Sf(e.reason));if(e.aborted){i();return}r=S2(e,i),t.finally(()=>r()).then(n,s)}).finally(()=>{r=Kd})}var r8=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Sf?"cancelled":"rejected",error:r}}finally{t==null||t()}},Yd=e=>t=>k2(C2(e,t).then(r=>(ti(e),r))),_2=e=>{const t=Yd(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Gi}=Object,l0={},Cf="listenerMiddleware",n8=(e,t)=>{const r=n=>S2(e,()=>n.abort(e.reason));return(n,s)=>{ng(n);const i=new AbortController;r(i);const o=r8(async()=>{ti(e),ti(i.signal);const l=await n({pause:Yd(i.signal),delay:_2(i.signal),signal:i.signal});return ti(i.signal),l},()=>i.abort(e8));return s!=null&&s.autoJoin&&t.push(o.catch(Kd)),{result:Yd(e)(o),cancel(){i.abort(JF)}}}},a8=(e,t)=>{const r=async(n,s)=>{ti(t);let i=()=>{};const l=[new Promise((c,d)=>{let u=e({predicate:n,effect:(f,m)=>{m.unsubscribe(),c([f,m.getState(),m.getOriginalState()])}});i=()=>{u(),d()}})];s!=null&&l.push(new Promise(c=>setTimeout(c,s,null)));try{const c=await C2(t,Promise.race(l));return ti(t),c}finally{i()}};return(n,s)=>k2(r(n,s))},M2=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=gn(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(nn(21));return ng(i),{predicate:s,type:t,effect:i}},P2=Gi(e=>{const{type:t,predicate:r,effect:n}=M2(e);return{id:WF(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(nn(22))}}},{withTypes:()=>P2}),c0=(e,t)=>{const{type:r,effect:n,predicate:s}=M2(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===n)},Xh=e=>{e.pending.forEach(t=>{t.abort(Vh)})},s8=(e,t)=>()=>{for(const r of t.keys())Xh(r);e.clear()},d0=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},O2=Gi(gn(`${Cf}/add`),{withTypes:()=>O2}),i8=gn(`${Cf}/removeAll`),E2=Gi(gn(`${Cf}/remove`),{withTypes:()=>E2}),o8=(...e)=>{console.error(`${Cf}/error`,...e)},hc=(e={})=>{const t=new Map,r=new Map,n=p=>{const x=r.get(p)??0;r.set(p,x+1)},s=p=>{const x=r.get(p)??1;x===1?r.delete(p):r.set(p,x-1)},{extra:i,onError:o=o8}=e;ng(o);const l=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),x=>{p.unsubscribe(),x!=null&&x.cancelActive&&Xh(p)}),c=p=>{const x=c0(t,p)??P2(p);return l(x)};Gi(c,{withTypes:()=>c});const d=p=>{const x=c0(t,p);return x&&(x.unsubscribe(),p.cancelActive&&Xh(x)),!!x};Gi(d,{withTypes:()=>d});const u=async(p,x,g,v)=>{const y=new AbortController,w=a8(c,y.signal),N=[];try{p.pending.add(y),n(p),await Promise.resolve(p.effect(x,Gi({},g,{getOriginalState:v,condition:(j,k)=>w(j,k).then(Boolean),take:w,delay:_2(y.signal),pause:Yd(y.signal),extra:i,signal:y.signal,fork:n8(y.signal,N),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((j,k,b)=>{j!==y&&(j.abort(Vh),b.delete(j))})},cancel:()=>{y.abort(Vh),p.pending.delete(y)},throwIfCancelled:()=>{ti(y.signal)}})))}catch(j){j instanceof Sf||d0(o,j,{raisedBy:"effect"})}finally{await Promise.all(N),y.abort(t8),s(p),p.pending.delete(y)}},f=s8(t,r);return{middleware:p=>x=>g=>{if(!i2(g))return x(g);if(O2.match(g))return c(g.payload);if(i8.match(g)){f();return}if(E2.match(g))return d(g.payload);let v=p.getState();const y=()=>{if(v===l0)throw new Error(nn(23));return v};let w;try{if(w=x(g),t.size>0){const N=p.getState(),j=Array.from(t.values());for(const k of j){let b=!1;try{b=k.predicate(g,N,v)}catch(S){b=!1,d0(o,S,{raisedBy:"predicate"})}b&&u(k,g,p,y)}}}finally{v=l0}return w},startListening:c,stopListening:d,clearListeners:f}};function nn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l8={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},A2=Xr({name:"chartLayout",initialState:l8,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:c8,setLayout:d8,setChartSize:u8,setScale:f8}=A2.actions,m8=A2.reducer;function D2(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Ge(e){return Number.isFinite(e)}function oa(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function u0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u0(Object(r),!0).forEach(function(n){h8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function h8(e,t,r){return(t=p8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p8(e){var t=x8(e,"string");return typeof t=="symbol"?t:t+""}function x8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mr(e,t,r){return Qt(e)||Qt(t)?r:ia(t)?ao(e,t,r):typeof t=="function"?t(e):r}var g8=(e,t,r)=>{if(t&&r){var{width:n,height:s}=r,{align:i,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&i!=="center"&&Ce(e[i]))return Wi(Wi({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&Ce(e[o]))return Wi(Wi({},e),{},{[o]:e[o]+(s||0)})}return e},Ms=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",T2=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var s,i,o=e.map(l=>(l.coordinate===t&&(s=!0),l.coordinate===r&&(i=!0),l.coordinate));return s||o.push(t),i||o.push(r),o},I2=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:s,range:i,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:m,axisType:p}=e;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,g=s==="category"&&o.bandwidth?o.bandwidth()/x:0;if(g=p==="angleAxis"&&i&&i.length>=2?Wr(i[0]-i[1])*2*g:g,f||m){var v=(f||m||[]).map((y,w)=>{var N=n?n.indexOf(y):y,j=o.map(N);return Ge(j)?{coordinate:j+g,value:y,offset:g,index:w}:null}).filter(Ur);return v}return c&&d?d.map((y,w)=>{var N=o.map(y);return Ge(N)?{coordinate:N+g,value:y,index:w,offset:g}:null}).filter(Ur):o.ticks&&u!=null?o.ticks(u).map((y,w)=>{var N=o.map(y);return Ge(N)?{coordinate:N+g,value:y,index:w,offset:g}:null}).filter(Ur):o.domain().map((y,w)=>{var N=o.map(y);return Ge(N)?{coordinate:N+g,value:n?n[y]:y,index:w,offset:g}:null}).filter(Ur)},v8=(e,t)=>{if(!t||t.length!==2||!Ce(t[0])||!Ce(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),s=[e[0],e[1]];return(!Ce(e[0])||e[0]<r)&&(s[0]=r),(!Ce(e[1])||e[1]>n)&&(s[1]=n),s[0]>n&&(s[0]=n),s[1]<r&&(s[1]=r),s},y8=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0,l=0;l<r;++l){var c=e[l],d=c==null?void 0:c[s];if(d!=null){var u=d[1],f=d[0],m=sa(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},b8=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var s=0;s<n;++s)for(var i=0,o=0;o<r;++o){var l=e[o],c=l==null?void 0:l[s];if(c!=null){var d=sa(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},w8={sign:y8,expand:CL,none:fi,silhouette:_L,wiggle:ML,positive:b8},j8=(e,t,r)=>{var n,s=(n=w8[r])!==null&&n!==void 0?n:fi,i=SL().keys(t).value((l,c)=>Number(mr(l,c,0))).order(Lh).offset(s),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=mr(e[u],t[c],0);Array.isArray(f)&&f.length===2&&Ce(f[0])&&Ce(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function N8(e){return e==null?void 0:String(e)}var f0=e=>{var{axis:t,ticks:r,offset:n,bandSize:s,entry:i,index:o}=e;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var l=mr(i,t.dataKey,t.scale.domain()[o]);if(Qt(l))return null;var c=t.scale.map(l);return Ce(c)?c-s/2+n:null},k8=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return n<=0&&s>=0?0:s<0?s:n}return r[0]},S8=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},C8=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],_8=(e,t,r)=>{if(e!=null)return C8(Object.keys(e).reduce((n,s)=>{var i=e[s];if(!i)return n;var{stackedData:o}=i,l=o.reduce((c,d)=>{var u=D2(d,t,r),f=S8(u);return!Ge(f[0])||!Ge(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},m0=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,h0=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Gd=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var s=gf(t,u=>u.coordinate),i=1/0,o=1,l=s.length;o<l;o++){var c=s[o],d=s[o-1];i=Math.min(((c==null?void 0:c.coordinate)||0)-((d==null?void 0:d.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function p0(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:s,name:i}=e;return Wi(Wi({},t),{},{dataKey:r,payload:n,value:s,name:i})}function R2(e,t){if(e)return String(e);if(typeof t=="string")return t}var M8=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},P8=(e,t)=>t==="centric"?e.angle:e.radius,Qa=e=>e.layout.width,Za=e=>e.layout.height,O8=e=>e.layout.scale,$2=e=>e.layout.margin,_f=te(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Mf=te(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),E8="data-recharts-item-index",A8="data-recharts-item-id",pc=60;function x0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x0(Object(r),!0).forEach(function(n){D8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function D8(e,t,r){return(t=T8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T8(e){var t=I8(e,"string");return typeof t=="symbol"?t:t+""}function I8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R8=e=>e.brush.height;function $8(e){var t=Mf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:pc;return r+s}return r},0)}function z8(e){var t=Mf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:pc;return r+s}return r},0)}function L8(e){var t=_f(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function F8(e){var t=_f(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Zt=te([Qa,Za,$2,R8,$8,z8,L8,F8,n2,uF],(e,t,r,n,s,i,o,l,c,d)=>{var u={left:(r.left||0)+s,right:(r.right||0)+i},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},m=Qc(Qc({},f),u),p=m.bottom;m.bottom+=n,m=g8(m,c,d);var x=e-m.left-m.right,g=t-m.top-m.bottom;return Qc(Qc({brushBottom:p},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),B8=te(Zt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),ag=te(Qa,Za,(e,t)=>({x:0,y:0,width:e,height:t})),W8=h.createContext(null),Qr=()=>h.useContext(W8)!=null,Pf=e=>e.brush,Of=te([Pf,Zt,$2],(e,t,r)=>({height:e.height,x:Ce(e.x)?e.x:t.left,y:Ce(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ce(e.width)?e.width:t.width})),z2={},L2={},F2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:s,edges:i}={}){let o,l=null;const c=i!=null&&i.includes("leading"),d=i==null||i.includes("trailing"),u=()=>{l!==null&&(r.apply(o,l),o=void 0,l=null)},f=()=>{d&&u(),g()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},x=()=>{m!==null&&(clearTimeout(m),m=null)},g=()=>{x(),o=void 0,l=null},v=()=>{u()},y=function(...w){if(s!=null&&s.aborted)return;o=this,l=w;const N=m==null;p(),c&&N&&u()};return y.schedule=p,y.cancel=g,y.flush=v,s==null||s.addEventListener("abort",g,{once:!0}),y}e.debounce=t})(F2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F2;function r(n,s=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:l=!0,maxWait:c}=i,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let u,f=null;const m=t.debounce(function(...g){u=n.apply(this,g),f=null},s,{edges:d}),p=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,g),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,g),u)},x=()=>(m.flush(),u);return p.cancel=m.cancel,p.flush=x,p}e.debounce=r})(L2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=L2;function r(n,s=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return t.debounce(n,s,{leading:o,maxWait:s,trailing:l})}e.throttle=r})(z2);var U8=z2.throttle;const q8=Ua(U8);var Vd=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(r.replace(/%s/g,()=>s[o++]))}},Xn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},B2=(e,t,r)=>{var{width:n=Xn.width,height:s=Xn.height,aspect:i,maxHeight:o}=r,l=mi(n)?e:Number(n),c=mi(s)?t:Number(s);return i&&i>0&&(l?c=l/i:c&&(l=c*i),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},H8={width:0,height:0,overflow:"visible"},K8={width:0,overflowX:"visible"},Y8={height:0,overflowY:"visible"},G8={},V8=e=>{var{width:t,height:r}=e,n=mi(t),s=mi(r);return n&&s?H8:n?K8:s?Y8:G8};function X8(e){var{width:t,height:r,aspect:n}=e,s=t,i=r;return s===void 0&&i===void 0?(s=Xn.width,i=Xn.height):s===void 0?s=n&&n>0?void 0:Xn.width:i===void 0&&(i=n&&n>0?void 0:Xn.height),{width:s,height:i}}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qh.apply(null,arguments)}function g0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function v0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g0(Object(r),!0).forEach(function(n){Q8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q8(e,t,r){return(t=Z8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z8(e){var t=J8(e,"string");return typeof t=="symbol"?t:t+""}function J8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W2=h.createContext(Xn.initialDimension);function eB(e){return oa(e.width)&&oa(e.height)}function U2(e){var{children:t,width:r,height:n}=e,s=h.useMemo(()=>({width:r,height:n}),[r,n]);return eB(s)?h.createElement(W2.Provider,{value:s},t):null}var sg=()=>h.useContext(W2),tB=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=Xn.initialDimension,width:s,height:i,minWidth:o=Xn.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=Xn.debounce,id:f,className:m,onResize:p,style:x={}}=e,g=h.useRef(null),v=h.useRef();v.current=p,h.useImperativeHandle(t,()=>g.current);var[y,w]=h.useState({containerWidth:n.width,containerHeight:n.height}),N=h.useCallback((_,C)=>{w(P=>{var D=Math.round(_),E=Math.round(C);return P.containerWidth===D&&P.containerHeight===E?P:{containerWidth:D,containerHeight:E}})},[]);h.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return Eo;var _=E=>{var I,F=E[0];if(F!=null){var{width:Q,height:Y}=F.contentRect;N(Q,Y),(I=v.current)===null||I===void 0||I.call(v,Q,Y)}};u>0&&(_=q8(_,u,{trailing:!0,leading:!1}));var C=new ResizeObserver(_),{width:P,height:D}=g.current.getBoundingClientRect();return N(P,D),C.observe(g.current),()=>{C.disconnect()}},[N,u]);var{containerWidth:j,containerHeight:k}=y;Vd(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:b,calculatedHeight:S}=B2(j,k,{width:s,height:i,aspect:r,maxHeight:c});return Vd(b!=null&&b>0||S!=null&&S>0,`The width(%s) and height(%s) of chart should be greater than 0,
578
- please check the style of container, or the props width(%s) and height(%s),
579
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
580
- height and width.`,b,S,s,i,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:ot("recharts-responsive-container",m),style:v0(v0({},x),{},{width:s,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:g},h.createElement("div",{style:V8({width:s,height:i})},h.createElement(U2,{width:b,height:S},d)))}),rB=h.forwardRef((e,t)=>{var r=sg();if(oa(r.width)&&oa(r.height))return e.children;var{width:n,height:s}=X8({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=B2(void 0,void 0,{width:n,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return Ce(i)&&Ce(o)?h.createElement(U2,{width:i,height:o},e.children):h.createElement(tB,Qh({},e,{width:n,height:s,ref:t}))});function ig(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Ef=()=>{var e,t=Qr(),r=De(B8),n=De(Of),s=(e=De(Pf))===null||e===void 0?void 0:e.padding;return!t||!n||!s?r:{width:n.width-s.left-s.right,height:n.height-s.top-s.bottom,x:s.left,y:s.top}},nB={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},q2=()=>{var e;return(e=De(Zt))!==null&&e!==void 0?e:nB},H2=()=>De(Qa),K2=()=>De(Za),lt=e=>e.layout.layoutType,Ao=()=>De(lt),Y2=()=>{var e=Ao();if(e==="horizontal"||e==="vertical")return e},G2=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},aB=()=>{var e=Ao();return e!==void 0},xc=e=>{var t=Et(),r=Qr(),{width:n,height:s}=e,i=sg(),o=n,l=s;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:s),h.useEffect(()=>{!r&&oa(o)&&oa(l)&&t(u8({width:o,height:l}))},[t,r,o,l]),null},V2=Symbol.for("immer-nothing"),y0=Symbol.for("immer-draftable"),on=Symbol.for("immer-state");function Cn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var El=Object.getPrototypeOf;function io(e){return!!e&&!!e[on]}function pi(e){var t;return e?X2(e)||Array.isArray(e)||!!e[y0]||!!((t=e.constructor)!=null&&t[y0])||gc(e)||Df(e):!1}var sB=Object.prototype.constructor.toString(),b0=new WeakMap;function X2(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=b0.get(r);return n===void 0&&(n=Function.toString.call(r),b0.set(r,n)),n===sB}function Xd(e,t,r=!0){Af(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function Af(e){const t=e[on];return t?t.type_:Array.isArray(e)?1:gc(e)?2:Df(e)?3:0}function Zh(e,t){return Af(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q2(e,t,r){const n=Af(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function iB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function gc(e){return e instanceof Map}function Df(e){return e instanceof Set}function Fs(e){return e.copy_||e.base_}function Jh(e,t){if(gc(e))return new Map(e);if(Df(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=X2(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[on];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(n[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(El(e),n)}else{const n=El(e);if(n!==null&&r)return{...e};const s=Object.create(n);return Object.assign(s,e)}}function og(e,t=!1){return Tf(e)||io(e)||!pi(e)||(Af(e)>1&&Object.defineProperties(e,{set:Zc,add:Zc,clear:Zc,delete:Zc}),Object.freeze(e),t&&Object.values(e).forEach(r=>og(r,!0))),e}function oB(){Cn(2)}var Zc={value:oB};function Tf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var lB={};function xi(e){const t=lB[e];return t||Cn(0,e),t}var Al;function Z2(){return Al}function cB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function w0(e,t){t&&(xi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ep(e){tp(e),e.drafts_.forEach(dB),e.drafts_=null}function tp(e){e===Al&&(Al=e.parent_)}function j0(e){return Al=cB(Al,e)}function dB(e){const t=e[on];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function N0(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[on].modified_&&(ep(t),Cn(4)),pi(e)&&(e=Qd(t,e),t.parent_||Zd(t,e)),t.patches_&&xi("Patches").generateReplacementPatches_(r[on].base_,e,t.patches_,t.inversePatches_)):e=Qd(t,r,[]),ep(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==V2?e:void 0}function Qd(e,t,r){if(Tf(t))return t;const n=e.immer_.shouldUseStrictIteration(),s=t[on];if(!s)return Xd(t,(i,o)=>k0(e,s,t,i,o,r),n),t;if(s.scope_!==e)return t;if(!s.modified_)return Zd(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let o=i,l=!1;s.type_===3&&(o=new Set(i),i.clear(),l=!0),Xd(o,(c,d)=>k0(e,s,i,c,d,r,l),n),Zd(e,i,!1),r&&e.patches_&&xi("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function k0(e,t,r,n,s,i,o){if(s==null||typeof s!="object"&&!o)return;const l=Tf(s);if(!(l&&!o)){if(io(s)){const c=i&&t&&t.type_!==3&&!Zh(t.assigned_,n)?i.concat(n):void 0,d=Qd(e,s,c);if(Q2(r,n,d),io(d))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(pi(s)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===s&&l)return;Qd(e,s),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(gc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Zd(e,s)}}}function Zd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&og(t,r)}function uB(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Z2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=lg;r&&(s=[n],i=Dl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,l}var lg={get(e,t){if(t===on)return e;const r=Fs(e);if(!Zh(r,t))return fB(e,r,t);const n=r[t];return e.finalized_||!pi(n)?n:n===Km(e.base_,t)?(Ym(e),e.copy_[t]=np(n,e)):n},has(e,t){return t in Fs(e)},ownKeys(e){return Reflect.ownKeys(Fs(e))},set(e,t,r){const n=J2(Fs(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=Km(Fs(e),t),i=s==null?void 0:s[on];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(iB(r,s)&&(r!==void 0||Zh(e.base_,t)))return!0;Ym(e),rp(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Km(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ym(e),rp(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Fs(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Cn(11)},getPrototypeOf(e){return El(e.base_)},setPrototypeOf(){Cn(12)}},Dl={};Xd(lg,(e,t)=>{Dl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Dl.deleteProperty=function(e,t){return Dl.set.call(this,e,t,void 0)};Dl.set=function(e,t,r){return lg.set.call(this,e[0],t,r,e[0])};function Km(e,t){const r=e[on];return(r?Fs(r):e)[t]}function fB(e,t,r){var s;const n=J2(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function J2(e,t){if(!(t in e))return;let r=El(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=El(r)}}function rp(e){e.modified_||(e.modified_=!0,e.parent_&&rp(e.parent_))}function Ym(e){e.copy_||(e.copy_=Jh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mB=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const o=this;return function(c=i,...d){return o.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&Cn(6),n!==void 0&&typeof n!="function"&&Cn(7);let s;if(pi(t)){const i=j0(this),o=np(t,void 0);let l=!0;try{s=r(o),l=!1}finally{l?ep(i):tp(i)}return w0(i,n),N0(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===V2&&(s=void 0),this.autoFreeze_&&og(s,!0),n){const i=[],o=[];xi("Patches").generateReplacementPatches_(t,s,i,o),n(i,o)}return s}else Cn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,s;return[this.produce(t,r,(o,l)=>{n=o,s=l}),n,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){pi(e)||Cn(8),io(e)&&(e=hB(e));const t=j0(this),r=np(e,void 0);return r[on].isManual_=!0,tp(t),r}finishDraft(e,t){const r=e&&e[on];(!r||!r.isManual_)&&Cn(9);const{scope_:n}=r;return w0(n,t),N0(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const n=xi("Patches").applyPatches_;return io(e)?n(e,t):this.produce(e,s=>n(s,t))}};function np(e,t){const r=gc(e)?xi("MapSet").proxyMap_(e,t):Df(e)?xi("MapSet").proxySet_(e,t):uB(e,t);return(t?t.scope_:Z2()).drafts_.push(r),r}function hB(e){return io(e)||Cn(10,e),eC(e)}function eC(e){if(!pi(e)||Tf(e))return e;const t=e[on];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Jh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Jh(e,!0);return Xd(r,(s,i)=>{Q2(r,s,eC(i))},n),t&&(t.finalized_=!1),r}var pB=new mB;pB.produce;var xB={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},tC=Xr({name:"legend",initialState:xB,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:gt()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,s=En(e).payload.indexOf(r);s>-1&&(e.payload[s]=n)},prepare:gt()},removeLegendPayload:{reducer(e,t){var r=En(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:gt()}}}),{setLegendSize:$te,setLegendSettings:zte,addLegendPayload:gB,replaceLegendPayload:vB,removeLegendPayload:yB}=tC.actions,bB=tC.reducer;function ap(){return ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ap.apply(null,arguments)}function S0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function al(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S0(Object(r),!0).forEach(function(n){wB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wB(e,t,r){return(t=jB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jB(e){var t=NB(e,"string");return typeof t=="symbol"?t:t+""}function NB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kB(e){return Array.isArray(e)&&ia(e[0])&&ia(e[1])?e.join(" ~ "):e}var Ii={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},SB=e=>{var{separator:t=Ii.separator,contentStyle:r,itemStyle:n,labelStyle:s=Ii.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=Ii.accessibilityLayer}=e,p=()=>{if(i&&i.length){var k={padding:0,margin:0},b=(l?gf(i,l):i).map((S,_)=>{if(S.type==="none")return null;var C=S.formatter||o||kB,{value:P,name:D}=S,E=P,I=D;if(C){var F=C(P,D,S,_,i);if(Array.isArray(F))[E,I]=F;else if(F!=null)E=F;else return null}var Q=al(al({},Ii.itemStyle),{},{color:S.color||Ii.itemStyle.color},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:Q},ia(I)?h.createElement("span",{className:"recharts-tooltip-item-name"},I):null,ia(I)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},E),h.createElement("span",{className:"recharts-tooltip-item-unit"},S.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:k},b)}return null},x=al(al({},Ii.contentStyle),r),g=al({margin:0},s),v=!Qt(u),y=v?u:"",w=ot("recharts-default-tooltip",c),N=ot("recharts-tooltip-label",d);v&&f&&i!==void 0&&i!==null&&(y=f(u,i));var j=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",ap({className:w,style:x},j),h.createElement("p",{className:N,style:g},h.isValidElement(y)?y:"".concat(y)),p())},sl="recharts-tooltip-wrapper",CB={visibility:"hidden"};function _B(e){var{coordinate:t,translateX:r,translateY:n}=e;return ot(sl,{["".concat(sl,"-right")]:Ce(r)&&t&&Ce(t.x)&&r>=t.x,["".concat(sl,"-left")]:Ce(r)&&t&&Ce(t.x)&&r<t.x,["".concat(sl,"-bottom")]:Ce(n)&&t&&Ce(t.y)&&n>=t.y,["".concat(sl,"-top")]:Ce(n)&&t&&Ce(t.y)&&n<t.y})}function C0(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:s,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&Ce(i[n]))return i[n];var u=r[n]-l-(s>0?s:0),f=r[n]+s;if(t[n])return o[n]?u:f;var m=c[n];if(m==null)return 0;if(o[n]){var p=u,x=m;return p<x?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var g=f+l,v=m+d;return g>v?Math.max(u,m):Math.max(f,m)}function MB(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function PB(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:s,position:i,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:d}=e,u,f,m;return l.height>0&&l.width>0&&r?(f=C0({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=C0({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=MB({translateX:f,translateY:m,useTranslate3d:c})):u=CB,{cssProperties:u,cssClasses:_B({translateX:f,translateY:m,coordinate:r})}}function _0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Jc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_0(Object(r),!0).forEach(function(n){sp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sp(e,t,r){return(t=OB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OB(e){var t=EB(e,"string");return typeof t=="symbol"?t:t+""}function EB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class AB extends h.PureComponent{constructor(){super(...arguments),sp(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),sp(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,s,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(s=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&s!==void 0?s:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:s,children:i,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:m,viewBox:p,wrapperStyle:x,lastBoundingBox:g,innerRef:v,hasPortalFromProps:y}=this.props,w=typeof d=="number"?d:d.x,N=typeof d=="number"?d:d.y,{cssClasses:j,cssProperties:k}=PB({allowEscapeViewBox:r,coordinate:o,offsetLeft:w,offsetTop:N,position:u,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:m,viewBox:p}),b=y?{}:Jc(Jc({transition:c&&t?"transform ".concat(n,"ms ").concat(s):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),S=Jc(Jc({},b),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:S,ref:v},i)}}var rC=()=>{var e;return(e=De(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function ip(){return ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ip.apply(null,arguments)}function M0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function P0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M0(Object(r),!0).forEach(function(n){DB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DB(e,t,r){return(t=TB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TB(e){var t=IB(e,"string");return typeof t=="symbol"?t:t+""}function IB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O0={curveBasisClosed:hL,curveBasisOpen:pL,curveBasis:mL,curveBumpX:Jz,curveBumpY:eL,curveLinearClosed:xL,curveLinear:df,curveMonotoneX:gL,curveMonotoneY:vL,curveNatural:yL,curveStep:bL,curveStepAfter:jL,curveStepBefore:wL},Jd=e=>Ge(e.x)&&Ge(e.y),E0=e=>e.base!=null&&Jd(e.base)&&Jd(e),il=e=>e.x,ol=e=>e.y,RB=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(fc(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=O0["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return O0[r]||df},A0={connectNulls:!1,type:"linear"},$B=e=>{var{type:t=A0.type,points:r=[],baseLine:n,layout:s,connectNulls:i=A0.connectNulls}=e,o=RB(t,s),l=i?r.filter(Jd):r;if(Array.isArray(n)){var c,d=r.map((x,g)=>P0(P0({},x),{},{base:n[g]}));s==="vertical"?c=Hc().y(ol).x1(il).x0(x=>x.base.x):c=Hc().x(il).y1(ol).y0(x=>x.base.y);var u=c.defined(E0).curve(o),f=i?d.filter(E0):d;return u(f)}var m;s==="vertical"&&Ce(n)?m=Hc().y(ol).x1(il).x0(n):Ce(n)?m=Hc().x(il).y1(ol).y0(n):m=xS().x(il).y(ol);var p=m.defined(Jd).curve(o);return p(l)},nC=e=>{var{className:t,points:r,path:n,pathRef:s}=e,i=Ao();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},l=r&&r.length?$B(o):n;return h.createElement("path",ip({},Ta(e),UL(e),{className:ot("recharts-curve",t),d:l===null?void 0:l,ref:s}))},zB=["x","y","top","left","width","height","className"];function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},op.apply(null,arguments)}function D0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function LB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D0(Object(r),!0).forEach(function(n){FB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FB(e,t,r){return(t=BB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BB(e){var t=WB(e,"string");return typeof t=="symbol"?t:t+""}function WB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UB(e,t){if(e==null)return{};var r,n,s=qB(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function qB(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var HB=(e,t,r,n,s,i)=>"M".concat(e,",").concat(s,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),KB=e=>{var{x:t=0,y:r=0,top:n=0,left:s=0,width:i=0,height:o=0,className:l}=e,c=UB(e,zB),d=LB({x:t,y:r,top:n,left:s,width:i,height:o},c);return!Ce(t)||!Ce(r)||!Ce(i)||!Ce(o)||!Ce(n)||!Ce(s)?null:h.createElement("path",op({},xn(d),{className:ot("recharts-cross",l),d:HB(t,r,i,o,n,s)}))};function YB(e,t,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function T0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function I0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T0(Object(r),!0).forEach(function(n){GB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GB(e,t,r){return(t=VB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VB(e){var t=XB(e,"string");return typeof t=="symbol"?t:t+""}function XB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QB=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),aC=(e,t,r)=>e.map(n=>"".concat(QB(n)," ").concat(t,"ms ").concat(r)).join(","),ZB=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(s=>n.includes(s))),Tl=(e,t)=>Object.keys(t).reduce((r,n)=>I0(I0({},r),{},{[n]:e(n,t[n])}),{});function R0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(r),!0).forEach(function(n){JB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JB(e,t,r){return(t=eW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eW(e){var t=tW(e,"string");return typeof t=="symbol"?t:t+""}function tW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eu=(e,t,r)=>e+(t-e)*r,lp=e=>{var{from:t,to:r}=e;return t!==r},sC=(e,t,r)=>{var n=Tl((s,i)=>{if(lp(i)){var[o,l]=e(i.from,i.to,i.velocity);return Bt(Bt({},i),{},{from:o,velocity:l})}return i},t);return r<1?Tl((s,i)=>lp(i)&&n[s]!=null?Bt(Bt({},i),{},{velocity:eu(i.velocity,n[s].velocity,r),from:eu(i.from,n[s].from,r)}):i,t):sC(e,n,r-1)};function rW(e,t,r,n,s,i){var o,l=n.reduce((m,p)=>Bt(Bt({},m),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>Tl((m,p)=>p.from,l),d=()=>!Object.values(l).filter(lp).length,u=null,f=m=>{o||(o=m);var p=m-o,x=p/r.dt;l=sC(r,l,x),s(Bt(Bt(Bt({},e),t),c())),o=m,d()||(u=i.setTimeout(f))};return()=>(u=i.setTimeout(f),()=>{var m;(m=u)===null||m===void 0||m()})}function nW(e,t,r,n,s,i,o){var l=null,c=s.reduce((f,m)=>{var p=e[m],x=t[m];return p==null||x==null?f:Bt(Bt({},f),{},{[m]:[p,x]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,p=Tl((g,v)=>eu(...v,r(m)),c);if(i(Bt(Bt(Bt({},e),t),p)),m<1)l=o.setTimeout(u);else{var x=Tl((g,v)=>eu(...v,r(1)),c);i(Bt(Bt(Bt({},e),t),x))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const aW=(e,t,r,n,s,i)=>{var o=ZB(e,t);return r==null?()=>(s(Bt(Bt({},e),t)),()=>{}):r.isStepper===!0?rW(e,t,r,o,s,i):nW(e,t,r,n,o,s,i)};var tu=1e-4,iC=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],oC=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),$0=(e,t)=>r=>{var n=iC(e,t);return oC(n,r)},sW=(e,t)=>r=>{var n=iC(e,t),s=[...n.map((i,o)=>i*o).slice(1),0];return oC(s,r)},iW=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var s=n.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},oW=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=iW(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},lW=(e,t,r,n)=>{var s=$0(e,r),i=$0(t,n),o=sW(e,r),l=d=>d>1?1:d<0?0:d,c=d=>{for(var u=d>1?1:d,f=u,m=0;m<8;++m){var p=s(f)-u,x=o(f);if(Math.abs(p-u)<tu||x<tu)return i(f);f=l(f-p/x)}return i(f)};return c.isStepper=!1,c},z0=function(){return lW(...oW(...arguments))},cW=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:s=17}=t,i=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*s/1e3,m=c*s/1e3+o;return Math.abs(m-l)<tu&&Math.abs(f)<tu?[l,0]:[m,f]};return i.isStepper=!0,i.dt=s,i},dW=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return z0(e);case"spring":return cW();default:if(e.split("(")[0]==="cubic-bezier")return z0(e)}return typeof e=="function"?e:null};function uW(e){var t,r=()=>null,n=!1,s=null,i=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){s=e.setTimeout(i.bind(null,d),c);return}i(c),s=e.setTimeout(i.bind(null,d));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,s&&(s(),s=null),i(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class fW{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),s=null,i=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function mW(){return uW(new fW)}var hW=h.createContext(mW);function pW(e,t){var r=h.useContext(hW);return h.useMemo(()=>t??r(e),[e,t,r])}var xW=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),If={isSsr:xW()},gW={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},L0={t:0},Gm={t:1};function cg(e){var t=ln(e,gW),{isActive:r,canBegin:n,duration:s,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!If.isSsr:r,f=pW(t.animationId,t.animationManager),[m,p]=h.useState(u?L0:Gm),x=h.useRef(null);return h.useEffect(()=>{u||p(Gm)},[u]),h.useEffect(()=>{if(!u||!n)return Eo;var g=aW(L0,Gm,dW(i),s,p,f.getTimeoutController()),v=()=>{x.current=g()};return f.start([c,o,v,s,l]),()=>{f.stop(),x.current&&x.current(),l()}},[u,n,s,i,o,c,l,f]),d(m.t)}function dg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(_l(t)),n=h.useRef(e);return n.current!==e&&(r.current=_l(t),n.current=e),r.current}var vW=["radius"],yW=["radius"],F0,B0,W0,U0,q0,H0,K0,Y0,G0,V0;function X0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Q0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X0(Object(r),!0).forEach(function(n){bW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bW(e,t,r){return(t=wW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wW(e){var t=jW(e,"string");return typeof t=="symbol"?t:t+""}function jW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ru(){return ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ru.apply(null,arguments)}function Z0(e,t){if(e==null)return{};var r,n,s=NW(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function NW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Un(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var J0=(e,t,r,n,s)=>{var i=us(r),o=us(n),l=Math.min(Math.abs(i)/2,Math.abs(o)/2),c=o>=0?1:-1,d=i>=0?1:-1,u=o>=0&&i>=0||o<0&&i<0?1:0,f;if(l>0&&Array.isArray(s)){for(var m=[0,0,0,0],p=0,x=4;p<x;p++){var g,v=(g=s[p])!==null&&g!==void 0?g:0;m[p]=v>l?l:v}f=Ct(F0||(F0=Un(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Ct(B0||(B0=Un(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=Ct(W0||(W0=Un(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=Ct(U0||(U0=Un(["A ",",",",0,0,",`,
581
- `,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=Ct(q0||(q0=Un(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=Ct(H0||(H0=Un(["A ",",",",0,0,",`,
582
- `,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=Ct(K0||(K0=Un(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=Ct(Y0||(Y0=Un(["A ",",",",0,0,",`,
583
- `,",",""])),m[3],m[3],u,e,t+n-c*m[3])),f+="Z"}else if(l>0&&s===+s&&s>0){var y=Math.min(l,s);f=Ct(G0||(G0=Un(["M ",",",`
584
- A `,",",",0,0,",",",",",`
585
- L `,",",`
586
- A `,",",",0,0,",",",",",`
587
- L `,",",`
588
- A `,",",",0,0,",",",",",`
589
- L `,",",`
590
- A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,u,e+d*y,t,e+r-d*y,t,y,y,u,e+r,t+c*y,e+r,t+n-c*y,y,y,u,e+r-d*y,t+n,e+d*y,t+n,y,y,u,e,t+n-c*y)}else f=Ct(V0||(V0=Un(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},eb={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lC=e=>{var t=ln(e,eb),r=h.useRef(null),[n,s]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var X=r.current.getTotalLength();X&&s(X)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:p,isAnimationActive:x,isUpdateAnimationActive:g}=t,v=h.useRef(l),y=h.useRef(c),w=h.useRef(i),N=h.useRef(o),j=h.useMemo(()=>({x:i,y:o,width:l,height:c,radius:d}),[i,o,l,c,d]),k=dg(j,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var b=ot("recharts-rectangle",u);if(!g){var S=xn(t),{radius:_}=S,C=Z0(S,vW);return h.createElement("path",ru({},C,{x:us(i),y:us(o),width:us(l),height:us(c),radius:typeof d=="number"?d:void 0,className:b,d:J0(i,o,l,c,d)}))}var P=v.current,D=y.current,E=w.current,I=N.current,F="0px ".concat(n===-1?1:n,"px"),Q="".concat(n,"px 0px"),Y=aC(["strokeDasharray"],m,typeof f=="string"?f:eb.animationEasing);return h.createElement(cg,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:g,begin:p},X=>{var re=dr(P,l,X),ee=dr(D,c,X),T=dr(E,i,X),M=dr(I,o,X);r.current&&(v.current=re,y.current=ee,w.current=T,N.current=M);var $;x?X>0?$={transition:Y,strokeDasharray:Q}:$={strokeDasharray:F}:$={strokeDasharray:Q};var K=xn(t),{radius:z}=K,G=Z0(K,yW);return h.createElement("path",ru({},G,{radius:typeof d=="number"?d:void 0,className:b,d:J0(T,M,re,ee,d),ref:r,style:Q0(Q0({},$),t.style)}))})};function tb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tb(Object(r),!0).forEach(function(n){kW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kW(e,t,r){return(t=SW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SW(e){var t=CW(e,"string");return typeof t=="symbol"?t:t+""}function CW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nu=Math.PI/180,_W=e=>e*180/Math.PI,fr=(e,t,r,n)=>({x:e+Math.cos(-nu*n)*r,y:t+Math.sin(-nu*n)*r}),MW=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},PW=(e,t)=>{var{x:r,y:n}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(n-i)**2)},OW=(e,t)=>{var{x:r,y:n}=e,{cx:s,cy:i}=t,o=PW({x:r,y:n},{x:s,y:i});if(o<=0)return{radius:o,angle:0};var l=(r-s)/o,c=Math.acos(l);return n>i&&(c=2*Math.PI-c),{radius:o,angle:_W(c),angleInRadian:c}},EW=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(n,s);return{startAngle:t-i*360,endAngle:r-i*360}},AW=(e,t)=>{var{startAngle:r,endAngle:n}=t,s=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(s,i);return e+o*360},DW=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:s,angle:i}=OW({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(s<o||s>l||s===0)return null;var{startAngle:c,endAngle:d}=EW(t),u=i,f;if(c<=d){for(;u>d;)u-=360;for(;u<c;)u+=360;f=u>=c&&u<=d}else{for(;u>c;)u-=360;for(;u<d;)u+=360;f=u>=d&&u<=c}return f?rb(rb({},t),{},{radius:s,angle:AW(u,t)}):null};function cC(e){var{cx:t,cy:r,radius:n,startAngle:s,endAngle:i}=e,o=fr(t,r,n,s),l=fr(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}var nb,ab,sb,ib,ob,lb,cb;function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cp.apply(null,arguments)}function Gs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var TW=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},ed=e=>{var{cx:t,cy:r,radius:n,angle:s,sign:i,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/nu,f=c?s:s+i*u,m=fr(t,r,d,f),p=fr(t,r,n,f),x=c?s-i*u:s,g=fr(t,r,d*Math.cos(u*nu),x);return{center:m,circleTangency:p,lineTangency:g,theta:u}},dC=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:i,endAngle:o}=e,l=TW(i,o),c=i+l,d=fr(t,r,s,i),u=fr(t,r,s,c),f=Ct(nb||(nb=Gs(["M ",",",`
591
- A `,",",`,0,
592
- `,",",`,
593
- `,",",`
594
- `])),d.x,d.y,s,s,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=fr(t,r,n,i),p=fr(t,r,n,c);f+=Ct(ab||(ab=Gs(["L ",",",`
595
- A `,",",`,0,
596
- `,",",`,
597
- `,","," Z"])),p.x,p.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=Ct(sb||(sb=Gs(["L ",","," Z"])),t,r);return f},IW=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Wr(d-c),{circleTangency:f,lineTangency:m,theta:p}=ed({cx:t,cy:r,radius:s,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:v}=ed({cx:t,cy:r,radius:s,angle:d,sign:-u,cornerRadius:i,cornerIsExternal:l}),y=l?Math.abs(c-d):Math.abs(c-d)-p-v;if(y<0)return o?Ct(ib||(ib=Gs(["M ",",",`
598
- a`,",",",0,0,1,",`,0
599
- a`,",",",0,0,1,",`,0
600
- `])),m.x,m.y,i,i,i*2,i,i,-i*2):dC({cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:c,endAngle:d});var w=Ct(ob||(ob=Gs(["M ",",",`
601
- A`,",",",0,0,",",",",",`
602
- A`,",",",0,",",",",",",",`
603
- A`,",",",0,0,",",",",",`
604
- `])),m.x,m.y,i,i,+(u<0),f.x,f.y,s,s,+(y>180),+(u<0),x.x,x.y,i,i,+(u<0),g.x,g.y);if(n>0){var{circleTangency:N,lineTangency:j,theta:k}=ed({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:b,lineTangency:S,theta:_}=ed({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),C=l?Math.abs(c-d):Math.abs(c-d)-k-_;if(C<0&&i===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=Ct(lb||(lb=Gs(["L",",",`
605
- A`,",",",0,0,",",",",",`
606
- A`,",",",0,",",",",",",",`
607
- A`,",",",0,0,",",",",","Z"])),S.x,S.y,i,i,+(u<0),b.x,b.y,n,n,+(C>180),+(u>0),N.x,N.y,i,i,+(u<0),j.x,j.y)}else w+=Ct(cb||(cb=Gs(["L",",","Z"])),t,r);return w},RW={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},uC=e=>{var t=ln(e,RW),{cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(i<s||d===u)return null;var m=ot("recharts-sector",f),p=i-s,x=Tn(o,p,0,!0),g;return x>0&&Math.abs(d-u)<360?g=IW({cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:Math.min(x,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=dC({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u}),h.createElement("path",cp({},xn(t),{className:m,d:g}))};function $W(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(AS(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:i,outerRadius:o,angle:l}=t,c=fr(n,s,i,l),d=fr(n,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return cC(t)}}var fC={},mC={},hC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xx;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(hC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hC;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(mC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qx,r=mC;function n(s,i,o){o&&typeof o!="number"&&t.isIterateeCall(s,i,o)&&(i=o=void 0),s=r.toFinite(s),i===void 0?(i=s,s=0):i=r.toFinite(i),o=o===void 0?s<i?1:-1:r.toFinite(o);const l=Math.max(Math.ceil((i-s)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=s,s+=o;return c}e.range=n})(fC);var zW=fC.range;const pC=Ua(zW);function bs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function LW(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ug(e){let t,r,n;e.length!==2?(t=bs,r=(l,c)=>bs(e(l),c),n=(l,c)=>e(l)-c):(t=e===bs||e===LW?e:FW,r=e,n=e);function s(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function o(l,c,d=0,u=l.length){const f=s(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:s,center:o,right:i}}function FW(){return 0}function xC(e){return e===null?NaN:+e}function*BW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const WW=ug(bs),vc=WW.right;ug(xC).center;class db extends Map{constructor(t,r=HW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,s]of t)this.set(n,s)}get(t){return super.get(ub(this,t))}has(t){return super.has(ub(this,t))}set(t,r){return super.set(UW(this,t),r)}delete(t){return super.delete(qW(this,t))}}function ub({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function UW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function qW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function HW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KW(e=bs){if(e===bs)return gC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function gC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const YW=Math.sqrt(50),GW=Math.sqrt(10),VW=Math.sqrt(2);function au(e,t,r){const n=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(n)),i=n/Math.pow(10,s),o=i>=YW?10:i>=GW?5:i>=VW?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?au(e,t,r*2):[l,c,d]}function dp(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[s,i,o]=n?au(t,e,r):au(e,t,r);if(!(i>=s))return[];const l=i-s+1,c=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)c[d]=(i-d)/-o;else for(let d=0;d<l;++d)c[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(s+d)/-o;else for(let d=0;d<l;++d)c[d]=(s+d)*o;return c}function up(e,t,r){return t=+t,e=+e,r=+r,au(e,t,r)[2]}function fp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?up(t,e,r):up(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function fb(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function mb(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function vC(e,t,r=0,n=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(s=s===void 0?gC:KW(s);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),m=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),p=Math.max(r,Math.floor(t-d*f/c+m)),x=Math.min(n,Math.floor(t+(c-d)*f/c+m));vC(e,t,p,x,s)}const i=e[t];let o=r,l=n;for(ll(e,r,t),s(e[n],i)>0&&ll(e,r,n);o<l;){for(ll(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?ll(e,r,l):(++l,ll(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function ll(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XW(e,t,r){if(e=Float64Array.from(BW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return mb(e);if(t>=1)return fb(e);var n,s=(n-1)*t,i=Math.floor(s),o=fb(vC(e,i).subarray(0,i+1)),l=mb(e.subarray(i+1));return o+(l-o)*(s-i)}}function QW(e,t,r=xC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,s=(n-1)*t,i=Math.floor(s),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(s-i)}}function ZW(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++n<s;)i[n]=e+n*r;return i}function yn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ja(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const mp=Symbol("implicit");function fg(){var e=new db,t=[],r=[],n=mp;function s(i){let o=e.get(i);if(o===void 0){if(n!==mp)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new db;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return fg(t,r).unknown(n)},yn.apply(s,arguments),s}function mg(){var e=fg().unknown(void 0),t=e.domain,r=e.range,n=0,s=1,i,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var m=t().length,p=s<n,x=p?s:n,g=p?n:s;i=(g-x)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),x+=(g-x-i*(m-c))*u,o=i*(1-c),l&&(x=Math.round(x),o=Math.round(o));var v=ZW(m).map(function(y){return x+i*y});return r(p?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),f()):t()},e.range=function(m){return arguments.length?([n,s]=m,n=+n,s=+s,f()):[n,s]},e.rangeRound=function(m){return[n,s]=m,n=+n,s=+s,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(m){return arguments.length?(l=!!m,f()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,d=+m),f()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),f()):c},e.paddingOuter=function(m){return arguments.length?(d=+m,f()):d},e.align=function(m){return arguments.length?(u=Math.max(0,Math.min(1,m)),f()):u},e.copy=function(){return mg(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},yn.apply(f(),arguments)}function yC(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return yC(t())},e}function JW(){return yC(mg.apply(null,arguments).paddingInner(1))}function hg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function bC(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function yc(){}var Il=.7,su=1/Il,Vi="\\s*([+-]?\\d+)\\s*",Rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e7=/^#([0-9a-f]{3,8})$/,t7=new RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),r7=new RegExp(`^rgb\\(${ra},${ra},${ra}\\)$`),n7=new RegExp(`^rgba\\(${Vi},${Vi},${Vi},${Rl}\\)$`),a7=new RegExp(`^rgba\\(${ra},${ra},${ra},${Rl}\\)$`),s7=new RegExp(`^hsl\\(${Rl},${ra},${ra}\\)$`),i7=new RegExp(`^hsla\\(${Rl},${ra},${ra},${Rl}\\)$`),hb={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};hg(yc,$l,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pb,formatHex:pb,formatHex8:o7,formatHsl:l7,formatRgb:xb,toString:xb});function pb(){return this.rgb().formatHex()}function o7(){return this.rgb().formatHex8()}function l7(){return wC(this).formatHsl()}function xb(){return this.rgb().formatRgb()}function $l(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=e7.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?gb(t):r===3?new qr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=t7.exec(e))?new qr(t[1],t[2],t[3],1):(t=r7.exec(e))?new qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=n7.exec(e))?td(t[1],t[2],t[3],t[4]):(t=a7.exec(e))?td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=s7.exec(e))?bb(t[1],t[2]/100,t[3]/100,1):(t=i7.exec(e))?bb(t[1],t[2]/100,t[3]/100,t[4]):hb.hasOwnProperty(e)?gb(hb[e]):e==="transparent"?new qr(NaN,NaN,NaN,0):null}function gb(e){return new qr(e>>16&255,e>>8&255,e&255,1)}function td(e,t,r,n){return n<=0&&(e=t=r=NaN),new qr(e,t,r,n)}function c7(e){return e instanceof yc||(e=$l(e)),e?(e=e.rgb(),new qr(e.r,e.g,e.b,e.opacity)):new qr}function hp(e,t,r,n){return arguments.length===1?c7(e):new qr(e,t,r,n??1)}function qr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}hg(qr,hp,bC(yc,{brighter(e){return e=e==null?su:Math.pow(su,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Il:Math.pow(Il,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qr(ri(this.r),ri(this.g),ri(this.b),iu(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:vb,formatHex:vb,formatHex8:d7,formatRgb:yb,toString:yb}));function vb(){return`#${Vs(this.r)}${Vs(this.g)}${Vs(this.b)}`}function d7(){return`#${Vs(this.r)}${Vs(this.g)}${Vs(this.b)}${Vs((isNaN(this.opacity)?1:this.opacity)*255)}`}function yb(){const e=iu(this.opacity);return`${e===1?"rgb(":"rgba("}${ri(this.r)}, ${ri(this.g)}, ${ri(this.b)}${e===1?")":`, ${e})`}`}function iu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ri(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vs(e){return e=ri(e),(e<16?"0":"")+e.toString(16)}function bb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _n(e,t,r,n)}function wC(e){if(e instanceof _n)return new _n(e.h,e.s,e.l,e.opacity);if(e instanceof yc||(e=$l(e)),!e)return new _n;if(e instanceof _n)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-s,c=(i+s)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new _n(o,l,c,e.opacity)}function u7(e,t,r,n){return arguments.length===1?wC(e):new _n(e,t,r,n??1)}function _n(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}hg(_n,u7,bC(yc,{brighter(e){return e=e==null?su:Math.pow(su,e),new _n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Il:Math.pow(Il,e),new _n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new qr(Vm(e>=240?e-240:e+120,s,n),Vm(e,s,n),Vm(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new _n(wb(this.h),rd(this.s),rd(this.l),iu(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 e=iu(this.opacity);return`${e===1?"hsl(":"hsla("}${wb(this.h)}, ${rd(this.s)*100}%, ${rd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wb(e){return e=(e||0)%360,e<0?e+360:e}function rd(e){return Math.max(0,Math.min(1,e||0))}function Vm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const pg=e=>()=>e;function f7(e,t){return function(r){return e+r*t}}function m7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function h7(e){return(e=+e)==1?jC:function(t,r){return r-t?m7(t,r,e):pg(isNaN(t)?r:t)}}function jC(e,t){var r=t-e;return r?f7(e,r):pg(isNaN(e)?t:e)}const jb=function e(t){var r=h7(t);function n(s,i){var o=r((s=hp(s)).r,(i=hp(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=jC(s.opacity,i.opacity);return function(u){return s.r=o(u),s.g=l(u),s.b=c(u),s.opacity=d(u),s+""}}return n.gamma=e,n}(1);function p7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),s;return function(i){for(s=0;s<r;++s)n[s]=e[s]*(1-i)+t[s]*i;return n}}function x7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function g7(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,s=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)s[o]=Do(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=s[o](l);return i}}function v7(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function ou(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function y7(e,t){var r={},n={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=Do(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var pp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xm=new RegExp(pp.source,"g");function b7(e){return function(){return e}}function w7(e){return function(t){return e(t)+""}}function j7(e,t){var r=pp.lastIndex=Xm.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=pp.exec(e))&&(s=Xm.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:ou(n,s)})),r=Xm.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?w7(c[0].x):b7(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function Do(e,t){var r=typeof t,n;return t==null||r==="boolean"?pg(t):(r==="number"?ou:r==="string"?(n=$l(t))?(t=n,jb):j7:t instanceof $l?jb:t instanceof Date?v7:x7(t)?p7:Array.isArray(t)?g7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?y7:ou)(e,t)}function xg(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function N7(e,t){t===void 0&&(t=e,e=Do);for(var r=0,n=t.length-1,s=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(s,s=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function k7(e){return function(){return e}}function lu(e){return+e}var Nb=[0,1];function Sr(e){return e}function xp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:k7(isNaN(t)?NaN:.5)}function S7(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function C7(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=xp(s,n),i=r(o,i)):(n=xp(n,s),i=r(i,o)),function(l){return i(n(l))}}function _7(e,t,r){var n=Math.min(e.length,t.length)-1,s=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)s[o]=xp(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=vc(e,l,1,n)-1;return i[c](s[c](l))}}function bc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rf(){var e=Nb,t=Nb,r=Do,n,s,i,o=Sr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==Sr&&(o=S7(e[0],e[m-1])),l=m>2?_7:C7,c=d=null,f}function f(m){return m==null||isNaN(m=+m)?i:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return f.invert=function(m){return o(s((d||(d=l(t,e.map(n),ou)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,lu),u()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),u()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),r=xg,u()},f.clamp=function(m){return arguments.length?(o=m?!0:Sr,u()):o!==Sr},f.interpolate=function(m){return arguments.length?(r=m,u()):r},f.unknown=function(m){return arguments.length?(i=m,f):i},function(m,p){return n=m,s=p,u()}}function gg(){return Rf()(Sr,Sr)}function M7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function cu(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function oo(e){return e=cu(Math.abs(e)),e?e[1]:NaN}function P7(e,t){return function(r,n){for(var s=r.length,i=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function O7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var E7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zl(e){if(!(t=E7.exec(e)))throw new Error("invalid format: "+e);var t;return new vg({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}zl.prototype=vg.prototype;function vg(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}vg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function A7(e){e:for(var t=e.length,r=1,n=-1,s;r<t;++r)switch(e[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(s+1):e}var du;function D7(e,t){var r=cu(e,t);if(!r)return du=void 0,e.toPrecision(t);var n=r[0],s=r[1],i=s-(du=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+cu(e,Math.max(0,t+i-1))[0]}function kb(e,t){var r=cu(e,t);if(!r)return e+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const Sb={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:M7,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>kb(e*100,t),r:kb,s:D7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Cb(e){return e}var _b=Array.prototype.map,Mb=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function T7(e){var t=e.grouping===void 0||e.thousands===void 0?Cb:P7(_b.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?Cb:O7(_b.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f,m){f=zl(f);var p=f.fill,x=f.align,g=f.sign,v=f.symbol,y=f.zero,w=f.width,N=f.comma,j=f.precision,k=f.trim,b=f.type;b==="n"?(N=!0,b="g"):Sb[b]||(j===void 0&&(j=12),k=!0,b="g"),(y||p==="0"&&x==="=")&&(y=!0,p="0",x="=");var S=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),_=(v==="$"?n:/[%p]/.test(b)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),C=Sb[b],P=/[defgprs%]/.test(b);j=j===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function D(E){var I=S,F=_,Q,Y,X;if(b==="c")F=C(E)+F,E="";else{E=+E;var re=E<0||1/E<0;if(E=isNaN(E)?c:C(Math.abs(E),j),k&&(E=A7(E)),re&&+E==0&&g!=="+"&&(re=!1),I=(re?g==="("?g:l:g==="-"||g==="("?"":g)+I,F=(b==="s"&&!isNaN(E)&&du!==void 0?Mb[8+du/3]:"")+F+(re&&g==="("?")":""),P){for(Q=-1,Y=E.length;++Q<Y;)if(X=E.charCodeAt(Q),48>X||X>57){F=(X===46?s+E.slice(Q+1):E.slice(Q))+F,E=E.slice(0,Q);break}}}N&&!y&&(E=t(E,1/0));var ee=I.length+E.length+F.length,T=ee<w?new Array(w-ee+1).join(p):"";switch(N&&y&&(E=t(T+E,T.length?w-F.length:1/0),T=""),x){case"<":E=I+E+F+T;break;case"=":E=I+T+E+F;break;case"^":E=T.slice(0,ee=T.length>>1)+I+E+F+T.slice(ee);break;default:E=T+I+E+F;break}return i(E)}return D.toString=function(){return f+""},D}function u(f,m){var p=Math.max(-8,Math.min(8,Math.floor(oo(m)/3)))*3,x=Math.pow(10,-p),g=d((f=zl(f),f.type="f",f),{suffix:Mb[8+p/3]});return function(v){return g(x*v)}}return{format:d,formatPrefix:u}}var nd,yg,NC;I7({thousands:",",grouping:[3],currency:["$",""]});function I7(e){return nd=T7(e),yg=nd.format,NC=nd.formatPrefix,nd}function R7(e){return Math.max(0,-oo(Math.abs(e)))}function $7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(oo(t)/3)))*3-oo(Math.abs(e)))}function z7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,oo(t)-oo(e))+1}function kC(e,t,r,n){var s=fp(e,t,r),i;switch(n=zl(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=$7(s,o))&&(n.precision=i),NC(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=z7(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=R7(s))&&(n.precision=i-(n.type==="%")*2);break}}return yg(n)}function Ps(e){var t=e.domain;return e.ticks=function(r){var n=t();return dp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return kC(s[0],s[s.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),s=0,i=n.length-1,o=n[s],l=n[i],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=s,s=i,i=d);u-- >0;){if(d=up(o,l,r),d===c)return n[s]=o,n[i]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function SC(){var e=gg();return e.copy=function(){return bc(e,SC())},yn.apply(e,arguments),Ps(e)}function CC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,lu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return CC(e).unknown(t)},e=arguments.length?Array.from(e,lu):[0,1],Ps(r)}function _C(e,t){e=e.slice();var r=0,n=e.length-1,s=e[r],i=e[n],o;return i<s&&(o=r,r=n,n=o,o=s,s=i,i=o),e[r]=t.floor(s),e[n]=t.ceil(i),e}function Pb(e){return Math.log(e)}function Ob(e){return Math.exp(e)}function L7(e){return-Math.log(-e)}function F7(e){return-Math.exp(-e)}function B7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function W7(e){return e===10?B7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function U7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Eb(e){return(t,r)=>-e(-t,r)}function bg(e){const t=e(Pb,Ob),r=t.domain;let n=10,s,i;function o(){return s=U7(n),i=W7(n),r()[0]<0?(s=Eb(s),i=Eb(i),e(L7,F7)):e(Pb,Ob),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let m=s(d),p=s(u),x,g;const v=l==null?10:+l;let y=[];if(!(n%1)&&p-m<v){if(m=Math.floor(m),p=Math.ceil(p),d>0){for(;m<=p;++m)for(x=1;x<n;++x)if(g=m<0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}}else for(;m<=p;++m)for(x=n-1;x>=1;--x)if(g=m>0?x/i(-m):x*i(m),!(g<d)){if(g>u)break;y.push(g)}y.length*2<v&&(y=dp(d,u,v))}else y=dp(m,p,Math.min(p-m,v)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=zl(c)).precision==null&&(c.trim=!0),c=yg(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/i(Math.round(s(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(_C(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function MC(){const e=bg(Rf()).domain([1,10]);return e.copy=()=>bc(e,MC()).base(e.base()),yn.apply(e,arguments),e}function Ab(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Db(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wg(e){var t=1,r=e(Ab(t),Db(t));return r.constant=function(n){return arguments.length?e(Ab(t=+n),Db(t)):t},Ps(r)}function PC(){var e=wg(Rf());return e.copy=function(){return bc(e,PC()).constant(e.constant())},yn.apply(e,arguments)}function Tb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function q7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function H7(e){return e<0?-e*e:e*e}function jg(e){var t=e(Sr,Sr),r=1;function n(){return r===1?e(Sr,Sr):r===.5?e(q7,H7):e(Tb(r),Tb(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},Ps(t)}function Ng(){var e=jg(Rf());return e.copy=function(){return bc(e,Ng()).exponent(e.exponent())},yn.apply(e,arguments),e}function K7(){return Ng.apply(null,arguments).exponent(.5)}function Ib(e){return Math.sign(e)*e*e}function Y7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function OC(){var e=gg(),t=[0,1],r=!1,n;function s(i){var o=Y7(e(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return e.invert(Ib(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,lu)).map(Ib)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return OC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},yn.apply(s,arguments),Ps(s)}function EC(){var e=[],t=[],r=[],n;function s(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=QW(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[vc(r,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(bs),s()},i.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return EC().domain(e).range(t).unknown(n)},yn.apply(i,arguments)}function AC(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[vc(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var d=s.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return AC().domain([e,t]).range(s).unknown(i)},yn.apply(Ps(o),arguments)}function DC(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[vc(e,i,0,n)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return DC().domain(e).range(t).unknown(r)},yn.apply(s,arguments)}const Qm=new Date,Zm=new Date;function qt(e,t,r,n){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o<l-i?o:l},s.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let d;do c.push(d=new Date(+i)),t(i,l),e(i);while(d<i&&i<o);return c},s.filter=i=>qt(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(s.count=(i,o)=>(Qm.setTime(+i),Zm.setTime(+o),e(Qm),e(Zm),Math.floor(r(Qm,Zm))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(n?o=>n(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const uu=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);uu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):uu);uu.range;const Ca=1e3,hn=Ca*60,_a=hn*60,$a=_a*24,kg=$a*7,Rb=$a*30,Jm=$a*365,Xs=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ca)},(e,t)=>(t-e)/Ca,e=>e.getUTCSeconds());Xs.range;const Sg=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ca)},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getMinutes());Sg.range;const Cg=qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCMinutes());Cg.range;const _g=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ca-e.getMinutes()*hn)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getHours());_g.range;const Mg=qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCHours());Mg.range;const wc=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*hn)/$a,e=>e.getDate()-1);wc.range;const $f=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);$f.range;const TC=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));TC.range;function Mi(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*hn)/kg)}const zf=Mi(0),fu=Mi(1),G7=Mi(2),V7=Mi(3),lo=Mi(4),X7=Mi(5),Q7=Mi(6);zf.range;fu.range;G7.range;V7.range;lo.range;X7.range;Q7.range;function Pi(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/kg)}const Lf=Pi(0),mu=Pi(1),Z7=Pi(2),J7=Pi(3),co=Pi(4),e9=Pi(5),t9=Pi(6);Lf.range;mu.range;Z7.range;J7.range;co.range;e9.range;t9.range;const Pg=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Pg.range;const Og=qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Og.range;const za=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());za.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});za.range;const La=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());La.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});La.range;function IC(e,t,r,n,s,i){const o=[[Xs,1,Ca],[Xs,5,5*Ca],[Xs,15,15*Ca],[Xs,30,30*Ca],[i,1,hn],[i,5,5*hn],[i,15,15*hn],[i,30,30*hn],[s,1,_a],[s,3,3*_a],[s,6,6*_a],[s,12,12*_a],[n,1,$a],[n,2,2*$a],[r,1,kg],[t,1,Rb],[t,3,3*Rb],[e,1,Jm]];function l(d,u,f){const m=u<d;m&&([d,u]=[u,d]);const p=f&&typeof f.range=="function"?f:c(d,u,f),x=p?p.range(d,+u+1):[];return m?x.reverse():x}function c(d,u,f){const m=Math.abs(u-d)/f,p=ug(([,,v])=>v).right(o,m);if(p===o.length)return e.every(fp(d/Jm,u/Jm,f));if(p===0)return uu.every(Math.max(fp(d,u,f),1));const[x,g]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return x.every(g)}return[l,c]}const[r9,n9]=IC(La,Og,Lf,TC,Mg,Cg),[a9,s9]=IC(za,Pg,zf,wc,_g,Sg);function eh(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function th(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function cl(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i9(e){var t=e.dateTime,r=e.date,n=e.time,s=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=dl(s),u=ul(s),f=dl(i),m=ul(i),p=dl(o),x=ul(o),g=dl(l),v=ul(l),y=dl(c),w=ul(c),N={a:X,A:re,b:ee,B:T,c:null,d:Wb,e:Wb,f:P9,g:L9,G:B9,H:C9,I:_9,j:M9,L:RC,m:O9,M:E9,p:M,q:$,Q:Hb,s:Kb,S:A9,u:D9,U:T9,V:I9,w:R9,W:$9,x:null,X:null,y:z9,Y:F9,Z:W9,"%":qb},j={a:K,A:z,b:G,B:A,c:null,d:Ub,e:Ub,f:K9,g:rU,G:aU,H:U9,I:q9,j:H9,L:zC,m:Y9,M:G9,p:O,q:J,Q:Hb,s:Kb,S:V9,u:X9,U:Q9,V:Z9,w:J9,W:eU,x:null,X:null,y:tU,Y:nU,Z:sU,"%":qb},k={a:P,A:D,b:E,B:I,c:F,d:Fb,e:Fb,f:j9,g:Lb,G:zb,H:Bb,I:Bb,j:v9,L:w9,m:g9,M:y9,p:C,q:x9,Q:k9,s:S9,S:b9,u:u9,U:f9,V:m9,w:d9,W:h9,x:Q,X:Y,y:Lb,Y:zb,Z:p9,"%":N9};N.x=b(r,N),N.X=b(n,N),N.c=b(t,N),j.x=b(r,j),j.X=b(n,j),j.c=b(t,j);function b(B,ae){return function(R){var q=[],se=-1,V=0,ie=B.length,pe,ue,ve;for(R instanceof Date||(R=new Date(+R));++se<ie;)B.charCodeAt(se)===37&&(q.push(B.slice(V,se)),(ue=$b[pe=B.charAt(++se)])!=null?pe=B.charAt(++se):ue=pe==="e"?" ":"0",(ve=ae[pe])&&(pe=ve(R,ue)),q.push(pe),V=se+1);return q.push(B.slice(V,se)),q.join("")}}function S(B,ae){return function(R){var q=cl(1900,void 0,1),se=_(q,B,R+="",0),V,ie;if(se!=R.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(ae&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(V=th(cl(q.y,0,1)),ie=V.getUTCDay(),V=ie>4||ie===0?mu.ceil(V):mu(V),V=$f.offset(V,(q.V-1)*7),q.y=V.getUTCFullYear(),q.m=V.getUTCMonth(),q.d=V.getUTCDate()+(q.w+6)%7):(V=eh(cl(q.y,0,1)),ie=V.getDay(),V=ie>4||ie===0?fu.ceil(V):fu(V),V=wc.offset(V,(q.V-1)*7),q.y=V.getFullYear(),q.m=V.getMonth(),q.d=V.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),ie="Z"in q?th(cl(q.y,0,1)).getUTCDay():eh(cl(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(ie+5)%7:q.w+q.U*7-(ie+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,th(q)):eh(q)}}function _(B,ae,R,q){for(var se=0,V=ae.length,ie=R.length,pe,ue;se<V;){if(q>=ie)return-1;if(pe=ae.charCodeAt(se++),pe===37){if(pe=ae.charAt(se++),ue=k[pe in $b?ae.charAt(se++):pe],!ue||(q=ue(B,R,q))<0)return-1}else if(pe!=R.charCodeAt(q++))return-1}return q}function C(B,ae,R){var q=d.exec(ae.slice(R));return q?(B.p=u.get(q[0].toLowerCase()),R+q[0].length):-1}function P(B,ae,R){var q=p.exec(ae.slice(R));return q?(B.w=x.get(q[0].toLowerCase()),R+q[0].length):-1}function D(B,ae,R){var q=f.exec(ae.slice(R));return q?(B.w=m.get(q[0].toLowerCase()),R+q[0].length):-1}function E(B,ae,R){var q=y.exec(ae.slice(R));return q?(B.m=w.get(q[0].toLowerCase()),R+q[0].length):-1}function I(B,ae,R){var q=g.exec(ae.slice(R));return q?(B.m=v.get(q[0].toLowerCase()),R+q[0].length):-1}function F(B,ae,R){return _(B,t,ae,R)}function Q(B,ae,R){return _(B,r,ae,R)}function Y(B,ae,R){return _(B,n,ae,R)}function X(B){return o[B.getDay()]}function re(B){return i[B.getDay()]}function ee(B){return c[B.getMonth()]}function T(B){return l[B.getMonth()]}function M(B){return s[+(B.getHours()>=12)]}function $(B){return 1+~~(B.getMonth()/3)}function K(B){return o[B.getUTCDay()]}function z(B){return i[B.getUTCDay()]}function G(B){return c[B.getUTCMonth()]}function A(B){return l[B.getUTCMonth()]}function O(B){return s[+(B.getUTCHours()>=12)]}function J(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var ae=b(B+="",N);return ae.toString=function(){return B},ae},parse:function(B){var ae=S(B+="",!1);return ae.toString=function(){return B},ae},utcFormat:function(B){var ae=b(B+="",j);return ae.toString=function(){return B},ae},utcParse:function(B){var ae=S(B+="",!0);return ae.toString=function(){return B},ae}}}var $b={"-":"",_:" ",0:"0"},Jt=/^\s*\d+/,o9=/^%/,l9=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,r){var n=e<0?"-":"",s=(n?-e:e)+"",i=s.length;return n+(i<r?new Array(r-i+1).join(t)+s:s)}function c9(e){return e.replace(l9,"\\$&")}function dl(e){return new RegExp("^(?:"+e.map(c9).join("|")+")","i")}function ul(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function d9(e,t,r){var n=Jt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function u9(e,t,r){var n=Jt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function f9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function m9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function h9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function zb(e,t,r){var n=Jt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Lb(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p9(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function x9(e,t,r){var n=Jt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function g9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Fb(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function v9(e,t,r){var n=Jt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Bb(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function y9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function b9(e,t,r){var n=Jt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function w9(e,t,r){var n=Jt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function j9(e,t,r){var n=Jt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function N9(e,t,r){var n=o9.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function k9(e,t,r){var n=Jt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function S9(e,t,r){var n=Jt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Wb(e,t){return Qe(e.getDate(),t,2)}function C9(e,t){return Qe(e.getHours(),t,2)}function _9(e,t){return Qe(e.getHours()%12||12,t,2)}function M9(e,t){return Qe(1+wc.count(za(e),e),t,3)}function RC(e,t){return Qe(e.getMilliseconds(),t,3)}function P9(e,t){return RC(e,t)+"000"}function O9(e,t){return Qe(e.getMonth()+1,t,2)}function E9(e,t){return Qe(e.getMinutes(),t,2)}function A9(e,t){return Qe(e.getSeconds(),t,2)}function D9(e){var t=e.getDay();return t===0?7:t}function T9(e,t){return Qe(zf.count(za(e)-1,e),t,2)}function $C(e){var t=e.getDay();return t>=4||t===0?lo(e):lo.ceil(e)}function I9(e,t){return e=$C(e),Qe(lo.count(za(e),e)+(za(e).getDay()===4),t,2)}function R9(e){return e.getDay()}function $9(e,t){return Qe(fu.count(za(e)-1,e),t,2)}function z9(e,t){return Qe(e.getFullYear()%100,t,2)}function L9(e,t){return e=$C(e),Qe(e.getFullYear()%100,t,2)}function F9(e,t){return Qe(e.getFullYear()%1e4,t,4)}function B9(e,t){var r=e.getDay();return e=r>=4||r===0?lo(e):lo.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function W9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function Ub(e,t){return Qe(e.getUTCDate(),t,2)}function U9(e,t){return Qe(e.getUTCHours(),t,2)}function q9(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function H9(e,t){return Qe(1+$f.count(La(e),e),t,3)}function zC(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function K9(e,t){return zC(e,t)+"000"}function Y9(e,t){return Qe(e.getUTCMonth()+1,t,2)}function G9(e,t){return Qe(e.getUTCMinutes(),t,2)}function V9(e,t){return Qe(e.getUTCSeconds(),t,2)}function X9(e){var t=e.getUTCDay();return t===0?7:t}function Q9(e,t){return Qe(Lf.count(La(e)-1,e),t,2)}function LC(e){var t=e.getUTCDay();return t>=4||t===0?co(e):co.ceil(e)}function Z9(e,t){return e=LC(e),Qe(co.count(La(e),e)+(La(e).getUTCDay()===4),t,2)}function J9(e){return e.getUTCDay()}function eU(e,t){return Qe(mu.count(La(e)-1,e),t,2)}function tU(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function rU(e,t){return e=LC(e),Qe(e.getUTCFullYear()%100,t,2)}function nU(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function aU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?co(e):co.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function sU(){return"+0000"}function qb(){return"%"}function Hb(e){return+e}function Kb(e){return Math.floor(+e/1e3)}var Ri,FC,BC;iU({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iU(e){return Ri=i9(e),FC=Ri.format,Ri.parse,BC=Ri.utcFormat,Ri.utcParse,Ri}function oU(e){return new Date(e)}function lU(e){return e instanceof Date?+e:+new Date(+e)}function Eg(e,t,r,n,s,i,o,l,c,d){var u=gg(),f=u.invert,m=u.domain,p=d(".%L"),x=d(":%S"),g=d("%I:%M"),v=d("%I %p"),y=d("%a %d"),w=d("%b %d"),N=d("%B"),j=d("%Y");function k(b){return(c(b)<b?p:l(b)<b?x:o(b)<b?g:i(b)<b?v:n(b)<b?s(b)<b?y:w:r(b)<b?N:j)(b)}return u.invert=function(b){return new Date(f(b))},u.domain=function(b){return arguments.length?m(Array.from(b,lU)):m().map(oU)},u.ticks=function(b){var S=m();return e(S[0],S[S.length-1],b??10)},u.tickFormat=function(b,S){return S==null?k:d(S)},u.nice=function(b){var S=m();return(!b||typeof b.range!="function")&&(b=t(S[0],S[S.length-1],b??10)),b?m(_C(S,b)):u},u.copy=function(){return bc(u,Eg(e,t,r,n,s,i,o,l,c,d))},u}function cU(){return yn.apply(Eg(a9,s9,za,Pg,zf,wc,_g,Sg,Xs,FC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dU(){return yn.apply(Eg(r9,n9,La,Og,Lf,$f,Mg,Cg,Xs,BC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ff(){var e=0,t=1,r,n,s,i,o=Sr,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(s===0?.5:(f=(i(f)-r)*s,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),s=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function u(f){return function(m){var p,x;return arguments.length?([p,x]=m,o=f(p,x),d):[o(0),o(1)]}}return d.range=u(Do),d.rangeRound=u(xg),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return i=f,r=f(e),n=f(t),s=r===n?0:1/(n-r),d}}function Os(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function WC(){var e=Ps(Ff()(Sr));return e.copy=function(){return Os(e,WC())},Ja.apply(e,arguments)}function UC(){var e=bg(Ff()).domain([1,10]);return e.copy=function(){return Os(e,UC()).base(e.base())},Ja.apply(e,arguments)}function qC(){var e=wg(Ff());return e.copy=function(){return Os(e,qC()).constant(e.constant())},Ja.apply(e,arguments)}function Ag(){var e=jg(Ff());return e.copy=function(){return Os(e,Ag()).exponent(e.exponent())},Ja.apply(e,arguments)}function uU(){return Ag.apply(null,arguments).exponent(.5)}function HC(){var e=[],t=Sr;function r(n){if(n!=null&&!isNaN(n=+n))return t((vc(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let s of n)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(bs),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,s)=>t(s/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,i)=>XW(e,i/n))},r.copy=function(){return HC(t).domain(e)},Ja.apply(r,arguments)}function Bf(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=Sr,u,f=!1,m;function p(g){return isNaN(g=+g)?m:(g=.5+((g=+u(g))-i)*(n*g<n*i?l:c),d(f?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,r]=g,s=u(e=+e),i=u(t=+t),o=u(r=+r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p):[e,t,r]},p.clamp=function(g){return arguments.length?(f=!!g,p):f},p.interpolator=function(g){return arguments.length?(d=g,p):d};function x(g){return function(v){var y,w,N;return arguments.length?([y,w,N]=v,d=N7(g,[y,w,N]),p):[d(0),d(.5),d(1)]}}return p.range=x(Do),p.rangeRound=x(xg),p.unknown=function(g){return arguments.length?(m=g,p):m},function(g){return u=g,s=g(e),i=g(t),o=g(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p}}function KC(){var e=Ps(Bf()(Sr));return e.copy=function(){return Os(e,KC())},Ja.apply(e,arguments)}function YC(){var e=bg(Bf()).domain([.1,1,10]);return e.copy=function(){return Os(e,YC()).base(e.base())},Ja.apply(e,arguments)}function GC(){var e=wg(Bf());return e.copy=function(){return Os(e,GC()).constant(e.constant())},Ja.apply(e,arguments)}function Dg(){var e=jg(Bf());return e.copy=function(){return Os(e,Dg()).exponent(e.exponent())},Ja.apply(e,arguments)}function fU(){return Dg.apply(null,arguments).exponent(.5)}const xl=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:mg,scaleDiverging:KC,scaleDivergingLog:YC,scaleDivergingPow:Dg,scaleDivergingSqrt:fU,scaleDivergingSymlog:GC,scaleIdentity:CC,scaleImplicit:mp,scaleLinear:SC,scaleLog:MC,scaleOrdinal:fg,scalePoint:JW,scalePow:Ng,scaleQuantile:EC,scaleQuantize:AC,scaleRadial:OC,scaleSequential:WC,scaleSequentialLog:UC,scaleSequentialPow:Ag,scaleSequentialQuantile:HC,scaleSequentialSqrt:uU,scaleSequentialSymlog:qC,scaleSqrt:K7,scaleSymlog:PC,scaleThreshold:DC,scaleTime:cU,scaleUtc:dU,tickFormat:kC},Symbol.toStringTag,{value:"Module"}));var es=e=>e.chartData,VC=te([es],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),XC=(e,t,r,n)=>n?VC(e):es(e),mU=(e,t,r)=>r?VC(e):es(e);function Fa(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Ge(t)&&Ge(r))return!0}return!1}function Yb(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function QC(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,i;if(Ge(r))s=r;else if(typeof r=="function")return;if(Ge(n))i=n;else if(typeof n=="function")return;var o=[s,i];if(Fa(o))return o}}function hU(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Fa(n))return Yb(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,i]=e,o,l;if(s==="auto")t!=null&&(o=Math.min(...t));else if(Ce(s))o=s;else if(typeof s=="function")try{t!=null&&(o=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&m0.test(s)){var c=m0.exec(s);if(c==null||c[1]==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(i==="auto")t!=null&&(l=Math.max(...t));else if(Ce(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&h0.test(i)){var u=h0.exec(i);if(u==null||u[1]==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t==null?void 0:t[1];var m=[o,l];if(Fa(m))return t==null?m:Yb(m,t,r)}}}var To=1e9,pU={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ig,vt=!0,vn="[DecimalError] ",ni=vn+"Invalid argument: ",Tg=vn+"Exponent out of range: ",Io=Math.floor,Bs=Math.pow,xU=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,en,Vt=1e7,ht=7,ZC=9007199254740991,hu=Io(ZC/ht),we={};we.absoluteValue=we.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};we.comparedTo=we.cmp=function(e){var t,r,n,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,s=e.d.length,t=0,r=n<s?n:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};we.decimalPlaces=we.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ht;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};we.dividedBy=we.div=function(e){return Pa(this,new this.constructor(e))};we.dividedToIntegerBy=we.idiv=function(e){var t=this,r=t.constructor;return it(Pa(t,new r(e),0,1),r.precision)};we.equals=we.eq=function(e){return!this.cmp(e)};we.exponent=function(){return It(this)};we.greaterThan=we.gt=function(e){return this.cmp(e)>0};we.greaterThanOrEqualTo=we.gte=function(e){return this.cmp(e)>=0};we.isInteger=we.isint=function(){return this.e>this.d.length-2};we.isNegative=we.isneg=function(){return this.s<0};we.isPositive=we.ispos=function(){return this.s>0};we.isZero=function(){return this.s===0};we.lessThan=we.lt=function(e){return this.cmp(e)<0};we.lessThanOrEqualTo=we.lte=function(e){return this.cmp(e)<1};we.logarithm=we.log=function(e){var t,r=this,n=r.constructor,s=n.precision,i=s+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(en))throw Error(vn+"NaN");if(r.s<1)throw Error(vn+(r.s?"NaN":"-Infinity"));return r.eq(en)?new n(0):(vt=!1,t=Pa(Ll(r,i),Ll(e,i),i),vt=!0,it(t,s))};we.minus=we.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?t_(t,e):JC(t,(e.s=-e.s,e))};we.modulo=we.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(vn+"NaN");return r.s?(vt=!1,t=Pa(r,e,0,1).times(e),vt=!0,r.minus(t)):it(new n(r),s)};we.naturalExponential=we.exp=function(){return e_(this)};we.naturalLogarithm=we.ln=function(){return Ll(this)};we.negated=we.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};we.plus=we.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?JC(t,e):t_(t,(e.s=-e.s,e))};we.precision=we.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ni+e);if(t=It(s)+1,n=s.d.length-1,r=n*ht+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};we.squareRoot=we.sqrt=function(){var e,t,r,n,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(vn+"NaN")}for(e=It(l),vt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Qn(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=Io((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(s.toString()),r=c.precision,s=o=r+3;;)if(i=n,n=i.plus(Pa(l,i,o+2)).times(.5),Qn(i.d).slice(0,o)===(t=Qn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(it(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return vt=!0,it(n,r)};we.times=we.mul=function(e){var t,r,n,s,i,o,l,c,d,u=this,f=u.constructor,m=u.d,p=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=m.length,d=p.length,c<d&&(i=m,m=p,p=i,o=c,c=d,d=o),i=[],o=c+d,n=o;n--;)i.push(0);for(n=d;--n>=0;){for(t=0,s=c+n;s>n;)l=i[s]+p[n]*m[s-n-1]+t,i[s--]=l%Vt|0,t=l/Vt|0;i[s]=(i[s]+t)%Vt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,vt?it(e,f.precision):e};we.toDecimalPlaces=we.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(la(e,0,To),t===void 0?t=n.rounding:la(t,0,8),it(r,e+It(r)+1,t))};we.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=gi(n,!0):(la(e,0,To),t===void 0?t=s.rounding:la(t,0,8),n=it(new s(n),e+1,t),r=gi(n,!0,e+1)),r};we.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?gi(s):(la(e,0,To),t===void 0?t=i.rounding:la(t,0,8),n=it(new i(s),e+It(s)+1,t),r=gi(n.abs(),!1,e+It(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};we.toInteger=we.toint=function(){var e=this,t=e.constructor;return it(new t(e),It(e)+1,t.rounding)};we.toNumber=function(){return+this};we.toPower=we.pow=function(e){var t,r,n,s,i,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(en);if(l=new c(l),!l.s){if(e.s<1)throw Error(vn+"Infinity");return l}if(l.eq(en))return l;if(n=c.precision,e.eq(en))return it(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=ZC){for(s=new c(en),t=Math.ceil(n/ht+4),vt=!1;r%2&&(s=s.times(l),Vb(s.d,t)),r=Io(r/2),r!==0;)l=l.times(l),Vb(l.d,t);return vt=!0,e.s<0?new c(en).div(s):it(s,n)}}else if(i<0)throw Error(vn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,vt=!1,s=e.times(Ll(l,n+d)),vt=!0,s=e_(s),s.s=i,s};we.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=It(s),n=gi(s,r<=i.toExpNeg||r>=i.toExpPos)):(la(e,1,To),t===void 0?t=i.rounding:la(t,0,8),s=it(new i(s),e,t),r=It(s),n=gi(s,e<=r||r<=i.toExpNeg,e)),n};we.toSignificantDigits=we.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(la(e,1,To),t===void 0?t=n.rounding:la(t,0,8)),it(new n(r),e,t)};we.toString=we.valueOf=we.val=we.toJSON=we[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),r=e.constructor;return gi(e,t<=r.toExpNeg||t>=r.toExpPos)};function JC(e,t){var r,n,s,i,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),vt?it(t,f):t;if(c=e.d,d=t.d,o=e.e,s=t.e,c=c.slice(),i=o-s,i){for(i<0?(n=c,i=-i,l=d.length):(n=d,s=o,l=c.length),o=Math.ceil(f/ht),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=d.length,l-i<0&&(i=l,n=d,d=c,c=n),r=0;i;)r=(c[--i]=c[i]+d[i]+r)/Vt|0,c[i]%=Vt;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,vt?it(t,f):t}function la(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ni+e)}function Qn(e){var t,r,n,s=e.length-1,i="",o=e[0];if(s>0){for(i+=o,t=1;t<s;t++)n=e[t]+"",r=ht-n.length,r&&(i+=ls(r)),i+=n;o=e[t],n=o+"",r=ht-n.length,r&&(i+=ls(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Pa=function(){function e(n,s){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*s+o,n[l]=i%Vt|0,o=i/Vt|0;return o&&n.unshift(o),n}function t(n,s,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*Vt+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var l,c,d,u,f,m,p,x,g,v,y,w,N,j,k,b,S,_,C=n.constructor,P=n.s==s.s?1:-1,D=n.d,E=s.d;if(!n.s)return new C(n);if(!s.s)throw Error(vn+"Division by zero");for(c=n.e-s.e,S=E.length,k=D.length,p=new C(P),x=p.d=[],d=0;E[d]==(D[d]||0);)++d;if(E[d]>(D[d]||0)&&--c,i==null?w=i=C.precision:o?w=i+(It(n)-It(s))+1:w=i,w<0)return new C(0);if(w=w/ht+2|0,d=0,S==1)for(u=0,E=E[0],w++;(d<k||u)&&w--;d++)N=u*Vt+(D[d]||0),x[d]=N/E|0,u=N%E|0;else{for(u=Vt/(E[0]+1)|0,u>1&&(E=e(E,u),D=e(D,u),S=E.length,k=D.length),j=S,g=D.slice(0,S),v=g.length;v<S;)g[v++]=0;_=E.slice(),_.unshift(0),b=E[0],E[1]>=Vt/2&&++b;do u=0,l=t(E,g,S,v),l<0?(y=g[0],S!=v&&(y=y*Vt+(g[1]||0)),u=y/b|0,u>1?(u>=Vt&&(u=Vt-1),f=e(E,u),m=f.length,v=g.length,l=t(f,g,m,v),l==1&&(u--,r(f,S<m?_:E,m))):(u==0&&(l=u=1),f=E.slice()),m=f.length,m<v&&f.unshift(0),r(g,f,v),l==-1&&(v=g.length,l=t(E,g,S,v),l<1&&(u++,r(g,S<v?_:E,v))),v=g.length):l===0&&(u++,g=[0]),x[d++]=u,l&&g[0]?g[v++]=D[j]||0:(g=[D[j]],v=1);while((j++<k||g[0]!==void 0)&&w--)}return x[0]||x.shift(),p.e=c,it(p,o?i+It(p)+1:i)}}();function e_(e,t){var r,n,s,i,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(It(e)>16)throw Error(Tg+It(e));if(!e.s)return new u(en);for(vt=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(Bs(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(en),u.precision=l;;){if(s=it(s.times(e),l),r=r.times(++c),o=i.plus(Pa(s,r,l)),Qn(o.d).slice(0,l)===Qn(i.d).slice(0,l)){for(;d--;)i=it(i.times(i),l);return u.precision=f,t==null?(vt=!0,it(i,f)):i}i=o}}function It(e){for(var t=e.e*ht,r=e.d[0];r>=10;r/=10)t++;return t}function rh(e,t,r){if(t>e.LN10.sd())throw vt=!0,r&&(e.precision=r),Error(vn+"LN10 precision limit exceeded");return it(new e(e.LN10),t)}function ls(e){for(var t="";e--;)t+="0";return t}function Ll(e,t){var r,n,s,i,o,l,c,d,u,f=1,m=10,p=e,x=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(vn+(p.s?"NaN":"-Infinity"));if(p.eq(en))return new g(0);if(t==null?(vt=!1,d=v):d=t,p.eq(10))return t==null&&(vt=!0),rh(g,d);if(d+=m,g.precision=d,r=Qn(x),n=r.charAt(0),i=It(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Qn(p.d),n=r.charAt(0),f++;i=It(p),n>1?(p=new g("0."+r),i++):p=new g(n+"."+r.slice(1))}else return c=rh(g,d+2,v).times(i+""),p=Ll(new g(n+"."+r.slice(1)),d-m).plus(c),g.precision=v,t==null?(vt=!0,it(p,v)):p;for(l=o=p=Pa(p.minus(en),p.plus(en),d),u=it(p.times(p),d),s=3;;){if(o=it(o.times(u),d),c=l.plus(Pa(o,new g(s),d)),Qn(c.d).slice(0,d)===Qn(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(rh(g,d+2,v).times(i+""))),l=Pa(l,new g(f),d),g.precision=v,t==null?(vt=!0,it(l,v)):l;l=c,s+=2}}function Gb(e,t){var r,n,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(n,s),t){if(s-=n,r=r-n-1,e.e=Io(r/ht),e.d=[],n=(r+1)%ht,r<0&&(n+=ht),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ht;n<s;)e.d.push(+t.slice(n,n+=ht));t=t.slice(n),n=ht-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),vt&&(e.e>hu||e.e<-hu))throw Error(Tg+r)}else e.s=0,e.e=0,e.d=[0];return e}function it(e,t,r){var n,s,i,o,l,c,d,u,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=ht,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/ht),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=ht,s=n-ht+o}if(r!==void 0&&(i=Bs(10,o-s-1),l=d/i%10|0,c=t<0||f[u+1]!==void 0||d%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?d/Bs(10,o-s):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=It(e),f.length=1,t=t-i-1,f[0]=Bs(10,(ht-t%ht)%ht),e.e=Io(-t/ht)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,i=1,u--):(f.length=u+1,i=Bs(10,ht-n),f[u]=s>0?(d/Bs(10,o-s)%Bs(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Vt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Vt)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(vt&&(e.e>hu||e.e<-hu))throw Error(Tg+It(e));return e}function t_(e,t){var r,n,s,i,o,l,c,d,u,f,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),vt?it(t,p):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),s=Math.max(Math.ceil(p/ht),l)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=f.length,u=s<l,u&&(l=s),s=0;s<l;s++)if(c[s]!=f[s]){u=c[s]<f[s];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,s=f.length-l;s>0;--s)c[l++]=0;for(s=f.length;s>o;){if(c[--s]<f[s]){for(i=s;i&&c[--i]===0;)c[i]=Vt-1;--c[i],c[s]+=Vt}c[s]-=f[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,vt?it(t,p):t):new m(0)}function gi(e,t,r){var n,s=It(e),i=Qn(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+ls(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+ls(-s-1)+i,r&&(n=r-o)>0&&(i+=ls(n))):s>=o?(i+=ls(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+ls(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=ls(n))),e.s<0?"-"+i:i}function Vb(e,t){if(e.length>t)return e.length=t,!0}function r_(e){var t,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ni+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return Gb(o,i.toString())}else if(typeof i!="string")throw Error(ni+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,xU.test(i))Gb(o,i);else throw Error(ni+i)}if(s.prototype=we,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=r_,s.config=s.set=gU,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return s.config(e),s}function gU(e){if(!e||typeof e!="object")throw Error(vn+"Object expected");var t,r,n,s=["precision",1,To,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((n=e[r=s[t]])!==void 0)if(Io(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ni+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ni+r+": "+n);return this}var Ig=r_(pU);en=new Ig(1);const rt=Ig;function n_(e){var t;return e===0?t=1:t=Math.floor(new rt(e).abs().log(10).toNumber())+1,t}function a_(e,t,r){for(var n=new rt(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var s_=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},i_=(e,t,r)=>{if(e.lte(0))return new rt(0);var n=n_(e.toNumber()),s=new rt(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new rt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?new rt(c.toNumber()):new rt(Math.ceil(c.toNumber()))},vU=(e,t,r)=>{var n=new rt(1),s=new rt(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new rt(10).pow(n_(e)-1),s=new rt(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new rt(Math.floor(e)))}else e===0?s=new rt(Math.floor((t-1)/2)):r||(s=new rt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new rt(c-o).mul(n)).toNumber());return l},o_=function(t,r,n,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new rt(0),tickMin:new rt(0),tickMax:new rt(0)};var o=i_(new rt(r).sub(t).div(n-1),s,i),l;t<=0&&r>=0?l=new rt(0):(l=new rt(t).add(r).div(2),l=l.sub(new rt(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new rt(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?o_(t,r,n,s,i+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new rt(c).mul(o)),tickMax:l.add(new rt(d).mul(o))})},yU=function(t){var[r,n]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),[l,c]=s_([r,n]);if(l===-1/0||c===1/0){var d=c===1/0?[l,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),c];return r>n?d.reverse():d}if(l===c)return vU(l,s,i);var{step:u,tickMin:f,tickMax:m}=o_(l,c,o,i,0),p=a_(f,m.add(new rt(.1).mul(u)),u);return r>n?p.reverse():p},bU=function(t,r){var[n,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=s_([n,s]);if(o===-1/0||l===1/0)return[n,s];if(o===l)return[o];var c=Math.max(r,2),d=i_(new rt(l).sub(o).div(c-1),i,0),u=[...a_(new rt(o),new rt(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>s?u.reverse():u},l_=e=>e.rootProps.maxBarSize,wU=e=>e.rootProps.barGap,c_=e=>e.rootProps.barCategoryGap,jU=e=>e.rootProps.barSize,Wf=e=>e.rootProps.stackOffset,d_=e=>e.rootProps.reverseStackOrder,Rg=e=>e.options.chartName,$g=e=>e.rootProps.syncId,u_=e=>e.rootProps.syncMethod,zg=e=>e.options.eventEmitter,Cr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Rs={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},qn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Uf=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function qf(e,t,r){if(r!=="auto")return r;if(e!=null)return Ms(e,t)?"category":"number"}function Xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function pu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xb(Object(r),!0).forEach(function(n){NU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NU(e,t,r){return(t=kU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kU(e){var t=SU(e,"string");return typeof t=="symbol"?t:t+""}function SU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qb={allowDataOverflow:Rs.allowDataOverflow,allowDecimals:Rs.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Rs.angleAxisId,includeHidden:!1,name:void 0,reversed:Rs.reversed,scale:Rs.scale,tick:Rs.tick,tickCount:void 0,ticks:void 0,type:Rs.type,unit:void 0},Zb={allowDataOverflow:qn.allowDataOverflow,allowDecimals:qn.allowDecimals,allowDuplicatedCategory:qn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:qn.radiusAxisId,includeHidden:qn.includeHidden,name:void 0,reversed:qn.reversed,scale:qn.scale,tick:qn.tick,tickCount:qn.tickCount,ticks:void 0,type:qn.type,unit:void 0},CU=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Lg=te([CU,G2],(e,t)=>{var r;if(e!=null)return e;var n=(r=qf(t,"angleAxis",Qb.type))!==null&&r!==void 0?r:"category";return pu(pu({},Qb),{},{type:n})}),_U=(e,t)=>e.polarAxis.radiusAxis[t],Fg=te([_U,G2],(e,t)=>{var r;if(e!=null)return e;var n=(r=qf(t,"radiusAxis",Zb.type))!==null&&r!==void 0?r:"category";return pu(pu({},Zb),{},{type:n})}),Hf=e=>e.polarOptions,Bg=te([Qa,Za,Zt],MW),f_=te([Hf,Bg],(e,t)=>{if(e!=null)return Tn(e.innerRadius,t,0)}),m_=te([Hf,Bg],(e,t)=>{if(e!=null)return Tn(e.outerRadius,t,t*.8)}),MU=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},h_=te([Hf],MU);te([Lg,h_],Uf);var p_=te([Bg,f_,m_],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});te([Fg,p_],Uf);var x_=te([lt,Hf,f_,m_,Qa,Za],(e,t,r,n,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Tn(o,s,s/2),cy:Tn(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),er=(e,t)=>t,Kf=(e,t,r)=>r;function Wg(e){return e==null?void 0:e.id}function g_(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=Wg(l);d.forEach((f,m)=>{var p=i==null||s?m:String(mr(f,i,null)),x=mr(f,l.dataKey,0),g;o.has(p)?g=o.get(p):g={},Object.assign(g,{[u]:x}),o.set(p,g)})}}),Array.from(o.values())}function Yf(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Gf=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Vf(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function PU(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var tr=e=>{var t=lt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ro=e=>e.tooltip.settings.axisId;function OU(e){if(e in xl)return xl[e]();var t="scale".concat(fc(e));if(t in xl)return xl[t]()}function Jb(e){var t=e.ticks,r=e.bandwidth,n=e.range(),s=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:function(i){function o(){return i.apply(this,arguments)}return o.toString=function(){return i.toString()},o}(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var o=s[0],l=s[1];return o<=l?i>=o&&i<=l:i>=l&&i<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,o)=>{var l=e(i);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function ew(e,t,r){if(typeof e=="function")return Jb(e.copy().domain(t).range(r));if(e!=null){var n=OU(e);if(n!=null)return n.domain(t).range(r),Jb(n)}}var EU=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Fa(t)){for(var r,n,s=0;s<t.length;s++){var i=t[s];Ge(i)&&((r===void 0||i<r)&&(r=i),(n===void 0||i>n)&&(n=i))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function tw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tw(Object(r),!0).forEach(function(n){AU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AU(e,t,r){return(t=DU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DU(e){var t=TU(e,"string");return typeof t=="symbol"?t:t+""}function TU(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gp=[0,"auto"],Yt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},v_=(e,t)=>e.cartesianAxis.xAxis[t],ts=(e,t)=>{var r=v_(e,t);return r??Yt},Gt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:gp,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:pc},y_=(e,t)=>e.cartesianAxis.yAxis[t],rs=(e,t)=>{var r=y_(e,t);return r??Gt},IU={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Ug=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??IU},Ir=(e,t,r)=>{switch(t){case"xAxis":return ts(e,r);case"yAxis":return rs(e,r);case"zAxis":return Ug(e,r);case"angleAxis":return Lg(e,r);case"radiusAxis":return Fg(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},RU=(e,t,r)=>{switch(t){case"xAxis":return ts(e,r);case"yAxis":return rs(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},jc=(e,t,r)=>{switch(t){case"xAxis":return ts(e,r);case"yAxis":return rs(e,r);case"angleAxis":return Lg(e,r);case"radiusAxis":return Fg(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},b_=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function w_(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var qg=e=>e.graphicalItems.cartesianItems,$U=te([er,Kf],w_),j_=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),Nc=te([qg,Ir,$U],j_,{memoizeOptions:{resultEqualityCheck:Vf}}),N_=te([Nc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Yf)),k_=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),zU=te([Nc],k_),S_=e=>e.map(t=>t.data).filter(Boolean).flat(1),LU=te([Nc],S_,{memoizeOptions:{resultEqualityCheck:Vf}}),C_=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},Hg=te([LU,XC],C_),__=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:mr(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:mr(s,n)}))):e.map(n=>({value:n})),Xf=te([Hg,Ir,Nc],__);function M_(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function yd(e){if(ia(e)||e instanceof Date){var t=Number(e);if(Ge(t))return t}}function rw(e){if(Array.isArray(e)){var t=[yd(e[0]),yd(e[1])];return Fa(t)?t:void 0}var r=yd(e);if(r!=null)return[r,r]}function Ba(e){return e.map(yd).filter(Ur)}function FU(e,t,r){return!r||typeof t!="number"||sa(t)?[]:r.length?Ba(r.flatMap(n=>{var s=mr(e,n.dataKey),i,o;if(Array.isArray(s)?[i,o]=s:i=o=s,!(!Ge(i)||!Ge(o)))return[t-i,t+o]})):[]}var Ht=e=>{var t=tr(e),r=Ro(e);return jc(e,t,r)},kc=te([Ht],e=>e==null?void 0:e.dataKey),BU=te([N_,XC,Ht],g_),P_=(e,t,r,n)=>{var s={},i=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},s);return Object.fromEntries(Object.entries(i).map(o=>{var[l,c]=o,d=n?[...c].reverse():c,u=d.map(Wg);return[l,{stackedData:j8(e,u,r),graphicalItems:d}]}))},vp=te([BU,N_,Wf,d_],P_),O_=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=_8(e,s,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},WU=te([Ir],e=>e.allowDataOverflow),Kg=e=>{var t;if(e==null||!("domain"in e))return gp;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ba(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:gp},E_=te([Ir],Kg),A_=te([E_,WU],QC),UU=te([vp,es,er,A_],O_,{memoizeOptions:{resultEqualityCheck:Gf}}),Yg=e=>e.errorBars,qU=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>M_(r,n)),gu=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),o=Math.min(...i),l=Math.max(...i);return[o,l]}},D_=(e,t,r,n,s)=>{var i,o;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(y=>M_(s,y)),m=mr(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),p=FU(l,m,f);if(p.length>=2){var x=Math.min(...p),g=Math.max(...p);(i==null||x<i)&&(i=x),(o==null||g>o)&&(o=g)}var v=rw(m);v!=null&&(i=i==null?v[0]:Math.min(i,v[0]),o=o==null?v[1]:Math.max(o,v[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=rw(mr(l,t.dataKey));c!=null&&(i=i==null?c[0]:Math.min(i,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),Ge(i)&&Ge(o))return[i,o]},HU=te([Hg,Ir,zU,Yg,er],D_,{memoizeOptions:{resultEqualityCheck:Gf}});function KU(e){var{value:t}=e;if(ia(t)||t instanceof Date)return t}var YU=(e,t,r)=>{var n=e.map(KU).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&PS(n))?pC(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},T_=e=>e.referenceElements.dots,$o=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),GU=te([T_,er,Kf],$o),I_=e=>e.referenceElements.areas,VU=te([I_,er,Kf],$o),R_=e=>e.referenceElements.lines,XU=te([R_,er,Kf],$o),$_=(e,t)=>{if(e!=null){var r=Ba(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},QU=te(GU,er,$_),z_=(e,t)=>{if(e!=null){var r=Ba(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},ZU=te([VU,er],z_);function JU(e){var t;if(e.x!=null)return Ba([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ba(r)}function eq(e){var t;if(e.y!=null)return Ba([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ba(r)}var L_=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?JU(n):eq(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},tq=te([XU,er],L_),rq=te(QU,tq,ZU,(e,t,r)=>gu(e,r,t)),F_=(e,t,r,n,s,i,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?gu(n,i,s):gu(i,s);return hU(t,d,e.allowDataOverflow)},nq=te([Ir,E_,A_,UU,HU,rq,lt,er],F_,{memoizeOptions:{resultEqualityCheck:Gf}}),aq=[0,1],B_=(e,t,r,n,s,i,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=Ms(t,i);if(d&&l==null){var u;return pC(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?YU(n,e,d):s==="expand"?aq:o}},Gg=te([Ir,lt,Hg,Xf,Wf,er,nq],B_);function sq(e){return e in xl}var W_=(e,t,r)=>{if(e!=null){var{scale:n,type:s}=e;if(n==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof n=="string"){var i="scale".concat(fc(n));return sq(i)?i:"point"}}},zo=te([Ir,b_,Rg],W_);function Vg(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?ew(e.scale,r,n):ew(t,r,n)}var U_=(e,t,r)=>{var n=Kg(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Fa(e))return yU(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Fa(e))return bU(e,t.tickCount,t.allowDecimals)}},Xg=te([Gg,jc,zo],U_),q_=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Fa(t)&&Array.isArray(r)&&r.length>0){var s,i,o=t[0],l=(s=r[0])!==null&&s!==void 0?s:0,c=t[1],d=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(o,l),Math.max(c,d)]}return t},iq=te([Ir,Gg,Xg,er],q_),oq=te(Xf,Ir,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ba(e.map(f=>f.value))).sort((f,m)=>f-m),s=n[0],i=n[n.length-1];if(s==null||i==null)return 1/0;var o=i-s;if(o===0)return 1/0;for(var l=0;l<n.length-1;l++){var c=n[l],d=n[l+1];if(!(c==null||d==null)){var u=d-c;r=Math.min(r,u)}}return r/o}}),H_=te(oq,lt,c_,Zt,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!Ge(e))return 0;var i=t==="vertical"?n.height:n.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var o=Tn(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),lq=(e,t,r)=>{var n=ts(e,t);return n==null||typeof n.padding!="string"?0:H_(e,"xAxis",t,r,n.padding)},cq=(e,t,r)=>{var n=rs(e,t);return n==null||typeof n.padding!="string"?0:H_(e,"yAxis",t,r,n.padding)},dq=te(ts,lq,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((n=s.right)!==null&&n!==void 0?n:0)+t}}),uq=te(rs,cq,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((n=s.bottom)!==null&&n!==void 0?n:0)+t}}),fq=te([Zt,dq,Of,Pf,(e,t,r)=>r],(e,t,r,n,s)=>{var{padding:i}=n;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),mq=te([Zt,lt,uq,Of,Pf,(e,t,r)=>r],(e,t,r,n,s,i)=>{var{padding:o}=s;return i?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Sc=(e,t,r,n)=>{var s;switch(t){case"xAxis":return fq(e,r,n);case"yAxis":return mq(e,r,n);case"zAxis":return(s=Ug(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return h_(e);case"radiusAxis":return p_(e,r);default:return}},K_=te([Ir,Sc],Uf),hq=te([zo,iq],EU),Qf=te([Ir,zo,hq,K_],Vg);te([Nc,Yg,er],qU);function Y_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Zf=(e,t)=>t,Jf=(e,t,r)=>r,pq=te(_f,Zf,Jf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Y_)),xq=te(Mf,Zf,Jf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Y_)),G_=(e,t)=>({width:e.width,height:t.height}),gq=(e,t)=>{var r=typeof t.width=="number"?t.width:pc;return{width:r,height:e.height}},V_=te(Zt,ts,G_),vq=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},yq=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},bq=te(Za,Zt,pq,Zf,Jf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=G_(t,l);o==null&&(o=vq(t,n,e));var d=n==="top"&&!s||n==="bottom"&&s;i[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),i}),wq=te(Qa,Zt,xq,Zf,Jf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=gq(t,l);o==null&&(o=yq(t,n,e));var d=n==="left"&&!s||n==="right"&&s;i[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),i}),jq=(e,t)=>{var r=ts(e,t);if(r!=null)return bq(e,r.orientation,r.mirror)},Nq=te([Zt,ts,jq,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),kq=(e,t)=>{var r=rs(e,t);if(r!=null)return wq(e,r.orientation,r.mirror)},Sq=te([Zt,rs,kq,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var s=r==null?void 0:r[n];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),X_=te(Zt,rs,(e,t)=>{var r=typeof t.width=="number"?t.width:pc;return{width:r,height:e.height}}),nw=(e,t,r)=>{switch(t){case"xAxis":return V_(e,r).width;case"yAxis":return X_(e,r).height;default:return}},Q_=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:o}=r,l=Ms(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&s&&PS(c))return c}},Qg=te([lt,Xf,Ir,er],Q_),Z_=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,o=Ms(e,n);if(o&&(s==="number"||i!=="auto"))return t.map(l=>l.value)}},Zg=te([lt,Xf,jc,er],Z_),aw=te([lt,RU,zo,Qf,Qg,Zg,Sc,Xg,er],(e,t,r,n,s,i,o,l,c)=>{if(t!=null){var d=Ms(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:i,duplicateDomain:s,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),Cq=(e,t,r,n,s,i,o,l,c)=>{if(!(t==null||n==null)){var d=Ms(e,c),{type:u,ticks:f,tickCount:m}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,x=u==="category"&&n.bandwidth?n.bandwidth()/p:0;x=c==="angleAxis"&&i!=null&&i.length>=2?Wr(i[0]-i[1])*2*x:x;var g=f||s;return g?g.map((v,y)=>{var w=o?o.indexOf(v):v,N=n.map(w);return Ge(N)?{index:y,coordinate:N+x,value:v,offset:x}:null}).filter(Ur):d&&l?l.map((v,y)=>{var w=n.map(v);return Ge(w)?{coordinate:w+x,value:v,index:y,offset:x}:null}).filter(Ur):n.ticks?n.ticks(m).map((v,y)=>{var w=n.map(v);return Ge(w)?{coordinate:w+x,value:v,index:y,offset:x}:null}).filter(Ur):n.domain().map((v,y)=>{var w=n.map(v);return Ge(w)?{coordinate:w+x,value:o?o[v]:v,index:y,offset:x}:null}).filter(Ur)}},J_=te([lt,jc,zo,Qf,Xg,Sc,Qg,Zg,er],Cq),_q=(e,t,r,n,s,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=Ms(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Wr(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return Ge(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Ur):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return Ge(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Ur):r.domain().map((u,f)=>{var m=r.map(u);return Ge(m)?{coordinate:m+d,value:s?s[u]:u,index:f,offset:d}:null}).filter(Ur)}},uo=te([lt,jc,Qf,Sc,Qg,Zg,er],_q),fo=te(Ir,Qf,(e,t)=>{if(!(e==null||t==null))return xu(xu({},e),{},{scale:t})}),Mq=te([Ir,zo,Gg,K_],Vg);te((e,t,r)=>Ug(e,r),Mq,(e,t)=>{if(!(e==null||t==null))return xu(xu({},e),{},{scale:t})});var Pq=te([lt,_f,Mf],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),eM=e=>e.options.defaultTooltipEventType,tM=e=>e.options.validateTooltipEventTypes;function rM(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Jg(e,t){var r=eM(e),n=tM(e);return rM(t,r,n)}function Oq(e){return De(t=>Jg(t,e))}var nM=(e,t)=>{var r,n=Number(t);if(!(sa(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},Eq=e=>e.tooltip.settings,ds={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Aq={itemInteraction:{click:ds,hover:ds},axisInteraction:{click:ds,hover:ds},keyboardInteraction:ds,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},aM=Xr({name:"tooltip",initialState:Aq,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:gt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=En(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:gt()},removeTooltipEntrySettings:{reducer(e,t){var r=En(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:gt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Dq,replaceTooltipEntrySettings:Tq,removeTooltipEntrySettings:Iq,setTooltipSettingsState:Rq,setActiveMouseOverItemIndex:sM,mouseLeaveItem:$q,mouseLeaveChart:iM,setActiveClickItemIndex:zq,setMouseOverAxisIndex:oM,setMouseClickAxisIndex:Lq,setSyncInteraction:yp,setKeyboardInteraction:bp}=aM.actions,Fq=aM.reducer;function sw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ad(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sw(Object(r),!0).forEach(function(n){Bq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bq(e,t,r){return(t=Wq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wq(e){var t=Uq(e,"string");return typeof t=="symbol"?t:t+""}function Uq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qq(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Hq(e){return e.index!=null}var lM=(e,t,r,n)=>{if(t==null)return ds;var s=qq(e,t,r);if(s==null)return ds;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(Hq(s)){if(i)return ad(ad({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return ad(ad({},ds),{},{coordinate:s.coordinate})};function Kq(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function Yq(e,t){var r=Kq(e),n=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(n,s),o=Math.max(n,s);return r>=i&&r<=o}function Gq(e,t,r){if(r==null||t==null)return!0;var n=mr(e,t);return n==null||!Fa(r)?!0:Yq(n,r)}var ev=(e,t,r,n)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Ge(i))return s;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(i,l)),d=t[c];return d==null||Gq(d,r,n)?String(c):null},cM=(e,t,r,n,s,i,o)=>{if(i!=null){var l=o[0],c=l==null?void 0:l.getPosition(i);if(c!=null)return c;var d=s==null?void 0:s[Number(i)];if(d)switch(r){case"horizontal":return{x:d.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:d.coordinate}}}},dM=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,s==null&&n!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},uM=e=>e.options.tooltipPayloadSearcher,Lo=e=>e.tooltip;function iw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ow(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iw(Object(r),!0).forEach(function(n){Vq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vq(e,t,r){return(t=Xq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xq(e){var t=Qq(e,"string");return typeof t=="symbol"?t:t+""}function Qq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zq(e,t){return e??t}var fM=(e,t,r,n,s,i,o)=>{if(!(t==null||i==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((m,p)=>{var x,{dataDefinedOnItem:g,settings:v}=p,y=Zq(g,l),w=Array.isArray(y)?D2(y,d,u):y,N=(x=v==null?void 0:v.dataKey)!==null&&x!==void 0?x:n,j=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&o==="axis"?k=AL(w,n,s):k=i(w,t,c,j),Array.isArray(k))k.forEach(S=>{var _=ow(ow({},v),{},{name:S.name,unit:S.unit,color:void 0,fill:void 0});m.push(p0({tooltipEntrySettings:_,dataKey:S.dataKey,payload:S.payload,value:mr(S.payload,S.dataKey),name:S.name}))});else{var b;m.push(p0({tooltipEntrySettings:v,dataKey:N,payload:k,value:mr(k,N),name:(b=mr(k,j))!==null&&b!==void 0?b:v==null?void 0:v.name}))}return m},f)}},tv=te([Ht,b_,Rg],W_),Jq=te([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),eH=te([tr,Ro],w_),Fo=te([Jq,Ht,eH],j_,{memoizeOptions:{resultEqualityCheck:Vf}}),tH=te([Fo],e=>e.filter(Yf)),rH=te([Fo],S_,{memoizeOptions:{resultEqualityCheck:Vf}}),Bo=te([rH,es],C_),nH=te([tH,es,Ht],g_),rv=te([Bo,Ht,Fo],__),mM=te([Ht],Kg),aH=te([Ht],e=>e.allowDataOverflow),hM=te([mM,aH],QC),sH=te([Fo],e=>e.filter(Yf)),iH=te([nH,sH,Wf,d_],P_),oH=te([iH,es,tr,hM],O_),lH=te([Fo],k_),cH=te([Bo,Ht,lH,Yg,tr],D_,{memoizeOptions:{resultEqualityCheck:Gf}}),dH=te([T_,tr,Ro],$o),uH=te([dH,tr],$_),fH=te([I_,tr,Ro],$o),mH=te([fH,tr],z_),hH=te([R_,tr,Ro],$o),pH=te([hH,tr],L_),xH=te([uH,pH,mH],gu),gH=te([Ht,mM,hM,oH,cH,xH,lt,tr],F_),Cc=te([Ht,lt,Bo,rv,Wf,tr,gH],B_),vH=te([Cc,Ht,tv],U_),yH=te([Ht,Cc,vH,tr],q_),pM=e=>{var t=tr(e),r=Ro(e),n=!1;return Sc(e,t,r,n)},xM=te([Ht,pM],Uf),gM=te([Ht,tv,yH,xM],Vg),bH=te([lt,rv,Ht,tr],Q_),wH=te([lt,rv,Ht,tr],Z_),jH=(e,t,r,n,s,i,o,l)=>{if(t){var{type:c}=t,d=Ms(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Wr(s[0]-s[1])*2*f:f,d&&o?o.map((m,p)=>{var x=n.map(m);return Ge(x)?{coordinate:x+f,value:m,index:p,offset:f}:null}).filter(Ur):n.domain().map((m,p)=>{var x=n.map(m);return Ge(x)?{coordinate:x+f,value:i?i[m]:m,index:p,offset:f}:null}).filter(Ur)}}},ns=te([lt,Ht,tv,gM,pM,bH,wH,tr],jH),nv=te([eM,tM,Eq],(e,t,r)=>rM(r.shared,e,t)),vM=e=>e.tooltip.settings.trigger,av=e=>e.tooltip.settings.defaultIndex,_c=te([Lo,nv,vM,av],lM),mo=te([_c,Bo,kc,Cc],ev),yM=te([ns,mo],nM),bM=te([_c],e=>{if(e)return e.dataKey});te([_c],e=>{if(e)return e.graphicalItemId});var wM=te([Lo,nv,vM,av],dM),NH=te([Qa,Za,lt,Zt,ns,av,wM],cM),kH=te([_c,NH],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),SH=te([_c],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),CH=te([wM,mo,es,kc,yM,uM,nv],fM);te([CH],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function lw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function cw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lw(Object(r),!0).forEach(function(n){_H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _H(e,t,r){return(t=MH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MH(e){var t=PH(e,"string");return typeof t=="symbol"?t:t+""}function PH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var OH=()=>De(Ht),EH=()=>{var e=OH(),t=De(ns),r=De(gM);return Gd(!e||!r?void 0:cw(cw({},e),{},{scale:r}),t)};function dw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dw(Object(r),!0).forEach(function(n){AH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AH(e,t,r){return(t=DH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IH=(e,t,r,n)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:s.coordinate}}return{x:0,y:0}},RH=(e,t,r,n)=>{var s=t.find(d=>d&&d.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:o}=n;return $i($i($i({},n),fr(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=s.coordinate,{angle:c}=n;return $i($i($i({},n),fr(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function $H(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var jM=(e,t,r,n,s)=>{var i,o=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,d,u,f,m,p=l>0?(c=r[l-1])===null||c===void 0?void 0:c.coordinate:(d=r[o-1])===null||d===void 0?void 0:d.coordinate,x=(u=r[l])===null||u===void 0?void 0:u.coordinate,g=l>=o-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(m=r[l+1])===null||m===void 0?void 0:m.coordinate,v=void 0;if(!(p==null||x==null||g==null))if(Wr(x-p)!==Wr(g-x)){var y=[];if(Wr(g-x)===Wr(s[1]-s[0])){v=g;var w=x+s[1]-s[0];y[0]=Math.min(w,(w+p)/2),y[1]=Math.max(w,(w+p)/2)}else{v=p;var N=g+s[1]-s[0];y[0]=Math.min(x,(N+x)/2),y[1]=Math.max(x,(N+x)/2)}var j=[Math.min(x,(v+x)/2),Math.max(x,(v+x)/2)];if(e>j[0]&&e<=j[1]||e>=y[0]&&e<=y[1]){var k;return(k=r[l])===null||k===void 0?void 0:k.index}}else{var b=Math.min(p,g),S=Math.max(p,g);if(e>(b+x)/2&&e<=(S+x)/2){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}}else if(t)for(var C=0;C<o;C++){var P=t[C];if(P!=null){var D=t[C+1],E=t[C-1];if(C===0&&D!=null&&e<=(P.coordinate+D.coordinate)/2||C===o-1&&E!=null&&e>(P.coordinate+E.coordinate)/2||C>0&&C<o-1&&E!=null&&D!=null&&e>(P.coordinate+E.coordinate)/2&&e<=(P.coordinate+D.coordinate)/2)return P.index}}return-1},zH=()=>De(Rg),sv=(e,t)=>t,NM=(e,t,r)=>r,iv=(e,t,r,n)=>n,LH=te(ns,e=>gf(e,t=>t.coordinate)),ov=te([Lo,sv,NM,iv],lM),lv=te([ov,Bo,kc,Cc],ev),FH=(e,t,r)=>{if(t!=null){var n=Lo(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},kM=te([Lo,sv,NM,iv],dM),vu=te([Qa,Za,lt,Zt,ns,iv,kM],cM),BH=te([ov,vu],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),SM=te([ns,lv],nM),WH=te([kM,lv,es,kc,SM,uM,sv],fM),UH=te([ov,lv],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qH=(e,t,r,n,s,i,o)=>{if(!(!e||!r||!n||!s)&&$H(e,o)){var l=M8(e,t),c=jM(l,i,s,r,n),d=IH(t,s,c,e);return{activeIndex:String(c),activeCoordinate:d}}},HH=(e,t,r,n,s,i,o)=>{if(!(!e||!n||!s||!i||!r)){var l=DW(e,r);if(l){var c=P8(l,t),d=jM(c,o,i,n,s),u=RH(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},KH=(e,t,r,n,s,i,o,l)=>{if(!(!e||!t||!n||!s||!i))return t==="horizontal"||t==="vertical"?qH(e,t,n,s,i,o,l):HH(e,t,r,n,s,i,o)},YH=te(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),GH=te(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(Cr)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:PU}});function uw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uw(Object(r),!0).forEach(function(n){VH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VH(e,t,r){return(t=XH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XH(e){var t=QH(e,"string");return typeof t=="symbol"?t:t+""}function QH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZH={},JH={zIndexMap:Object.values(Cr).reduce((e,t)=>fw(fw({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),ZH)},eK=new Set(Object.values(Cr));function tK(e){return eK.has(e)}var CM=Xr({name:"zIndex",initialState:JH,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:gt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!tK(r)&&delete e.zIndexMap[r])},prepare:gt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:s?void 0:n,panoramaElement:s?n:void 0}},prepare:gt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:gt()}}}),{registerZIndexPortal:rK,unregisterZIndexPortal:nK,registerZIndexPortalElement:aK,unregisterZIndexPortalElement:sK}=CM.actions,iK=CM.reducer;function as(e){var{zIndex:t,children:r}=e,n=aB(),s=n&&t!==void 0&&t!==0,i=Qr(),o=Et();h.useLayoutEffect(()=>s?(o(rK({zIndex:t})),()=>{o(nK({zIndex:t}))}):Eo,[o,t,s]);var l=De(c=>YH(c,t,i));return s?l?$p.createPortal(r,l):null:r}function wp(){return wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wp.apply(null,arguments)}function mw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function sd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mw(Object(r),!0).forEach(function(n){oK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oK(e,t,r){return(t=lK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lK(e){var t=cK(e,"string");return typeof t=="symbol"?t:t+""}function cK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dK(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return h.isValidElement(t)?h.cloneElement(t,n):h.createElement(r,n)}function uK(e){var t,{coordinate:r,payload:n,index:s,offset:i,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:u}=e,f=r,m=n,p=s;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var x,g,v;if(u==="ScatterChart")x=f,g=KB,v=Cr.cursorLine;else if(u==="BarChart")x=YB(l,f,i,o),g=lC,v=Cr.cursorRectangle;else if(l==="radial"&&AS(f)){var{cx:y,cy:w,radius:N,startAngle:j,endAngle:k}=cC(f);x={cx:y,cy:w,startAngle:j,endAngle:k,innerRadius:N,outerRadius:N},g=uC,v=Cr.cursorLine}else x={points:$W(l,f,i)},g=nC,v=Cr.cursorLine;var b=typeof c=="object"&&"className"in c?c.className:void 0,S=sd(sd(sd(sd({stroke:"#ccc",pointerEvents:"none"},i),x),Ix(c)),{},{payload:m,payloadIndex:p,className:ot("recharts-tooltip-cursor",b)});return h.createElement(as,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},h.createElement(dK,{cursor:c,cursorComp:g,cursorProps:S}))}function fK(e){var t=EH(),r=q2(),n=Ao(),s=zH();return t==null||r==null||n==null||s==null?null:h.createElement(uK,wp({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var _M=h.createContext(null),mK=()=>h.useContext(_M),MM={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new s(u,f||c,m),x=r?r+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,p=f.length,x=new Array(p);m<p;m++)x[m]=f[m].fn;return x},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,m,p,x){var g=r?r+d:d;if(!this._events[g])return!1;var v=this._events[g],y=arguments.length,w,N;if(v.fn){switch(v.once&&this.removeListener(d,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,f),!0;case 4:return v.fn.call(v.context,u,f,m),!0;case 5:return v.fn.call(v.context,u,f,m,p),!0;case 6:return v.fn.call(v.context,u,f,m,p,x),!0}for(N=1,w=new Array(y-1);N<y;N++)w[N-1]=arguments[N];v.fn.apply(v.context,w)}else{var j=v.length,k;for(N=0;N<j;N++)switch(v[N].once&&this.removeListener(d,v[N].fn,void 0,!0),y){case 1:v[N].fn.call(v[N].context);break;case 2:v[N].fn.call(v[N].context,u);break;case 3:v[N].fn.call(v[N].context,u,f);break;case 4:v[N].fn.call(v[N].context,u,f,m);break;default:if(!w)for(k=1,w=new Array(y-1);k<y;k++)w[k-1]=arguments[k];v[N].fn.apply(v[N].context,w)}}return!0},l.prototype.on=function(d,u,f){return i(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return i(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,m){var p=r?r+d:d;if(!this._events[p])return this;if(!u)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===u&&(!m||x.once)&&(!f||x.context===f)&&o(this,p);else{for(var g=0,v=[],y=x.length;g<y;g++)(x[g].fn!==u||m&&!x[g].once||f&&x[g].context!==f)&&v.push(x[g]);v.length?this._events[p]=v.length===1?v[0]:v:o(this,p)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(MM);var hK=MM.exports;const pK=Ua(hK);var Fl=new pK,jp="recharts.syncEvent.tooltip",hw="recharts.syncEvent.brush",xK=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!sa(r))return e[r]}},gK={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},PM=Xr({name:"options",initialState:gK,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),vK=PM.reducer,{createEventEmitter:yK}=PM.actions;function bK(e){return e.tooltip.syncInteraction}var wK={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},OM=Xr({name:"chartData",initialState:wK,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:pw,setDataStartEndIndexes:jK,setComputedData:Lte}=OM.actions,NK=OM.reducer,kK=["x","y"];function xw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xw(Object(r),!0).forEach(function(n){SK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SK(e,t,r){return(t=CK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CK(e){var t=_K(e,"string");return typeof t=="symbol"?t:t+""}function _K(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MK(e,t){if(e==null)return{};var r,n,s=PK(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function PK(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function OK(){var e=De($g),t=De(zg),r=Et(),n=De(u_),s=De(ns),i=Ao(),o=Ef(),l=De(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return Eo;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var m;if(o&&u!==null&&u!==void 0&&(m=u.payload)!==null&&m!==void 0&&m.coordinate&&u.payload.sourceViewBox){var p=u.payload.coordinate,{x,y:g}=p,v=MK(p,kK),{x:y,y:w,width:N,height:j}=u.payload.sourceViewBox,k=zi(zi({},v),{},{x:o.x+(N?(x-y)/N:0)*o.width,y:o.y+(j?(g-w)/j:0)*o.height});r(zi(zi({},u),{},{payload:zi(zi({},u.payload),{},{coordinate:k})}))}else r(u);return}if(s!=null){var b;if(typeof n=="function"){var S={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},_=n(s,S);b=s[_]}else n==="value"&&(b=s.find(Y=>String(Y.value)===u.payload.label));var{coordinate:C}=u.payload;if(b==null||u.payload.active===!1||C==null||o==null){r(yp({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:P,y:D}=C,E=Math.min(P,o.x+o.width),I=Math.min(D,o.y+o.height),F={x:i==="horizontal"?b.coordinate:E,y:i==="horizontal"?I:b.coordinate},Q=yp({active:u.payload.active,coordinate:F,dataKey:u.payload.dataKey,index:String(b.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(Q)}}};return Fl.on(jp,c),()=>{Fl.off(jp,c)}},[l,r,t,e,n,s,i,o])}function EK(){var e=De($g),t=De(zg),r=Et();h.useEffect(()=>{if(e==null)return Eo;var n=(s,i,o)=>{t!==o&&e===s&&r(jK(i))};return Fl.on(hw,n),()=>{Fl.off(hw,n)}},[r,t,e])}function AK(){var e=Et();h.useEffect(()=>{e(yK())},[e]),OK(),EK()}function DK(e,t,r,n,s,i){var o=De(p=>FH(p,e,t)),l=De(zg),c=De($g),d=De(u_),u=De(bK),f=u==null?void 0:u.active,m=Ef();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var p=yp({active:i,coordinate:r,dataKey:o,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});Fl.emit(jp,c,p,l)}},[f,r,o,s,n,l,c,d,i,m])}function gw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gw(Object(r),!0).forEach(function(n){TK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TK(e,t,r){return(t=IK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IK(e){var t=RK(e,"string");return typeof t=="symbol"?t:t+""}function RK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $K(e){return e.dataKey}function zK(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(SB,t)}var yw=[],LK={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function FK(e){var t,r,n=ln(e,LK),{active:s,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:p,reverseDirection:x,useTranslate3d:g,wrapperStyle:v,cursor:y,shared:w,trigger:N,defaultIndex:j,portal:k,axisId:b}=n,S=Et(),_=typeof j=="number"?String(j):j;h.useEffect(()=>{S(Rq({shared:w,trigger:N,axisId:b,active:s,defaultIndex:_}))},[S,w,N,b,s,_]);var C=Ef(),P=rC(),D=Oq(w),{activeIndex:E,isActive:I}=(t=De(O=>UH(O,D,N,_)))!==null&&t!==void 0?t:{},F=De(O=>WH(O,D,N,_)),Q=De(O=>SM(O,D,N,_)),Y=De(O=>BH(O,D,N,_)),X=F,re=mK(),ee=(r=s??I)!==null&&r!==void 0?r:!1,[T,M]=mF([X,ee]),$=D==="axis"?Q:void 0;DK(D,N,Y,$,E,ee);var K=k??re;if(K==null||C==null||D==null)return null;var z=X??yw;ee||(z=yw),d&&z.length&&(z=XL(z.filter(O=>O.value!=null&&(O.hide!==!0||n.includeHidden)),m,$K));var G=z.length>0,A=h.createElement(AB,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:ee,coordinate:Y,hasPayload:G,offset:f,position:p,reverseDirection:x,useTranslate3d:g,viewBox:C,wrapperStyle:v,lastBoundingBox:T,innerRef:M,hasPortalFromProps:!!k},zK(c,vw(vw({},n),{},{payload:z,label:$,active:ee,activeIndex:E,coordinate:Y,accessibilityLayer:P})));return h.createElement(h.Fragment,null,$p.createPortal(A,K),ee&&h.createElement(fK,{cursor:y,tooltipEventType:D,coordinate:Y,payload:z,index:E}))}var EM=e=>null;EM.displayName="Cell";function BK(e,t,r){return(t=WK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WK(e){var t=UK(e,"string");return typeof t=="symbol"?t:t+""}function UK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class qK{constructor(t){BK(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function bw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function HK(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bw(Object(r),!0).forEach(function(n){KK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KK(e,t,r){return(t=YK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YK(e){var t=GK(e,"string");return typeof t=="symbol"?t:t+""}function GK(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VK={cacheSize:2e3,enableCache:!0},AM=HK({},VK),ww=new qK(AM.cacheSize),XK={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},jw="recharts_measurement_span";function QK(e,t){var r=t.fontSize||"",n=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(s,"|").concat(i,"|").concat(o,"|").concat(l)}var Nw=(e,t)=>{try{var r=document.getElementById(jw);r||(r=document.createElement("span"),r.setAttribute("id",jw),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,XK,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},wl=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||If.isSsr)return{width:0,height:0};if(!AM.enableCache)return Nw(t,r);var n=QK(t,r),s=ww.get(n);if(s)return s;var i=Nw(t,r);return ww.set(n,i),i},DM;function ZK(e,t,r){return(t=JK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JK(e){var t=eY(e,"string");return typeof t=="symbol"?t:t+""}function eY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Sw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tY=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,rY=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,nY={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},aY=["cm","mm","pt","pc","in","Q","px"];function sY(e){return aY.includes(e)}var Ui="NaN";function iY(e,t){return e*nY[t]}class cr{static parse(t){var r,[,n,s]=(r=rY.exec(t))!==null&&r!==void 0?r:[];return n==null?cr.NaN:new cr(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,sa(t)&&(this.unit=""),r!==""&&!tY.test(r)&&(this.num=NaN,this.unit=""),sY(r)&&(this.num=iY(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new cr(NaN,""):new cr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new cr(NaN,""):new cr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new cr(NaN,""):new cr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new cr(NaN,""):new cr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return sa(this.num)}}DM=cr;ZK(cr,"NaN",new DM(NaN,""));function TM(e){if(e==null||e.includes(Ui))return Ui;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,i]=(r=kw.exec(t))!==null&&r!==void 0?r:[],o=cr.parse(n??""),l=cr.parse(i??""),c=s==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Ui;t=t.replace(kw,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=Sw.exec(t))!==null&&d!==void 0?d:[],p=cr.parse(u??""),x=cr.parse(m??""),g=f==="+"?p.add(x):p.subtract(x);if(g.isNaN())return Ui;t=t.replace(Sw,g.toString())}return t}var Cw=/\(([^()]*)\)/;function oY(e){for(var t=e,r;(r=Cw.exec(t))!=null;){var[,n]=r;t=t.replace(Cw,TM(n))}return t}function lY(e){var t=e.replace(/\s+/g,"");return t=oY(t),t=TM(t),t}function cY(e){try{return lY(e)}catch{return Ui}}function nh(e){var t=cY(e.slice(5,-1));return t===Ui?"":t}var dY=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],uY=["dx","dy","angle","className","breakAll"];function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Np.apply(null,arguments)}function _w(e,t){if(e==null)return{};var r,n,s=fY(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var IM=/[ \f\n\r\t\v\u2028\u2029]+/,RM=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Qt(t)||(r?s=t.toString().split(""):s=t.toString().split(IM));var i=s.map(l=>({word:l,width:wl(l,n).width})),o=r?0:wl(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function mY(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var $M=(e,t,r,n)=>e.reduce((s,i)=>{var{word:o,width:l}=i,c=s[s.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(o),c.width+=l+r;else{var d={words:[o],width:l};s.push(d)}return s},[]),zM=e=>e.reduce((t,r)=>t.width>r.width?t:r),hY="…",Mw=(e,t,r,n,s,i,o,l)=>{var c=e.slice(0,t),d=RM({breakAll:r,style:n,children:c+hY});if(!d)return[!1,[]];var u=$M(d.wordsWithComputedWidth,i,o,l),f=u.length>s||zM(u).width>Number(i);return[f,u]},pY=(e,t,r,n,s)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=Ce(i),u=String(o),f=$M(t,n,r,s);if(!d||s)return f;var m=f.length>i||zM(f).width>Number(n);if(!m)return f;for(var p=0,x=u.length-1,g=0,v;p<=x&&g<=u.length-1;){var y=Math.floor((p+x)/2),w=y-1,[N,j]=Mw(u,w,c,l,i,n,r,s),[k]=Mw(u,y,c,l,i,n,r,s);if(!N&&!k&&(p=y+1),N&&k&&(x=y-1),!N&&k){v=j;break}g++}return v||f},Pw=e=>{var t=Qt(e)?[]:e.toString().split(IM);return[{words:t,width:void 0}]},xY=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:i,maxLines:o}=e;if((t||r)&&!If.isSsr){var l,c,d=RM({breakAll:i,children:n,style:s});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return Pw(n);return pY({breakAll:i,children:n,maxLines:o,style:s},l,c,t,!!r)}return Pw(n)},LM="#808080",gY={angle:0,breakAll:!1,capHeight:"0.71em",fill:LM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},cv=h.forwardRef((e,t)=>{var r=ln(e,gY),{x:n,y:s,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=_w(r,dY),m=h.useMemo(()=>xY({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:p,dy:x,angle:g,className:v,breakAll:y}=f,w=_w(f,uY);if(!ia(n)||!ia(s)||m.length===0)return null;var N=Number(n)+(Ce(p)?p:0),j=Number(s)+(Ce(x)?x:0);if(!Ge(N)||!Ge(j))return null;var k;switch(u){case"start":k=nh("calc(".concat(o,")"));break;case"middle":k=nh("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=nh("calc(".concat(m.length-1," * -").concat(i,")"));break}var b=[],S=m[0];if(c&&S!=null){var _=S.width,{width:C}=f;b.push("scale(".concat(Ce(C)&&Ce(_)?C/_:1,")"))}return g&&b.push("rotate(".concat(g,", ").concat(N,", ").concat(j,")")),b.length&&(w.transform=b.join(" ")),h.createElement("text",Np({},xn(w),{ref:t,x:N,y:j,className:ot("recharts-text",v),textAnchor:d,fill:l.includes("url")?LM:l}),m.map((P,D)=>{var E=P.words.join(y?"":" ");return h.createElement("tspan",{x:N,dy:D===0?k:i,key:"".concat(E,"-").concat(D)},E)}))});cv.displayName="Text";function Ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ow(Object(r),!0).forEach(function(n){vY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ow(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vY(e,t,r){return(t=yY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yY(e){var t=bY(e,"string");return typeof t=="symbol"?t:t+""}function bY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wY=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=ig(t),u=i,f=i+(c-d)/2,m=(u+f)/2,p=(c+d)/2,x=u+c/2,g=l>=0?1:-1,v=g*n,y=g>0?"end":"start",w=g>0?"start":"end",N=c>=0?1:-1,j=N*n,k=N>0?"end":"start",b=N>0?"start":"end",S=s;if(r==="top"){var _={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return S&&(_.height=Math.max(o-S.y,0),_.width=c),_}if(r==="bottom"){var C={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:w};return S&&(C.height=Math.max(S.y+S.height-(o+l),0),C.width=d),C}if(r==="left"){var P={x:m-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return S&&(P.width=Math.max(P.x-S.x,0),P.height=l),P}if(r==="right"){var D={x:m+p+j,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"};return S&&(D.width=Math.max(S.x+S.width-D.x,0),D.height=l),D}var E=S?{width:p,height:l}:{};return r==="insideLeft"?Hn({x:m+j,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},E):r==="insideRight"?Hn({x:m+p-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},E):r==="insideTop"?Hn({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:w},E):r==="insideBottom"?Hn({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},E):r==="insideTopLeft"?Hn({x:u+j,y:o+v,horizontalAnchor:b,verticalAnchor:w},E):r==="insideTopRight"?Hn({x:u+c-j,y:o+v,horizontalAnchor:k,verticalAnchor:w},E):r==="insideBottomLeft"?Hn({x:f+j,y:o+l-v,horizontalAnchor:b,verticalAnchor:y},E):r==="insideBottomRight"?Hn({x:f+d-j,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},E):r&&typeof r=="object"&&(Ce(r.x)||mi(r.x))&&(Ce(r.y)||mi(r.y))?Hn({x:i+Tn(r.x,p),y:o+Tn(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},E):Hn({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},E)},jY=["labelRef"],NY=["content"];function Ew(e,t){if(e==null)return{};var r,n,s=kY(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function kY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Aw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function gl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Aw(Object(r),!0).forEach(function(n){SY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Aw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SY(e,t,r){return(t=CY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CY(e){var t=_Y(e,"string");return typeof t=="symbol"?t:t+""}function _Y(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ja(){return ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ja.apply(null,arguments)}var FM=h.createContext(null),MY=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o,children:l}=e,c=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:s,width:i,height:o}),[t,r,n,s,i,o]);return h.createElement(FM.Provider,{value:c},l)},BM=()=>{var e=h.useContext(FM),t=Ef();return e||(t?ig(t):void 0)},PY=h.createContext(null),OY=()=>{var e=h.useContext(PY),t=De(x_);return e||t},EY=e=>{var{value:t,formatter:r}=e,n=Qt(e.children)?t:e.children;return typeof r=="function"?r(n):n},dv=e=>e!=null&&typeof e=="function",AY=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},DY=(e,t,r,n,s)=>{var{offset:i,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:m,clockWise:p}=s,x=(d+u)/2,g=AY(f,m),v=g>=0?1:-1,y,w;switch(t){case"insideStart":y=f+v*i,w=p;break;case"insideEnd":y=m-v*i,w=!p;break;case"end":y=m+v*i,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=g<=0?w:!w;var N=fr(l,c,x,y),j=fr(l,c,x,y+(w?1:-1)*359),k="M".concat(N.x,",").concat(N.y,`
608
- A`).concat(x,",").concat(x,",0,1,").concat(w?0:1,`,
609
- `).concat(j.x,",").concat(j.y),b=Qt(e.id)?_l("recharts-radial-line-"):e.id;return h.createElement("text",ja({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},TY=(e,t,r)=>{var{cx:n,cy:s,innerRadius:i,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=fr(n,s,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:s,textAnchor:"middle",verticalAnchor:"end"};var m=(i+o)/2,{x:p,y:x}=fr(n,s,m,d);return{x:p,y:x,textAnchor:"middle",verticalAnchor:"middle"}},bd=e=>e!=null&&"cx"in e&&Ce(e.cx),IY={angle:0,offset:5,zIndex:Cr.label,position:"middle",textBreakAll:!1};function RY(e){if(!bd(e))return e;var{cx:t,cy:r,outerRadius:n}=e,s=n*2;return{x:t-n,y:r-n,width:s,upperWidth:s,lowerWidth:s,height:s}}function cs(e){var t=ln(e,IY),{viewBox:r,parentViewBox:n,position:s,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=OY(),m=BM(),p=s==="center"?m:f??m,x,g,v;r==null?x=p:bd(r)?x=r:x=ig(r);var y=RY(x);if(!x||Qt(i)&&Qt(o)&&!h.isValidElement(l)&&typeof l!="function")return null;var w=gl(gl({},t),{},{viewBox:x});if(h.isValidElement(l)){var{labelRef:N}=w,j=Ew(w,jY);return h.cloneElement(l,j)}if(typeof l=="function"){var{content:k}=w,b=Ew(w,NY);if(g=h.createElement(l,b),h.isValidElement(g))return g}else g=EY(t);var S=xn(t);if(bd(x)){if(s==="insideStart"||s==="insideEnd"||s==="end")return DY(t,s,g,S,x);v=TY(x,t.offset,t.position)}else{if(!y)return null;var _=wY({viewBox:y,position:s,offset:t.offset,parentViewBox:bd(n)?void 0:n});v=gl(gl({x:_.x,y:_.y,textAnchor:_.horizontalAnchor,verticalAnchor:_.verticalAnchor},_.width!==void 0?{width:_.width}:{}),_.height!==void 0?{height:_.height}:{})}return h.createElement(as,{zIndex:t.zIndex},h.createElement(cv,ja({ref:u,className:ot("recharts-label",c)},S,v,{textAnchor:mY(S.textAnchor)?S.textAnchor:v.textAnchor,breakAll:d}),g))}cs.displayName="Label";var $Y=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(cs,ja({key:"label-implicit"},n)):ia(e)?h.createElement(cs,ja({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===cs?h.cloneElement(e,gl({key:"label-implicit"},n)):h.createElement(cs,ja({key:"label-implicit",content:e},n)):dv(e)?h.createElement(cs,ja({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(cs,ja({},e,{key:"label-implicit"},n)):null};function zY(e){var{label:t,labelRef:r}=e,n=BM();return $Y(t,n,r)||null}var WM={},UM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(UM);var qM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(qM);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UM,r=qM,n=pf;function s(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(WM);var LY=WM.last;const FY=Ua(LY);var BY=["valueAccessor"],WY=["dataKey","clockWise","id","textBreakAll","zIndex"];function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yu.apply(null,arguments)}function Dw(e,t){if(e==null)return{};var r,n,s=UY(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function UY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var qY=e=>Array.isArray(e.value)?FY(e.value):e.value,HM=h.createContext(void 0),HY=HM.Provider,KM=h.createContext(void 0);KM.Provider;function KY(){return h.useContext(HM)}function YY(){return h.useContext(KM)}function wd(e){var{valueAccessor:t=qY}=e,r=Dw(e,BY),{dataKey:n,clockWise:s,id:i,textBreakAll:o,zIndex:l}=r,c=Dw(r,WY),d=KY(),u=YY(),f=d||u;return!f||!f.length?null:h.createElement(as,{zIndex:l??Cr.label},h.createElement(Ia,{className:"recharts-label-list"},f.map((m,p)=>{var x,g=Qt(n)?t(m,p):mr(m.payload,n),v=Qt(i)?{}:{id:"".concat(i,"-").concat(p)};return h.createElement(cs,yu({key:"label-".concat(p)},xn(m),c,v,{fill:(x=r.fill)!==null&&x!==void 0?x:m.fill,parentViewBox:m.parentViewBox,value:g,textBreakAll:o,viewBox:m.viewBox,index:p,zIndex:0}))})))}wd.displayName="LabelList";function GY(e){var{label:t}=e;return t?t===!0?h.createElement(wd,{key:"labelList-implicit"}):h.isValidElement(t)||dv(t)?h.createElement(wd,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(wd,yu({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var VY={radiusAxis:{},angleAxis:{}},YM=Xr({name:"polarAxis",initialState:VY,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:Fte,removeRadiusAxis:Bte,addAngleAxis:Wte,removeAngleAxis:Ute}=YM.actions,XY=YM.reducer;function QY(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var GM={exports:{}},ct={};/**
610
- * @license React
611
- * react-is.production.js
612
- *
613
- * Copyright (c) Meta Platforms, Inc. and affiliates.
614
- *
615
- * This source code is licensed under the MIT license found in the
616
- * LICENSE file in the root directory of this source tree.
617
- */var uv=Symbol.for("react.transitional.element"),fv=Symbol.for("react.portal"),em=Symbol.for("react.fragment"),tm=Symbol.for("react.strict_mode"),rm=Symbol.for("react.profiler"),nm=Symbol.for("react.consumer"),am=Symbol.for("react.context"),sm=Symbol.for("react.forward_ref"),im=Symbol.for("react.suspense"),om=Symbol.for("react.suspense_list"),lm=Symbol.for("react.memo"),cm=Symbol.for("react.lazy"),ZY=Symbol.for("react.view_transition"),JY=Symbol.for("react.client.reference");function bn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case uv:switch(e=e.type,e){case em:case rm:case tm:case im:case om:case ZY:return e;default:switch(e=e&&e.$$typeof,e){case am:case sm:case cm:case lm:return e;case nm:return e;default:return t}}case fv:return t}}}ct.ContextConsumer=nm;ct.ContextProvider=am;ct.Element=uv;ct.ForwardRef=sm;ct.Fragment=em;ct.Lazy=cm;ct.Memo=lm;ct.Portal=fv;ct.Profiler=rm;ct.StrictMode=tm;ct.Suspense=im;ct.SuspenseList=om;ct.isContextConsumer=function(e){return bn(e)===nm};ct.isContextProvider=function(e){return bn(e)===am};ct.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===uv};ct.isForwardRef=function(e){return bn(e)===sm};ct.isFragment=function(e){return bn(e)===em};ct.isLazy=function(e){return bn(e)===cm};ct.isMemo=function(e){return bn(e)===lm};ct.isPortal=function(e){return bn(e)===fv};ct.isProfiler=function(e){return bn(e)===rm};ct.isStrictMode=function(e){return bn(e)===tm};ct.isSuspense=function(e){return bn(e)===im};ct.isSuspenseList=function(e){return bn(e)===om};ct.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===em||e===rm||e===tm||e===im||e===om||typeof e=="object"&&e!==null&&(e.$$typeof===cm||e.$$typeof===lm||e.$$typeof===am||e.$$typeof===nm||e.$$typeof===sm||e.$$typeof===JY||e.getModuleId!==void 0)};ct.typeOf=bn;GM.exports=ct;var eG=GM.exports,Tw=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Iw=null,ah=null,VM=e=>{if(e===Iw&&Array.isArray(ah))return ah;var t=[];return h.Children.forEach(e,r=>{Qt(r)||(eG.isFragment(r)?t=t.concat(VM(r.props.children)):t.push(r))}),ah=t,Iw=e,t};function tG(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(s=>Tw(s)):n=[Tw(t)],VM(e).forEach(s=>{var i=ao(s,"type.displayName")||ao(s,"type.name");i&&n.indexOf(i)!==-1&&r.push(s)}),r}var XM={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var s;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!((s=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&s.writable)?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(XM);var rG=XM.isPlainObject;const nG=Ua(rG);var Rw,$w,zw,Lw,Fw;function Bw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ww(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bw(Object(r),!0).forEach(function(n){aG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aG(e,t,r){return(t=sG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sG(e){var t=iG(e,"string");return typeof t=="symbol"?t:t+""}function iG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bu.apply(null,arguments)}function fl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Uw=(e,t,r,n,s)=>{var i=r-n,o;return o=Ct(Rw||(Rw=fl(["M ",",",""])),e,t),o+=Ct($w||($w=fl(["L ",",",""])),e+r,t),o+=Ct(zw||(zw=fl(["L ",",",""])),e+r-i/2,t+s),o+=Ct(Lw||(Lw=fl(["L ",",",""])),e+r-i/2-n,t+s),o+=Ct(Fw||(Fw=fl(["L ",","," Z"])),e,t),o},oG={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lG=e=>{var t=ln(e,oG),{x:r,y:n,upperWidth:s,lowerWidth:i,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,m=h.useRef(null),[p,x]=h.useState(-1),g=h.useRef(s),v=h.useRef(i),y=h.useRef(o),w=h.useRef(r),N=h.useRef(n),j=dg(e,"trapezoid-");if(h.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var F=m.current.getTotalLength();F&&x(F)}catch{}},[]),r!==+r||n!==+n||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var k=ot("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",bu({},xn(t),{className:k,d:Uw(r,n,s,i,o)})));var b=g.current,S=v.current,_=y.current,C=w.current,P=N.current,D="0px ".concat(p===-1?1:p,"px"),E="".concat(p,"px 0px"),I=aC(["strokeDasharray"],d,c);return h.createElement(cg,{animationId:j,key:j,canBegin:p>0,duration:d,easing:c,isActive:f,begin:u},F=>{var Q=dr(b,s,F),Y=dr(S,i,F),X=dr(_,o,F),re=dr(C,r,F),ee=dr(P,n,F);m.current&&(g.current=Q,v.current=Y,y.current=X,w.current=re,N.current=ee);var T=F>0?{transition:I,strokeDasharray:E}:{strokeDasharray:D};return h.createElement("path",bu({},xn(t),{className:k,d:Uw(re,ee,Q,Y,X),ref:m,style:Ww(Ww({},T),t.style)}))})},cG=["option","shapeType","activeClassName"];function dG(e,t){if(e==null)return{};var r,n,s=uG(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function wu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qw(Object(r),!0).forEach(function(n){fG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fG(e,t,r){return(t=mG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mG(e){var t=hG(e,"string");return typeof t=="symbol"?t:t+""}function hG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pG(e,t){return wu(wu({},t),e)}function xG(e,t){return e==="symbols"}function Hw(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return h.createElement(lC,r);case"trapezoid":return h.createElement(lG,r);case"sector":return h.createElement(uC,r);case"symbols":if(xG(t))return h.createElement(ES,r);break;case"curve":return h.createElement(nC,r);default:return null}}function gG(e){return h.isValidElement(e)?e.props:e}function vG(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,s=dG(e,cG),i;if(h.isValidElement(t))i=h.cloneElement(t,wu(wu({},s),gG(t)));else if(typeof t=="function")i=t(s,s.index);else if(nG(t)&&typeof t!="boolean"){var o=pG(t,s);i=h.createElement(Hw,{shapeType:r,elementProps:o})}else{var l=s;i=h.createElement(Hw,{shapeType:r,elementProps:l})}return s.isActive?h.createElement(Ia,{className:n},i):i}var QM=(e,t,r)=>{var n=Et();return(s,i)=>o=>{e==null||e(s,i,o),n(sM({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},ZM=e=>{var t=Et();return(r,n)=>s=>{e==null||e(r,n,s),t($q())}},JM=(e,t,r)=>{var n=Et();return(s,i)=>o=>{e==null||e(s,i,o),n(zq({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function yG(e){var{tooltipEntrySettings:t}=e,r=Et(),n=Qr(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(Dq(t)):s.current!==t&&r(Tq({prev:s.current,next:t})),s.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{s.current&&(r(Iq(s.current)),s.current=null)},[r]),null}function bG(e){var{legendPayload:t}=e,r=Et(),n=Qr(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(gB(t)):s.current!==t&&r(vB({prev:s.current,next:t})),s.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{s.current&&(r(yB(s.current)),s.current=null)},[r]),null}var sh,wG=()=>{var[e]=h.useState(()=>_l("uid-"));return e},jG=(sh=SO.useId)!==null&&sh!==void 0?sh:wG;function NG(e,t){var r=jG();return t||(e?"".concat(e,"-").concat(r):r)}var kG=h.createContext(void 0),SG=e=>{var{id:t,type:r,children:n}=e,s=NG("recharts-".concat(r),t);return h.createElement(kG.Provider,{value:s},n(s))},CG={cartesianItems:[],polarItems:[]},eP=Xr({name:"graphicalItems",initialState:CG,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:gt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=En(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:gt()},removeCartesianGraphicalItem:{reducer(e,t){var r=En(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:gt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:gt()},removePolarGraphicalItem:{reducer(e,t){var r=En(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:gt()}}}),{addCartesianGraphicalItem:_G,replaceCartesianGraphicalItem:MG,removeCartesianGraphicalItem:PG,addPolarGraphicalItem:qte,removePolarGraphicalItem:Hte}=eP.actions,OG=eP.reducer,EG=e=>{var t=Et(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(_G(e)):r.current!==e&&t(MG({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(PG(r.current)),r.current=null)},[t]),null},AG=h.memo(EG);function Kw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Yw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kw(Object(r),!0).forEach(function(n){DG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DG(e,t,r){return(t=TG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TG(e){var t=IG(e,"string");return typeof t=="symbol"?t:t+""}function IG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tP=0,RG={xAxis:{},yAxis:{},zAxis:{}},rP=Xr({name:"cartesianAxis",initialState:RG,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:gt()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:gt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:gt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:gt()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:gt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:gt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:gt()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:gt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:gt()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,s=e.yAxis[r];if(s){var i,o=s.widthHistory||[];if(o.length===3&&o[0]===o[2]&&n===o[1]&&n!==s.width&&Math.abs(n-((i=o[0])!==null&&i!==void 0?i:0))<=1)return;var l=[...o,n].slice(-3);e.yAxis[r]=Yw(Yw({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:$G,replaceXAxis:zG,removeXAxis:LG,addYAxis:FG,replaceYAxis:BG,removeYAxis:WG,addZAxis:Kte,replaceZAxis:Yte,removeZAxis:Gte,updateYAxisWidth:UG}=rP.actions,qG=rP.reducer,HG=te([Zt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),KG=te([HG,Qa,Za],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),nP=()=>De(KG),Gw=(e,t,r)=>{var n=r??e;if(!Qt(n))return Tn(n,t,0)},YG=(e,t,r)=>{var n={},s=e.filter(Yf),i=e.filter(d=>d.stackId==null),o=s.reduce((d,u)=>{var f=d[u.stackId];return f==null&&(f=[]),f.push(u),d[u.stackId]=f,d},n),l=Object.entries(o).map(d=>{var u,[f,m]=d,p=m.map(g=>g.dataKey),x=Gw(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:p,barSize:x}}),c=i.map(d=>{var u=[d.dataKey].filter(m=>m!=null),f=Gw(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]};function Vw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function id(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vw(Object(r),!0).forEach(function(n){GG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GG(e,t,r){return(t=VG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VG(e){var t=XG(e,"string");return typeof t=="symbol"?t:t+""}function XG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QG(e,t,r,n,s){var i,o=n.length;if(!(o<1)){var l=Tn(e,r,0,!0),c,d=[];if(Ge((i=n[0])===null||i===void 0?void 0:i.barSize)){var u=!1,f=r/o,m=n.reduce((w,N)=>w+(N.barSize||0),0);m+=(o-1)*l,m>=r&&(m-=(o-1)*l,l=0),m>=r&&f>0&&(u=!0,f*=.9,m=o*f);var p=(r-m)/2>>0,x={offset:p-l,size:0};c=n.reduce((w,N)=>{var j,k={stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:x.offset+x.size+l,size:u?f:(j=N.barSize)!==null&&j!==void 0?j:0}},b=[...w,k];return x=k.position,b},d)}else{var g=Tn(t,r,0,!0);r-2*g-(o-1)*l<=0&&(l=0);var v=(r-2*g-(o-1)*l)/o;v>1&&(v>>=0);var y=Ge(s)?Math.min(v,s):v;c=n.reduce((w,N,j)=>[...w,{stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:g+(v+l)*j+(v-y)/2,size:y}}],d)}return c}}var ZG=(e,t,r,n,s,i,o)=>{var l=Qt(o)?t:o,c=QG(r,n,s!==i?s:i,e,l);return s!==i&&c!=null&&(c=c.map(d=>id(id({},d),{},{position:id(id({},d.position),{},{offset:d.position.offset-s/2})}))),c},JG=(e,t)=>{var r=Wg(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var s=e[n];if(s){var{stackedData:i}=s;if(i)return i.find(o=>o.key===r)}}}},eV=(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function tV(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ge(e.zIndex)?e.zIndex:t}var rV=e=>{var{chartData:t}=e,r=Et(),n=Qr();return h.useEffect(()=>n?()=>{}:(r(pw(t)),()=>{r(pw(void 0))}),[t,r,n]),null},Xw={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},aP=Xr({name:"brush",initialState:Xw,reducers:{setBrushSettings(e,t){return t.payload==null?Xw:t.payload}}}),{setBrushSettings:Vte}=aP.actions,nV=aP.reducer;function aV(e){return(e%180+180)%180}var sV=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=aV(s),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},iV={dots:[],areas:[],lines:[]},sP=Xr({name:"referenceElements",initialState:iV,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=En(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=En(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=En(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:Xte,removeDot:Qte,addArea:Zte,removeArea:Jte,addLine:ere,removeLine:tre}=sP.actions,oV=sP.reducer,lV=h.createContext(void 0),cV=e=>{var{children:t}=e,[r]=h.useState("".concat(_l("recharts"),"-clip")),n=nP();if(n==null)return null;var{x:s,y:i,width:o,height:l}=n;return h.createElement(lV.Provider,{value:r},h.createElement("defs",null,h.createElement("clipPath",{id:r},h.createElement("rect",{x:s,y:i,height:l,width:o}))),t)};function iP(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var s=e[n];s!==void 0&&r.push(s)}return r}function dV(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return sV(n,r)}function uV(e,t,r){var n=r==="width",{x:s,y:i,width:o,height:l}=e;return t===1?{start:n?s:i,end:n?s+o:i+l}:{start:n?s+o:i+l,end:n?s:i}}function Bl(e,t,r,n,s){if(e*t<e*n||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-s)<=0}function fV(e,t){return iP(e,t+1)}function mV(e,t,r,n,s){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:iP(n,d)};var g=c,v,y=()=>(v===void 0&&(v=r(x,g)),v),w=x.coordinate,N=c===0||Bl(e,w,y,u,l);N||(c=0,u=o,d+=1),N&&(u=w+e*(y()/2+s),c+=d)},m;d<=i.length;)if(m=f(),m)return m.v;return[]}function hV(e,t,r,n,s){var i=(n||[]).slice(),o=i.length;if(o===0)return[];for(var{start:l,end:c}=t,d=1;d<=o;d++){for(var u=(o-1)%d,f=l,m=!0,p=function(){var j=n[g];if(j==null)return 0;var k=g,b,S=()=>(b===void 0&&(b=r(j,k)),b),_=j.coordinate,C=g===u||Bl(e,_,S,f,c);if(!C)return m=!1,1;C&&(f=_+e*(S()/2+s))},x,g=u;g<o&&(x=p(),!(x!==0&&x===1));g+=d);if(m){for(var v=[],y=u;y<o;y+=d){var w=n[y];w!=null&&v.push(w)}return v}}return[]}function Qw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qw(Object(r),!0).forEach(function(n){pV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pV(e,t,r){return(t=xV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xV(e){var t=gV(e,"string");return typeof t=="symbol"?t:t+""}function gV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vV(e,t,r,n,s){for(var i=(n||[]).slice(),o=i.length,{start:l}=t,{end:c}=t,d=function(m){var p=i[m];if(p==null)return 1;var x=p,g,v=()=>(g===void 0&&(g=r(p,m)),g);if(m===o-1){var y=e*(x.coordinate+e*v()/2-c);i[m]=x=xr(xr({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else i[m]=x=xr(xr({},x),{},{tickCoord:x.coordinate});if(x.tickCoord!=null){var w=Bl(e,x.tickCoord,v,l,c);w&&(c=x.tickCoord-e*(v()/2+s),i[m]=xr(xr({},x),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function yV(e,t,r,n,s,i){var o=(n||[]).slice(),l=o.length,{start:c,end:d}=t;if(i){var u=n[l-1];if(u!=null){var f=r(u,l-1),m=e*(u.coordinate+e*f/2-d);if(o[l-1]=u=xr(xr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var p=Bl(e,u.tickCoord,()=>f,c,d);p&&(d=u.tickCoord-e*(f/2+s),o[l-1]=xr(xr({},u),{},{isShow:!0}))}}}for(var x=i?l-1:l,g=function(w){var N=o[w];if(N==null)return 1;var j=N,k,b=()=>(k===void 0&&(k=r(N,w)),k);if(w===0){var S=e*(j.coordinate-e*b()/2-c);o[w]=j=xr(xr({},j),{},{tickCoord:S<0?j.coordinate-S*e:j.coordinate})}else o[w]=j=xr(xr({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var _=Bl(e,j.tickCoord,b,c,d);_&&(c=j.tickCoord+e*(b()/2+s),o[w]=xr(xr({},j),{},{isShow:!0}))}},v=0;v<x;v++)g(v);return o}function mv(e,t,r){var{tick:n,ticks:s,viewBox:i,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!s||!s.length||!n)return[];if(Ce(c)||If.isSsr){var m;return(m=fV(s,Ce(c)?c:0))!==null&&m!==void 0?m:[]}var p=[],x=l==="top"||l==="bottom"?"width":"height",g=u&&x==="width"?wl(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,b)=>{var S=typeof d=="function"?d(k.value,b):k.value;return x==="width"?dV(wl(S,{fontSize:t,letterSpacing:r}),g,f):wl(S,{fontSize:t,letterSpacing:r})[x]},y=s[0],w=s[1],N=s.length>=2&&y!=null&&w!=null?Wr(w.coordinate-y.coordinate):1,j=uV(i,N,x);return c==="equidistantPreserveStart"?mV(N,j,v,s,o):c==="equidistantPreserveEnd"?hV(N,j,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?p=yV(N,j,v,s,o,c==="preserveStartEnd"):p=vV(N,j,v,s,o),p.filter(k=>k.isShow))}var bV=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:s=0,tickMargin:i=0}=e,o=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=s+i,d=o+c+l+(r?n:0);return Math.round(d)}return 0},wV=["axisLine","width","height","className","hide","ticks","axisType"];function jV(e,t){if(e==null)return{};var r,n,s=NV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function NV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vi.apply(null,arguments)}function Zw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zw(Object(r),!0).forEach(function(n){kV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kV(e,t,r){return(t=SV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SV(e){var t=CV(e,"string");return typeof t=="symbol"?t:t+""}function CV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oa={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Cr.axis};function _V(e){var{x:t,y:r,width:n,height:s,orientation:i,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=kt(kt(kt({},c),Ta(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=kt(kt({},d),{},{x1:t,y1:r+u*s,x2:t+n,y2:r+u*s})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=kt(kt({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return h.createElement("line",vi({},d,{className:ot("recharts-cartesian-axis-line",ao(l,"className"))}))}function MV(e,t,r,n,s,i,o,l,c){var d,u,f,m,p,x,g=l?-1:1,v=e.tickSize||o,y=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*s,f=m-g*v,x=f-g*c,p=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-g*v,p=d-g*c,x=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+g*v,p=d+g*c,x=y;break;default:d=u=e.coordinate,m=r+ +l*s,f=m+g*v,x=f+g*c,p=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:p,y:x}}}function PV(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function OV(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function EV(e){var{option:t,tickProps:r,value:n}=e,s,i=ot(r.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))s=h.cloneElement(t,kt(kt({},r),{},{className:i}));else if(typeof t=="function")s=t(kt(kt({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=ot(o,QY(t))),s=h.createElement(cv,vi({},r,{className:o}),n)}return s}var AV=h.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:s,stroke:i,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:m,y:p,width:x,height:g,tickSize:v,tickMargin:y,fontSize:w,letterSpacing:N,getTicksConfig:j,events:k,axisType:b}=e,S=mv(kt(kt({},j),{},{ticks:r}),w,N),_=PV(u,f),C=OV(u,f),P=Ta(j),D=Ix(n),E={};typeof s=="object"&&(E=s);var I=kt(kt({},P),{},{fill:"none"},E),F=S.map(X=>kt({entry:X},MV(X,m,p,x,g,u,v,f,y))),Q=F.map(X=>{var{entry:re,line:ee}=X;return h.createElement(Ia,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(re.value,"-").concat(re.coordinate,"-").concat(re.tickCoord)},s&&h.createElement("line",vi({},I,ee,{className:ot("recharts-cartesian-axis-tick-line",ao(s,"className"))})))}),Y=F.map((X,re)=>{var ee,T,{entry:M,tick:$}=X,K=kt(kt(kt(kt({verticalAnchor:C},P),{},{textAnchor:_,stroke:"none",fill:i},$),{},{index:re,payload:M,visibleTicksCount:S.length,tickFormatter:o,padding:c},d),{},{angle:(ee=(T=d==null?void 0:d.angle)!==null&&T!==void 0?T:P.angle)!==null&&ee!==void 0?ee:0}),z=kt(kt({},K),D);return h.createElement(Ia,vi({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},Fx(k,M,re)),n&&h.createElement(EV,{option:n,tickProps:z,value:"".concat(typeof o=="function"?o(M.value,re):M.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},Y.length>0&&h.createElement(as,{zIndex:Cr.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:t},Y)),Q.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},Q))}),DV=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:i,hide:o,ticks:l,axisType:c}=e,d=jV(e,wV),[u,f]=h.useState(""),[m,p]=h.useState(""),x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return bV({ticks:x.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var g=h.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=y;var w=y[0];if(w){var N=window.getComputedStyle(w),j=N.fontSize,k=N.letterSpacing;(j!==u||k!==m)&&(f(j),p(k))}}},[u,m]);return o||n!=null&&n<=0||s!=null&&s<=0?null:h.createElement(as,{zIndex:e.zIndex},h.createElement(Ia,{className:ot("recharts-cartesian-axis",i)},h.createElement(_V,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Ta(e)}),h.createElement(AV,{ref:g,axisType:c,events:d,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),h.createElement(MY,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(zY,{label:e.label,labelRef:e.labelRef}),e.children)))}),hv=h.forwardRef((e,t)=>{var r=ln(e,Oa);return h.createElement(DV,vi({},r,{ref:t}))});hv.displayName="CartesianAxis";var TV=["x1","y1","x2","y2","key"],IV=["offset"],RV=["xAxisId","yAxisId"],$V=["xAxisId","yAxisId"];function Jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Jw(Object(r),!0).forEach(function(n){zV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zV(e,t,r){return(t=LV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LV(e){var t=FV(e,"string");return typeof t=="symbol"?t:t+""}function FV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qs(){return Qs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qs.apply(null,arguments)}function ju(e,t){if(e==null)return{};var r,n,s=BV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function BV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var WV=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:s,width:i,height:o,ry:l}=e;return h.createElement("rect",{x:n,y:s,ry:l,width:i,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function oP(e){var{option:t,lineItemProps:r}=e,n;if(h.isValidElement(t))n=h.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var s,{x1:i,y1:o,x2:l,y2:c,key:d}=r,u=ju(r,TV),f=(s=Ta(u))!==null&&s!==void 0?s:{},{offset:m}=f,p=ju(f,IV);n=h.createElement("line",Qs({},p,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function UV(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=ju(e,RV),c=s.map((d,u)=>{var f=vr(vr({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(oP,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function qV(e){var{y:t,height:r,vertical:n=!0,verticalPoints:s}=e;if(!n||!s||!s.length)return null;var{xAxisId:i,yAxisId:o}=e,l=ju(e,$V),c=s.map((d,u)=>{var f=vr(vr({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(oP,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function HV(e){var{horizontalFill:t,fillOpacity:r,x:n,y:s,width:i,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var p=d[m+1],x=p==null,g=x?s+o-f:p-f;if(g<=0)return null;var v=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:g,width:i,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function KV(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:s,y:i,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+s-s)).sort((f,m)=>f-m);s!==d[0]&&d.unshift(0);var u=d.map((f,m)=>{var p=d[m+1],x=p==null,g=x?s+o-f:p-f;if(g<=0)return null;var v=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:g,height:l,stroke:"none",fill:r[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var YV=(e,t)=>{var{xAxis:r,width:n,height:s,offset:i}=e;return T2(mv(vr(vr(vr({},Oa),r),{},{ticks:I2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.left,i.left+i.width,t)},GV=(e,t)=>{var{yAxis:r,width:n,height:s,offset:i}=e;return T2(mv(vr(vr(vr({},Oa),r),{},{ticks:I2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.top,i.top+i.height,t)},VV={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Cr.grid};function lP(e){var t=H2(),r=K2(),n=q2(),s=vr(vr({},ln(e,VV)),{},{x:Ce(e.x)?e.x:n.left,y:Ce(e.y)?e.y:n.top,width:Ce(e.width)?e.width:n.width,height:Ce(e.height)?e.height:n.height}),{xAxisId:i,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:m,verticalValues:p}=s,x=Qr(),g=De(C=>aw(C,"xAxis",i,x)),v=De(C=>aw(C,"yAxis",o,x));if(!oa(d)||!oa(u)||!Ce(l)||!Ce(c))return null;var y=s.verticalCoordinatesGenerator||YV,w=s.horizontalCoordinatesGenerator||GV,{horizontalPoints:N,verticalPoints:j}=s;if((!N||!N.length)&&typeof w=="function"){var k=m&&m.length,b=w({yAxis:v?vr(vr({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);Vd(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(N=b)}if((!j||!j.length)&&typeof y=="function"){var S=p&&p.length,_=y({xAxis:g?vr(vr({},g),{},{ticks:S?p:g.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);Vd(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(j=_)}return h.createElement(as,{zIndex:s.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(WV,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),h.createElement(HV,Qs({},s,{horizontalPoints:N})),h.createElement(KV,Qs({},s,{verticalPoints:j})),h.createElement(UV,Qs({},s,{offset:n,horizontalPoints:N,xAxis:g,yAxis:v})),h.createElement(qV,Qs({},s,{offset:n,verticalPoints:j,xAxis:g,yAxis:v}))))}lP.displayName="CartesianGrid";var XV={},cP=Xr({name:"errorBars",initialState:XV,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==n.dataKey||s.direction!==n.direction))}}}),{addErrorBar:rre,replaceErrorBar:nre,removeErrorBar:are}=cP.actions,QV=cP.reducer,ZV=["children"];function JV(e,t){if(e==null)return{};var r,n,s=eX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function eX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var tX={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},rX=h.createContext(tX);function nX(e){var{children:t}=e,r=JV(e,ZV);return h.createElement(rX.Provider,{value:r},t)}function dP(e,t){var r,n,s=De(d=>ts(d,e)),i=De(d=>rs(d,t)),o=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Yt.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Gt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function aX(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=nP(),{needClipX:i,needClipY:o,needClip:l}=dP(t,r);if(!l||!s)return null;var{x:c,y:d,width:u,height:f}=s;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:i?c:c-u/2,y:o?d:d-f/2,width:i?u:u*2,height:o?f:f*2}))}var sX={};/**
618
- * @license React
619
- * use-sync-external-store-with-selector.production.js
620
- *
621
- * Copyright (c) Meta Platforms, Inc. and affiliates.
622
- *
623
- * This source code is licensed under the MIT license found in the
624
- * LICENSE file in the root directory of this source tree.
625
- */var Mc=h;function iX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oX=typeof Object.is=="function"?Object.is:iX,lX=Mc.useSyncExternalStore,cX=Mc.useRef,dX=Mc.useEffect,uX=Mc.useMemo,fX=Mc.useDebugValue;sX.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=cX(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=uX(function(){function c(p){if(!d){if(d=!0,u=p,p=n(p),s!==void 0&&o.hasValue){var x=o.value;if(s(x,p))return f=x}return f=p}if(x=f,oX(u,p))return x;var g=n(p);return s!==void 0&&s(x,g)?(u=p,x):(u=p,f=g)}var d=!1,u,f,m=r===void 0?null:r;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,r,n,s]);var l=lX(e,i[0],i[1]);return dX(function(){o.hasValue=!0,o.value=l},[l]),fX(l),l};function mX(e){e()}function hX(){let e=null,t=null;return{clear(){e=null,t=null},notify(){mX(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!n||e===null||(n=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var ej={notify(){},get:()=>[]};function pX(e,t){let r,n=ej,s=0,i=!1;function o(g){u();const v=n.subscribe(g);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){x.onStateChange&&x.onStateChange()}function d(){return i}function u(){s++,r||(r=e.subscribe(c),n=hX())}function f(){s--,r&&s===0&&(r(),r=void 0,n.clear(),n=ej)}function m(){i||(i=!0,u())}function p(){i&&(i=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:p,getListeners:()=>n};return x}var xX=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gX=xX(),vX=()=>typeof navigator<"u"&&navigator.product==="ReactNative",yX=vX(),bX=()=>gX||yX?h.useLayoutEffect:h.useEffect,wX=bX();function tj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function jX(e,t){if(tj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!tj(e[r[s]],t[r[s]]))return!1;return!0}var ih=Symbol.for("react-redux-context"),oh=typeof globalThis<"u"?globalThis:{};function NX(){if(!h.createContext)return{};const e=oh[ih]??(oh[ih]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var kX=NX();function SX(e){const{children:t,context:r,serverState:n,store:s}=e,i=h.useMemo(()=>{const c=pX(s);return{store:s,subscription:c,getServerState:n?()=>n:void 0}},[s,n]),o=h.useMemo(()=>s.getState(),[s]);wX(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,o]);const l=r||kX;return h.createElement(l.Provider,{value:i},t)}var CX=SX,_X=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function MX(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function pv(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(_X.has(n)){if(e[n]==null&&t[n]==null)continue;if(!jX(e[n],t[n]))return!1}else if(!MX(e[n],t[n]))return!1;return!0}function Oi(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:tP}function Ei(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:tP}var PX="Invariant failed";function OX(e,t){throw new Error(PX)}function kp(){return kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kp.apply(null,arguments)}function Nu(e){return h.createElement(vG,kp({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var EX=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,s)=>{if(Ce(t))return t;var i=Ce(n)||Qt(n);return i?t(n,s):(i||OX(),r)}},AX=(e,t,r)=>r,DX=(e,t)=>t,Pc=te([qg,DX],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),TX=te([Pc],e=>e==null?void 0:e.maxBarSize),IX=(e,t,r,n)=>n,RX=te([lt,qg,Oi,Ei,AX],(e,t,r,n,s)=>t.filter(i=>e==="horizontal"?i.xAxisId===r:i.yAxisId===n).filter(i=>i.isPanorama===s).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),$X=(e,t,r)=>{var n=lt(e),s=Oi(e,t),i=Ei(e,t);if(!(s==null||i==null))return n==="horizontal"?vp(e,"yAxis",i,r):vp(e,"xAxis",s,r)},zX=(e,t)=>{var r=lt(e),n=Oi(e,t),s=Ei(e,t);if(!(n==null||s==null))return r==="horizontal"?nw(e,"xAxis",n):nw(e,"yAxis",s)},LX=te([RX,jU,zX],YG),FX=(e,t,r)=>{var n,s,i=Pc(e,t);if(i==null)return 0;var o=Oi(e,t),l=Ei(e,t);if(o==null||l==null)return 0;var c=lt(e),d=l_(e),{maxBarSize:u}=i,f=Qt(u)?d:u,m,p;return c==="horizontal"?(m=fo(e,"xAxis",o,r),p=uo(e,"xAxis",o,r)):(m=fo(e,"yAxis",l,r),p=uo(e,"yAxis",l,r)),(n=(s=Gd(m,p,!0))!==null&&s!==void 0?s:f)!==null&&n!==void 0?n:0},uP=(e,t,r)=>{var n=lt(e),s=Oi(e,t),i=Ei(e,t);if(!(s==null||i==null)){var o,l;return n==="horizontal"?(o=fo(e,"xAxis",s,r),l=uo(e,"xAxis",s,r)):(o=fo(e,"yAxis",i,r),l=uo(e,"yAxis",i,r)),Gd(o,l)}},BX=te([LX,l_,wU,c_,FX,uP,TX],ZG),WX=(e,t,r)=>{var n=Oi(e,t);if(n!=null)return fo(e,"xAxis",n,r)},UX=(e,t,r)=>{var n=Ei(e,t);if(n!=null)return fo(e,"yAxis",n,r)},qX=(e,t,r)=>{var n=Oi(e,t);if(n!=null)return uo(e,"xAxis",n,r)},HX=(e,t,r)=>{var n=Ei(e,t);if(n!=null)return uo(e,"yAxis",n,r)},KX=te([BX,Pc],eV),YX=te([$X,Pc],JG),GX=te([Zt,ag,WX,UX,qX,HX,KX,lt,mU,uP,YX,Pc,IX],(e,t,r,n,s,i,o,l,c,d,u,f,m)=>{var{chartData:p,dataStartIndex:x,dataEndIndex:g}=c;if(!(f==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||s==null||i==null||d==null)){var{data:v}=f,y;if(v!=null&&v.length>0?y=v:y=p==null?void 0:p.slice(x,g+1),y!=null)return jQ({layout:l,barSettings:f,pos:o,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:s,yAxisTicks:i,stackedData:u,displayedData:y,offset:e,cells:m,dataStartIndex:x})}}),VX=["index"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(null,arguments)}function XX(e,t){if(e==null)return{};var r,n,s=QX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function QX(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var fP=h.createContext(void 0),ZX=e=>{var t=h.useContext(fP);if(t!=null)return t.stackId;if(e!=null)return N8(e)},JX=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),eQ=e=>{var t=h.useContext(fP);if(t!=null){var{stackId:r}=t;return"url(#".concat(JX(r,e),")")}},mP=e=>{var{index:t}=e,r=XX(e,VX),n=eQ(t);return h.createElement(Ia,Sp({className:"recharts-bar-stack-layer",clipPath:n},r))},tQ=["onMouseEnter","onMouseLeave","onClick"],rQ=["value","background","tooltipPosition"],nQ=["id"],aQ=["onMouseEnter","onClick","onMouseLeave"];function Wa(){return Wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wa.apply(null,arguments)}function rj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Nr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rj(Object(r),!0).forEach(function(n){sQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sQ(e,t,r){return(t=iQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iQ(e){var t=oQ(e,"string");return typeof t=="symbol"?t:t+""}function oQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ku(e,t){if(e==null)return{};var r,n,s=lQ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function lQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var cQ=e=>{var{dataKey:t,name:r,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:n,value:R2(r,t),payload:e}]},dQ=h.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:s,name:i,hide:o,unit:l,tooltipType:c,id:d}=e,u={dataDefinedOnItem:void 0,getPosition:Eo,settings:{stroke:r,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:R2(i,t),hide:o,type:c,color:s,unit:l,graphicalItemId:d}};return h.createElement(yG,{tooltipEntrySettings:u})});function uQ(e){var t=De(mo),{data:r,dataKey:n,background:s,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=ku(i,tQ),u=QM(o,n,i.id),f=ZM(l),m=JM(c,n,i.id);if(!s||r==null)return null;var p=Ix(s);return h.createElement(as,{zIndex:tV(s,Cr.barBackground)},r.map((x,g)=>{var{value:v,background:y,tooltipPosition:w}=x,N=ku(x,rQ);if(!y)return null;var j=u(x,g),k=f(x,g),b=m(x,g),S=Nr(Nr(Nr(Nr(Nr({option:s,isActive:String(g)===t},N),{},{fill:"#eee"},y),p),Fx(d,x,g)),{},{onMouseEnter:j,onMouseLeave:k,onClick:b,dataKey:n,index:g,className:"recharts-bar-background-rectangle"});return h.createElement(Nu,Wa({key:"background-bar-".concat(g)},S))}))}function fQ(e){var{showLabels:t,children:r,rects:n}=e,s=n==null?void 0:n.map(i=>{var o={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return Nr(Nr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return h.createElement(HY,{value:t?s:void 0},r)}function mQ(e){var{shape:t,activeBar:r,baseProps:n,entry:s,index:i,dataKey:o}=e,l=De(mo),c=De(bM),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?h.createElement(as,{zIndex:Cr.activeBar},h.createElement(mP,{index:i},h.createElement(Nu,Wa({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o})))):h.createElement(Nu,Wa({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o}))}function hQ(e){var{shape:t,baseProps:r,entry:n,index:s,dataKey:i}=e;return h.createElement(Nu,Wa({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:s,dataKey:i}))}function pQ(e){var t,{data:r,props:n}=e,s=(t=Ta(n))!==null&&t!==void 0?t:{},{id:i}=s,o=ku(s,nQ),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,p=ku(n,aQ),x=QM(u,c,i),g=ZM(m),v=JM(f,c,i);return r?h.createElement(h.Fragment,null,r.map((y,w)=>h.createElement(mP,Wa({index:w,key:"rectangle-".concat(y==null?void 0:y.x,"-").concat(y==null?void 0:y.y,"-").concat(y==null?void 0:y.value,"-").concat(w),className:"recharts-bar-rectangle"},Fx(p,y,w),{onMouseEnter:x(y,w),onMouseLeave:g(y,w),onClick:v(y,w)}),d?h.createElement(mQ,{shape:l,activeBar:d,baseProps:o,entry:y,index:w,dataKey:c}):h.createElement(hQ,{shape:l,baseProps:o,entry:y,index:w,dataKey:c})))):null}function xQ(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:s,isAnimationActive:i,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,m=dg(t,"recharts-bar-"),[p,x]=h.useState(!1),g=!p,v=h.useCallback(()=>{typeof d=="function"&&d(),x(!1)},[d]),y=h.useCallback(()=>{typeof u=="function"&&u(),x(!0)},[u]);return h.createElement(fQ,{showLabels:g,rects:n},h.createElement(cg,{animationId:m,begin:o,duration:l,isActive:i,easing:c,onAnimationEnd:v,onAnimationStart:y,key:m},w=>{var N=w===1?n:n==null?void 0:n.map((j,k)=>{var b=f&&f[k];if(b)return Nr(Nr({},j),{},{x:dr(b.x,j.x,w),y:dr(b.y,j.y,w),width:dr(b.width,j.width,w),height:dr(b.height,j.height,w)});if(s==="horizontal"){var S=dr(0,j.height,w),_=dr(j.stackedBarStart,j.y,w);return Nr(Nr({},j),{},{y:_,height:S})}var C=dr(0,j.width,w),P=dr(j.stackedBarStart,j.x,w);return Nr(Nr({},j),{},{width:C,x:P})});return w>0&&(r.current=N??null),N==null?null:h.createElement(Ia,null,h.createElement(pQ,{props:t,data:N}))}),h.createElement(GY,{label:t.label}),t.children)}function gQ(e){var t=h.useRef(null);return h.createElement(xQ,{previousRectanglesRef:t,props:e})}var hP=0,vQ=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:mr(e,t)}};class yQ extends h.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:s,xAxisId:i,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=ot("recharts-bar",s),f=d;return h.createElement(Ia,{className:u,id:d},l&&h.createElement("defs",null,h.createElement(aX,{clipPathId:f,xAxisId:i,yAxisId:o})),h.createElement(Ia,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},h.createElement(uQ,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),h.createElement(gQ,this.props)))}}var bQ={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:hP,xAxisId:0,yAxisId:0,zIndex:Cr.bar};function wQ(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=dP(t,r),m=Ao(),p=Qr(),x=tG(e.children,EM),g=De(w=>GX(w,e.id,p,x));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=g==null?void 0:g[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,h.createElement(nX,{xAxisId:t,yAxisId:r,data:g,dataPointFormatter:vQ,errorBarOffset:v},h.createElement(yQ,Wa({},e,{layout:m,needClip:f,data:g,xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function jQ(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:s,bandSize:i,xAxis:o,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:m,cells:p,parentViewBox:x,dataStartIndex:g}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,w=k8({numericAxis:v}),N=v.scale.map(w);return f.map((j,k)=>{var b,S,_,C,P,D;if(u){var E=u[k+g];if(E==null)return null;b=v8(E,y)}else b=mr(j,r),Array.isArray(b)||(b=[w,b]);var I=EX(n,hP)(b[1],k);if(t==="horizontal"){var F,Q=l.scale.map(b[0]),Y=l.scale.map(b[1]);if(Q==null||Y==null)return null;S=f0({axis:o,ticks:c,bandSize:i,offset:s.offset,entry:j,index:k}),_=(F=Y??Q)!==null&&F!==void 0?F:void 0,C=s.size;var X=Q-Y;if(P=sa(X)?0:X,D={x:S,y:m.top,width:C,height:m.height},Math.abs(I)>0&&Math.abs(P)<Math.abs(I)){var re=Wr(P||I)*(Math.abs(I)-Math.abs(P));_-=re,P+=re}}else{var ee=o.scale.map(b[0]),T=o.scale.map(b[1]);if(ee==null||T==null)return null;if(S=ee,_=f0({axis:l,ticks:d,bandSize:i,offset:s.offset,entry:j,index:k}),C=T-ee,P=s.size,D={x:m.left,y:_,width:m.width,height:P},Math.abs(I)>0&&Math.abs(C)<Math.abs(I)){var M=Wr(C||I)*(Math.abs(I)-Math.abs(C));C+=M}}if(S==null||_==null||C==null||P==null)return null;var $=Nr(Nr({},j),{},{stackedBarStart:N,x:S,y:_,width:C,height:P,value:u?b:b[1],payload:j,background:D,tooltipPosition:{x:S+C/2,y:_+P/2},parentViewBox:x},p&&p[k]&&p[k].props);return $}).filter(Boolean)}function NQ(e){var t=ln(e,bQ),r=ZX(t.stackId),n=Qr();return h.createElement(SG,{id:t.id,type:"bar"},s=>h.createElement(h.Fragment,null,h.createElement(bG,{legendPayload:cQ(t)}),h.createElement(dQ,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:s}),h.createElement(AG,{type:"bar",id:s,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n}),h.createElement(as,{zIndex:t.zIndex},h.createElement(wQ,Wa({},t,{id:s})))))}var pP=h.memo(NQ,pv);pP.displayName="Bar";var kQ=["domain","range"],SQ=["domain","range"];function nj(e,t){if(e==null)return{};var r,n,s=CQ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function CQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function aj(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function xP(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=nj(e,kQ),{domain:i,range:o}=t,l=nj(t,SQ);return!aj(r,i)||!aj(n,o)?!1:pv(s,l)}var _Q=["type"],MQ=["dangerouslySetInnerHTML","ticks","scale"],PQ=["id","scale"];function Cp(){return Cp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cp.apply(null,arguments)}function sj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function ij(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sj(Object(r),!0).forEach(function(n){OQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OQ(e,t,r){return(t=EQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EQ(e){var t=AQ(e,"string");return typeof t=="symbol"?t:t+""}function AQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _p(e,t){if(e==null)return{};var r,n,s=DQ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function DQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function TQ(e){var t=Et(),r=h.useRef(null),n=Y2(),{type:s}=e,i=_p(e,_Q),o=qf(n,"xAxis",s),l=h.useMemo(()=>{if(o!=null)return ij(ij({},i),{},{type:o})},[i,o]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t($G(l)):r.current!==l&&t(zG({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(LG(r.current)),r.current=null)},[t]),null}var IQ=e=>{var{xAxisId:t,className:r}=e,n=De(ag),s=Qr(),i="xAxis",o=De(y=>J_(y,i,t,s)),l=De(y=>V_(y,t)),c=De(y=>Nq(y,t)),d=De(y=>v_(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,p=_p(e,MQ),{id:x,scale:g}=d,v=_p(d,PQ);return h.createElement(hv,Cp({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:ot("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},RQ={allowDataOverflow:Yt.allowDataOverflow,allowDecimals:Yt.allowDecimals,allowDuplicatedCategory:Yt.allowDuplicatedCategory,angle:Yt.angle,axisLine:Oa.axisLine,height:Yt.height,hide:!1,includeHidden:Yt.includeHidden,interval:Yt.interval,label:!1,minTickGap:Yt.minTickGap,mirror:Yt.mirror,orientation:Yt.orientation,padding:Yt.padding,reversed:Yt.reversed,scale:Yt.scale,tick:Yt.tick,tickCount:Yt.tickCount,tickLine:Oa.tickLine,tickSize:Oa.tickSize,type:Yt.type,xAxisId:0},$Q=e=>{var t=ln(e,RQ);return h.createElement(h.Fragment,null,h.createElement(TQ,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),h.createElement(IQ,t))},gP=h.memo($Q,xP);gP.displayName="XAxis";var zQ=["type"],LQ=["dangerouslySetInnerHTML","ticks","scale"],FQ=["id","scale"];function Mp(){return Mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mp.apply(null,arguments)}function oj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function lj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oj(Object(r),!0).forEach(function(n){BQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BQ(e,t,r){return(t=WQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WQ(e){var t=UQ(e,"string");return typeof t=="symbol"?t:t+""}function UQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pp(e,t){if(e==null)return{};var r,n,s=qQ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function qQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function HQ(e){var t=Et(),r=h.useRef(null),n=Y2(),{type:s}=e,i=Pp(e,zQ),o=qf(n,"yAxis",s),l=h.useMemo(()=>{if(o!=null)return lj(lj({},i),{},{type:o})},[o,i]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(FG(l)):r.current!==l&&t(BG({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(WG(r.current)),r.current=null)},[t]),null}function KQ(e){var{yAxisId:t,className:r,width:n,label:s}=e,i=h.useRef(null),o=h.useRef(null),l=De(ag),c=Qr(),d=Et(),u="yAxis",f=De(b=>X_(b,t)),m=De(b=>Sq(b,t)),p=De(b=>J_(b,u,t,c)),x=De(b=>y_(b,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||dv(s)||h.isValidElement(s)||x==null)){var b=i.current;if(b){var S=b.getCalculatedWidth();Math.round(f.width)!==Math.round(S)&&d(UG({id:t,width:S}))}}},[p,f,d,s,t,n,x]),f==null||m==null||x==null)return null;var{dangerouslySetInnerHTML:g,ticks:v,scale:y}=e,w=Pp(e,LQ),{id:N,scale:j}=x,k=Pp(x,FQ);return h.createElement(hv,Mp({},w,k,{ref:i,labelRef:o,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ot("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:p,axisType:u}))}var YQ={allowDataOverflow:Gt.allowDataOverflow,allowDecimals:Gt.allowDecimals,allowDuplicatedCategory:Gt.allowDuplicatedCategory,angle:Gt.angle,axisLine:Oa.axisLine,hide:!1,includeHidden:Gt.includeHidden,interval:Gt.interval,label:!1,minTickGap:Gt.minTickGap,mirror:Gt.mirror,orientation:Gt.orientation,padding:Gt.padding,reversed:Gt.reversed,scale:Gt.scale,tick:Gt.tick,tickCount:Gt.tickCount,tickLine:Oa.tickLine,tickSize:Oa.tickSize,type:Gt.type,width:Gt.width,yAxisId:0},GQ=e=>{var t=ln(e,YQ);return h.createElement(h.Fragment,null,h.createElement(HQ,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),h.createElement(KQ,t))},vP=h.memo(GQ,xP);vP.displayName="YAxis";var VQ=(e,t)=>t,xv=te([VQ,lt,x_,tr,xM,ns,LH,Zt],KH),gv=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},yP=gn("mouseClick"),bP=hc();bP.startListening({actionCreator:yP,effect:(e,t)=>{var r=e.payload,n=xv(t.getState(),gv(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(Lq({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Op=gn("mouseMove"),wP=hc(),od=null;wP.startListening({actionCreator:Op,effect:(e,t)=>{var r=e.payload;od!==null&&cancelAnimationFrame(od);var n=gv(r);od=requestAnimationFrame(()=>{var s=t.getState(),i=Jg(s,s.tooltip.settings.shared);if(i==="axis"){var o=xv(s,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(oM({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(iM())}od=null})}});function XQ(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var cj={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},jP=Xr({name:"rootProps",initialState:cj,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:cj.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),QQ=jP.reducer,{updateOptions:ZQ}=jP.actions,JQ=null,eZ={updatePolarOptions:(e,t)=>t.payload},NP=Xr({name:"polarOptions",initialState:JQ,reducers:eZ}),{updatePolarOptions:sre}=NP.actions,tZ=NP.reducer,kP=gn("keyDown"),SP=gn("focus"),vv=hc();vv.startListening({actionCreator:kP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var o=ev(s,Bo(r),kc(r),Cc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=ns(r);if(i==="Enter"){var d=vu(r,"axis","hover",String(s.index));t.dispatch(bp({active:!s.active,activeIndex:s.index,activeCoordinate:d}));return}var u=Pq(r),f=u==="left-to-right"?1:-1,m=i==="ArrowRight"?1:-1,p=l+m*f;if(!(c==null||p>=c.length||p<0)){var x=vu(r,"axis","hover",String(p));t.dispatch(bp({active:!0,activeIndex:p.toString(),activeCoordinate:x}))}}}}}});vv.startListening({actionCreator:SP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",o=vu(r,"axis","hover",String(i));t.dispatch(bp({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var un=gn("externalEvent"),CP=hc(),lh=new Map;CP.startListening({actionCreator:un,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var s=n.type,i=lh.get(s);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:kH(l),activeDataKey:bM(l),activeIndex:mo(l),activeLabel:yM(l),activeTooltipIndex:mo(l),isTooltipActive:SH(l)};r(c,n)}finally{lh.delete(s)}});lh.set(s,o)}}});var rZ=te([Lo],e=>e.tooltipItemPayloads),nZ=te([rZ,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(i=>i.settings.graphicalItemId===r);if(n!=null){var{getPosition:s}=n;if(s!=null)return s(t)}}}),_P=gn("touchMove"),MP=hc();MP.startListening({actionCreator:_P,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),s=Jg(n,n.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var o=xv(n,gv({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(oM({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(s==="item"){var l,c=r.touches[0];if(document.elementFromPoint==null||c==null)return;var d=document.elementFromPoint(c.clientX,c.clientY);if(!d||!d.getAttribute)return;var u=d.getAttribute(E8),f=(l=d.getAttribute(A8))!==null&&l!==void 0?l:void 0,m=Fo(n).find(g=>g.id===f);if(u==null||m==null||f==null)return;var{dataKey:p}=m,x=nZ(n,u,f);t.dispatch(sM({activeDataKey:p,activeIndex:u,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var aZ=s2({brush:nV,cartesianAxis:qG,chartData:NK,errorBars:QV,graphicalItems:OG,layout:m8,legend:bB,options:vK,polarAxis:XY,polarOptions:tZ,referenceElements:oV,rootProps:QQ,tooltip:Fq,zIndex:iK}),sZ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return zF({reducer:aZ,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([bP.middleware,wP.middleware,vv.middleware,CP.middleware,MP.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(b2({type:"raf"}))},devTools:{serialize:{replacer:XQ},name:"recharts-".concat(r)}})};function iZ(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=Qr(),i=h.useRef(null);if(s)return r;i.current==null&&(i.current=sZ(t,n));var o=Vx;return h.createElement(CX,{context:o,store:i.current},r)}function oZ(e){var{layout:t,margin:r}=e,n=Et(),s=Qr();return h.useEffect(()=>{s||(n(d8(t)),n(c8(r)))},[n,s,t,r]),null}var lZ=h.memo(oZ,pv);function cZ(e){var t=Et();return h.useEffect(()=>{t(ZQ(e))},[t,e]),null}function dj(e){var{zIndex:t,isPanorama:r}=e,n=h.useRef(null),s=Et();return h.useLayoutEffect(()=>(n.current&&s(aK({zIndex:t,element:n.current,isPanorama:r})),()=>{s(sK({zIndex:t,isPanorama:r}))}),[s,t,r]),h.createElement("g",{tabIndex:-1,ref:n})}function uj(e){var{children:t,isPanorama:r}=e,n=De(GH);if(!n||n.length===0)return t;var s=n.filter(o=>o<0),i=n.filter(o=>o>0);return h.createElement(h.Fragment,null,s.map(o=>h.createElement(dj,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>h.createElement(dj,{key:o,zIndex:o,isPanorama:r})))}var dZ=["children"];function uZ(e,t){if(e==null)return{};var r,n,s=fZ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fZ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Su.apply(null,arguments)}var mZ={width:"100%",height:"100%",display:"block"},hZ=h.forwardRef((e,t)=>{var r=H2(),n=K2(),s=rC();if(!oa(r)||!oa(n))return null;var{children:i,otherAttributes:o,title:l,desc:c}=e,d,u;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=s?0:void 0,typeof o.role=="string"?u=o.role:u=s?"application":void 0),h.createElement(dS,Su({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:mZ,ref:t}),i)}),pZ=e=>{var{children:t}=e,r=De(Of);if(!r)return null;var{width:n,height:s,y:i,x:o}=r;return h.createElement(dS,{width:n,height:s,x:o,y:i},t)},fj=h.forwardRef((e,t)=>{var{children:r}=e,n=uZ(e,dZ),s=Qr();return s?h.createElement(pZ,null,h.createElement(uj,{isPanorama:!0},r)):h.createElement(hZ,Su({ref:t},n),h.createElement(uj,{isPanorama:!1},r))});function xZ(){var e=Et(),[t,r]=h.useState(null),n=De(O8);return h.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Ge(i)&&i!==n&&e(f8(i))}},[t,e,n]),r}function mj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function gZ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mj(Object(r),!0).forEach(function(n){vZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vZ(e,t,r){return(t=yZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yZ(e){var t=bZ(e,"string");return typeof t=="symbol"?t:t+""}function bZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ws.apply(null,arguments)}var wZ=()=>(AK(),null);function Cu(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var jZ=h.forwardRef((e,t)=>{var r,n,s=h.useRef(null),[i,o]=h.useState({containerWidth:Cu((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Cu((n=e.style)===null||n===void 0?void 0:n.height)}),l=h.useCallback((d,u)=>{o(f=>{var m=Math.round(d),p=Math.round(u);return f.containerWidth===m&&f.containerHeight===p?f:{containerWidth:m,containerHeight:p}})},[]),c=h.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var m=x=>{var g=x[0];if(g!=null){var{width:v,height:y}=g.contentRect;l(v,y)}},p=new ResizeObserver(m);p.observe(d),s.current=p}},[t,l]);return h.useEffect(()=>()=>{var d=s.current;d!=null&&d.disconnect()},[l]),h.createElement(h.Fragment,null,h.createElement(xc,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",ws({ref:c},e)))}),NZ=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,i]=h.useState({containerWidth:Cu(r),containerHeight:Cu(n)}),o=h.useCallback((c,d)=>{i(u=>{var f=Math.round(c),m=Math.round(d);return u.containerWidth===f&&u.containerHeight===m?u:{containerWidth:f,containerHeight:m}})},[]),l=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return h.createElement(h.Fragment,null,h.createElement(xc,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",ws({ref:l},e)))}),kZ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement("div",ws({ref:t},e)))}),SZ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?h.createElement(NZ,ws({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(kZ,ws({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement("div",ws({ref:t},e)))});function CZ(e){return e?jZ:SZ}var _Z=h.forwardRef((e,t)=>{var{children:r,className:n,height:s,onClick:i,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:m,onTouchEnd:p,onTouchMove:x,onTouchStart:g,style:v,width:y,responsive:w,dispatchTouchEvents:N=!0}=e,j=h.useRef(null),k=Et(),[b,S]=h.useState(null),[_,C]=h.useState(null),P=xZ(),D=sg(),E=(D==null?void 0:D.width)>0?D.width:y,I=(D==null?void 0:D.height)>0?D.height:s,F=h.useCallback(B=>{P(B),typeof t=="function"&&t(B),S(B),C(B),B!=null&&(j.current=B)},[P,t,S,C]),Q=h.useCallback(B=>{k(yP(B)),k(un({handler:i,reactEvent:B}))},[k,i]),Y=h.useCallback(B=>{k(Op(B)),k(un({handler:d,reactEvent:B}))},[k,d]),X=h.useCallback(B=>{k(iM()),k(un({handler:u,reactEvent:B}))},[k,u]),re=h.useCallback(B=>{k(Op(B)),k(un({handler:f,reactEvent:B}))},[k,f]),ee=h.useCallback(()=>{k(SP())},[k]),T=h.useCallback(B=>{k(kP(B.key))},[k]),M=h.useCallback(B=>{k(un({handler:o,reactEvent:B}))},[k,o]),$=h.useCallback(B=>{k(un({handler:l,reactEvent:B}))},[k,l]),K=h.useCallback(B=>{k(un({handler:c,reactEvent:B}))},[k,c]),z=h.useCallback(B=>{k(un({handler:m,reactEvent:B}))},[k,m]),G=h.useCallback(B=>{k(un({handler:g,reactEvent:B}))},[k,g]),A=h.useCallback(B=>{N&&k(_P(B)),k(un({handler:x,reactEvent:B}))},[k,N,x]),O=h.useCallback(B=>{k(un({handler:p,reactEvent:B}))},[k,p]),J=CZ(w);return h.createElement(_M.Provider,{value:b},h.createElement(Vz.Provider,{value:_},h.createElement(J,{width:E??(v==null?void 0:v.width),height:I??(v==null?void 0:v.height),className:ot("recharts-wrapper",n),style:gZ({position:"relative",cursor:"default",width:E,height:I},v),onClick:Q,onContextMenu:M,onDoubleClick:$,onFocus:ee,onKeyDown:T,onMouseDown:K,onMouseEnter:Y,onMouseLeave:X,onMouseMove:re,onMouseUp:z,onTouchEnd:O,onTouchMove:A,onTouchStart:G,ref:F},h.createElement(wZ,null),r)))}),MZ=["width","height","responsive","children","className","style","compact","title","desc"];function PZ(e,t){if(e==null)return{};var r,n,s=OZ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function OZ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var EZ=h.forwardRef((e,t)=>{var{width:r,height:n,responsive:s,children:i,className:o,style:l,compact:c,title:d,desc:u}=e,f=PZ(e,MZ),m=Ta(f);return c?h.createElement(h.Fragment,null,h.createElement(xc,{width:r,height:n}),h.createElement(fj,{otherAttributes:m,title:d,desc:u},i)):h.createElement(_Z,{className:o,style:l,width:r,height:n,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},h.createElement(fj,{otherAttributes:m,title:d,desc:u,ref:t},h.createElement(cV,null,i)))});function Ep(){return Ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ep.apply(null,arguments)}var AZ={top:5,right:5,bottom:5,left:5},DZ={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:AZ,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},TZ=h.forwardRef(function(t,r){var n,s=ln(t.categoricalChartProps,DZ),{chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:i,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(iZ,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},h.createElement(rV,{chartData:d.data}),h.createElement(lZ,{layout:s.layout,margin:s.margin}),h.createElement(cZ,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),h.createElement(EZ,Ep({},s,{ref:r})))}),IZ=["axis","item"],RZ=h.forwardRef((e,t)=>h.createElement(TZ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:IZ,tooltipPayloadSearcher:xK,categoricalChartProps:e,ref:t}));function ai(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function $Z({active:e,payload:t,label:r}){var n;return!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-popover border border-border rounded-lg px-3 py-2 text-xs shadow-lg",children:[a.jsx("p",{className:"font-medium mb-0.5",children:r}),a.jsx("p",{className:"text-muted-foreground",children:ai(((n=t[0])==null?void 0:n.value)??0)})]})}function _u({data:e,icon:t,title:r,barColor:n="#6366f1",yAxisWidth:s=100,rightMargin:i=40,minRowHeight:o=80}){return e.length===0?null:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[t,a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:r})]}),a.jsx(rB,{width:"100%",height:Math.max(o,e.length*36),children:a.jsxs(RZ,{data:e,layout:"vertical",margin:{left:0,right:i,top:0,bottom:0},children:[a.jsx(lP,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(gP,{type:"number",tickFormatter:l=>ai(l),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(vP,{type:"category",dataKey:"name",width:s,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(FK,{content:a.jsx($Z,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(pP,{dataKey:"minutes",fill:n,radius:[0,4,4,0]})]})})]})}const Li=200;function zZ({workspaceId:e}){const[t,r]=h.useState(void 0),[n,s]=h.useState(void 0),[i,o]=h.useState([]),[l,c]=h.useState([]),[d,u]=h.useState([]),[f,m]=h.useState(0),{workspace:p}=Ie(),x=(p==null?void 0:p.slug)??"",{data:g=[],isLoading:v}=jo(e?void 0:d.length>0?{workspaceIds:d}:{allWorkspaces:!0}),{data:y=[],isLoading:w}=Lz(e?[e]:d,l),{data:N=[],isLoading:j}=bo(),{data:k}=_s();h.useEffect(()=>{const A=new Set(g.map(O=>O.id));c(O=>{const J=O.filter(B=>A.has(B));return J.length===O.length?O:J})},[g]),h.useEffect(()=>{const A=new Set(y.map(O=>O.id));o(O=>{const J=O.filter(B=>A.has(B));return J.length===O.length?O:J})},[y]),h.useEffect(()=>{m(0)},[t,n,i,l,d]);const b=t?fe(t,"yyyy-MM-dd"):void 0,S=n?fe(n,"yyyy-MM-dd"):void 0,_=h.useMemo(()=>new Map(g.map(A=>[A.id,A])),[g]),C=e?[e]:d.length>0?d:void 0,{data:P,isLoading:D}=oS({from:b,to:S,workspace_id:e,workspace_ids:C,user_ids:i.length>0?i:void 0,project_ids:l.length>0?l:void 0,limit:Li,offset:f},{enabled:!0}),E=h.useMemo(()=>{const A=(P==null?void 0:P.time_logs)??[];return v?A:A.filter(O=>!O.project_id||_.has(O.project_id))},[P==null?void 0:P.time_logs,_,v]),I=(P==null?void 0:P.total_minutes)??0,F=(P==null?void 0:P.total_employees)??0,Q=(P==null?void 0:P.total_projects)??0,Y=(P==null?void 0:P.count)??0,X=h.useMemo(()=>{const A=new Map;for(const O of E)A.set(O.user_id,(A.get(O.user_id)??0)+(O.duration_minutes??0));return Array.from(A.entries()).map(([O,J])=>{var B;return{name:((B=k==null?void 0:k.get(O))==null?void 0:B.name)??"Unknown",minutes:J}}).sort((O,J)=>J.minutes-O.minutes).slice(0,8)},[E,k]),re=h.useMemo(()=>{const A=new Map;for(const O of E){const J=O.project_id??"__none__";A.set(J,(A.get(J)??0)+(O.duration_minutes??0))}return Array.from(A.entries()).map(([O,J])=>{var B;return{name:O==="__none__"?"No project":((B=_.get(O))==null?void 0:B.name)??"Unknown",minutes:J}}).sort((O,J)=>J.minutes-O.minutes).slice(0,8)},[E,_]),ee=h.useMemo(()=>y.map(A=>({value:A.id,label:[A.first_name,A.last_name].filter(Boolean).join(" ")||A.email})),[y]),T=h.useMemo(()=>N.map(A=>({value:A.id,label:A.name})),[N]),M=h.useMemo(()=>g.map(A=>({value:A.id,label:A.name})),[g]),$=f+Li<Y,K=f>0,z=Math.floor(f/Li)+1,G=Math.max(1,Math.ceil(Y/Li));return a.jsxs("div",{className:"p-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-6 py-4 flex items-center gap-3",children:[a.jsx("div",{className:"h-9 w-9 rounded-lg bg-muted flex items-center justify-center shrink-0",children:a.jsx(js,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold",children:"Time Logs"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Filter by date range, employees, and projects to analyze time across the organization."})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(ii,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(Ad,{value:t,onChange:r,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),a.jsx(Ad,{value:n,onChange:s,placeholder:"To"})]}),!e&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(M1,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Workspaces"})]}),j?a.jsx(le,{className:"h-8 w-40"}):a.jsx(Ma,{options:T,selected:d,onSelectionChange:u,placeholder:"All workspaces",className:"w-44"})]})]}),a.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Na,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employees"})]}),w?a.jsx(le,{className:"h-8 w-40"}):a.jsx(Ma,{options:ee,selected:i,onSelectionChange:o,placeholder:"All employees",className:"w-44"})]}),a.jsx("div",{className:"hidden md:block w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Kr,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Projects"})]}),v?a.jsx(le,{className:"h-8 w-40"}):a.jsx(Ma,{options:M,selected:l,onSelectionChange:c,placeholder:"All projects",className:"w-44"})]})]}),D?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden divide-y divide-border",children:[1,2,3,4].map(A=>a.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-4 w-32"}),a.jsx(le,{className:"h-4 w-48"})]},A))}):E.length===0&&f===0?a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(Rn,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logs found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:b||S||i.length>0||l.length>0||d.length>0?"Try adjusting your filters.":"No time has been logged yet."})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Total time"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:ai(I)})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Employees"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:F})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Projects"}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:Q})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(_u,{data:X,icon:a.jsx(Na,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by employee"}),a.jsx(_u,{data:re,icon:a.jsx(Kr,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by project"})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Employee"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Project"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("th",{className:"text-left px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Description"}),a.jsx("th",{className:"text-right px-6 py-2.5 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Duration"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:E.map(A=>{var B;const O=A.project_id?_.get(A.project_id):void 0,J=((B=k==null?void 0:k.get(A.user_id))==null?void 0:B.name)??A.user_id.slice(0,8)+"…";return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-xs font-medium",children:J}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(O==null?void 0:O.name)??(A.project_id?"Unknown":"—")}),a.jsx("td",{className:"px-6 py-3",children:A.issue_identifier?a.jsx(Mr,{to:`/${x}/projects/${O==null?void 0:O.identifier}/issues/${A.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:A.issue_identifier}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[A.issue_id.slice(0,8),"…"]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:A.logged_date?fe(new Date(A.logged_date),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:A.description??a.jsx("span",{className:"italic",children:"—"})}),a.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:A.duration_minutes!=null?ai(A.duration_minutes):"Running…"})]},A.id)})})]}),G>1&&a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border bg-muted/10",children:[a.jsxs("p",{className:"text-xs text-muted-foreground",children:[Y," total log",Y!==1?"s":""]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{type:"button",disabled:!K,onClick:()=>m(Math.max(0,f-Li)),className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md border border-border hover:bg-accent disabled:opacity-40 disabled:pointer-events-none transition-colors",children:[a.jsx(na,{className:"h-3.5 w-3.5"}),"Prev"]}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:["Page ",z," of ",G]}),a.jsxs("button",{type:"button",disabled:!$,onClick:()=>m(f+Li),className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1.5 rounded-md border border-border hover:bg-accent disabled:opacity-40 disabled:pointer-events-none transition-colors",children:["Next",a.jsx(hr,{className:"h-3.5 w-3.5"})]})]})]})]})]})]})}function LZ(){const{projectKey:e,workspace:t}=zt(),[r,n]=h.useState(void 0),[s,i]=h.useState(void 0),[o,l]=h.useState([]),{data:c}=Ha(e??""),{data:d}=_s(),{data:u=[]}=qN(),f=r?fe(r,"yyyy-MM-dd"):void 0,m=s?fe(s,"yyyy-MM-dd"):void 0,{data:p,isLoading:x}=oS({project_id:c==null?void 0:c.id,from:f,to:m}),g=(p==null?void 0:p.time_logs)??[],v=h.useMemo(()=>o.length>0?g.filter(_=>o.includes(_.user_id)):g,[g,o]),y=h.useMemo(()=>v.reduce((_,C)=>_+(C.duration_minutes??0),0),[v]),w=h.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.user_id)||_.set(C.user_id,{logs:[],totalMinutes:0});const P=_.get(C.user_id);P.logs.push(C),P.totalMinutes+=C.duration_minutes??0}return _},[v]),N=h.useMemo(()=>{const _=new Map;for(const C of v){_.has(C.issue_id)||_.set(C.issue_id,{logs:[],totalMinutes:0});const P=_.get(C.issue_id);P.logs.push(C),P.totalMinutes+=C.duration_minutes??0}return _},[v]),j=Array.from(w.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C}])=>{var P;return{name:((P=d==null?void 0:d.get(_))==null?void 0:P.name)??"Unknown",minutes:C}}),k=Array.from(N.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).slice(0,8).map(([_,{totalMinutes:C,logs:P}])=>{var D;return{name:((D=P[0])==null?void 0:D.issue_identifier)??_.slice(0,8),minutes:C}}),b=h.useMemo(()=>u.map(_=>({value:_.id,label:[_.first_name,_.last_name].filter(Boolean).join(" ")||_.email})),[u]),S=v.length>0;return a.jsxs("div",{className:"p-2 pb-24 md:pb-2 space-y-2",children:[a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-4 py-3 flex flex-col gap-3 md:flex-row md:items-center md:flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(ii,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(Ad,{value:r,onChange:n,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"→"}),a.jsx(Ad,{value:s,onChange:i,placeholder:"To"})]}),a.jsx("div",{className:"hidden md:block w-px h-4 bg-border"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Na,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employee"})]}),a.jsx(Ma,{options:b,selected:o,onSelectionChange:l,placeholder:"All employees",className:"w-44"})]})]}),a.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"Total logged",value:y>0?ai(y):"—",icon:Rn},{label:"Contributors",value:w.size>0?String(w.size):"—",icon:Na},{label:"Issues tracked",value:N.size>0?String(N.size):"—",icon:ta}].map(({label:_,value:C,icon:P})=>a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-3 md:px-5 py-3 md:py-4 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(P,{className:"h-3.5 w-3.5 text-muted-foreground hidden md:block shrink-0"}),a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium break-all",children:_})]}),a.jsx("p",{className:"text-xl md:text-2xl font-bold tabular-nums",children:C})]},_))}),x?a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(_=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-7 w-7 rounded-full"}),a.jsx(le,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(le,{className:"h-4 w-20"})]},_))})}):c!=null&&c.id?S?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[a.jsx(_u,{data:j,icon:a.jsx(Na,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by user",yAxisWidth:88,rightMargin:32,minRowHeight:100}),a.jsx(_u,{data:k,icon:a.jsx(ta,{className:"h-3.5 w-3.5 text-muted-foreground"}),title:"Time by issue",barColor:"#818cf8",yAxisWidth:64,rightMargin:32,minRowHeight:100})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(Na,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by user"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issues"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(w.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:P}])=>{const D=d==null?void 0:d.get(_),E=new Set(C.map(I=>I.issue_id)).size;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3 text-sm font-medium",children:(D==null?void 0:D.name)??_.slice(0,8)+"…"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:E}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ai(P)})]},_)})})]})]}),a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-3 border-b border-border",children:[a.jsx(ta,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Time by issue"})]}),a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/20",children:[a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Issue"}),a.jsx("th",{className:"text-left px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Last logged"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Contributors"}),a.jsx("th",{className:"text-right px-6 py-2 text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Total"})]})}),a.jsx("tbody",{className:"divide-y divide-border",children:Array.from(N.entries()).sort((_,C)=>C[1].totalMinutes-_[1].totalMinutes).map(([_,{logs:C,totalMinutes:P}])=>{var Q,Y;const D=new Set(C.map(X=>X.user_id)).size,E=C.reduce((X,re)=>re.logged_date&&(!X||new Date(re.logged_date)>new Date(X))?re.logged_date:X,null),I=(Q=C[0])==null?void 0:Q.issue_identifier,F=(Y=C[0])==null?void 0:Y.issue_title;return a.jsxs("tr",{className:"hover:bg-muted/30 transition-colors",children:[a.jsx("td",{className:"px-6 py-3",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I?a.jsx(Mr,{to:`/${t}/projects/${e}/issues/${_}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:I}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[_.slice(0,8),"…"]}),F&&a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:F})]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:E?fe(new Date(E),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:D}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:ai(P)})]},_)})})]})]})]}):a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex flex-col items-center justify-center py-16 text-center",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center mb-3",children:a.jsx(js,{className:"h-5 w-5 text-muted-foreground"})}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"No time logged"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:f||m||o.length>0?"No entries match the current filters.":"Start logging time on issues to see reports here."})]}):a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl flex items-center justify-center py-12",children:a.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading project…"})})]})}const FZ={share_enabled:{icon:yh,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:b5,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:yo,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40",label:(e,t)=>{var i,o,l;const r=(i=e==null?void 0:e.user_id)==null?void 0:i.to,n=(o=e==null?void 0:e.role)==null?void 0:o.to,s=r?((l=t.get(r))==null?void 0:l.name)??r:"a user";return n?`Added ${s} as ${n}`:`Added ${s}`}},member_removed:{icon:W1,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:(e,t)=>{var s,i;const r=(s=e==null?void 0:e.user_id)==null?void 0:s.from;return`Removed ${r?((i=t.get(r))==null?void 0:i.name)??r:"a user"}`}},team_added:{icon:Na,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.to;return`Added team ${n?r.get(n)??n:"a team"}`}},team_removed:{icon:U1,color:"text-orange-500",bg:"bg-orange-50 dark:bg-orange-950/40",label:(e,t,r)=>{var i;const n=(i=e==null?void 0:e.team_id)==null?void 0:i.from;return`Removed team ${n?r.get(n)??n:"a team"}`}},status_updated:{icon:E5,color:"text-violet-500",bg:"bg-violet-50 dark:bg-violet-950/40",label:e=>{var n,s;const t=(n=e==null?void 0:e.name)==null?void 0:n.from,r=(s=e==null?void 0:e.name)==null?void 0:s.to;return t&&r?`Renamed status "${t}" to "${r}"`:"Updated status"}},status_deleted:{icon:Or,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:e=>{var r;const t=(r=e==null?void 0:e.name)==null?void 0:r.from;return t?`Deleted status "${t}"`:"Deleted status"}},updated:{icon:Ns,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:ut,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"}},BZ={icon:Iu,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function WZ({activity:e,userMap:t,teamMap:r}){const n=FZ[e.action]??BZ,s=n.icon,i=t.get(e.actor_id),o=(i==null?void 0:i.name)??"System",l=(i==null?void 0:i.initials)??"S",c=n.label(e.changes,t,r),d=(()=>{var u,f;if(e.action==="share_enabled"){const m=(f=(u=e.changes)==null?void 0:u.share_url)==null?void 0:f.to;return m?a.jsx("span",{className:"text-xs text-muted-foreground/60 font-mono break-all",children:m}):null}return null})();return a.jsxs("div",{className:"flex items-start md:items-center gap-3 md:gap-4 px-4 md:px-6 py-4 hover:bg-muted/30 transition-colors",children:[a.jsx("div",{className:L("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:a.jsx(s,{className:L("h-4 w-4",n.color)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-x-2 gap-y-0.5",children:[a.jsx(Rt,{className:"h-5 w-5 shrink-0",children:a.jsx($t,{className:"text-[10px] font-medium",children:l})}),a.jsx("span",{className:"text-sm font-medium truncate",children:o}),a.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:c})]}),a.jsx("time",{className:"md:hidden text-[11px] text-muted-foreground/70 mt-1 block",children:fe(new Date(e.created_at),"MMM d, yyyy · h:mm a")}),d&&a.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),a.jsx("time",{className:"hidden md:block text-xs text-muted-foreground shrink-0",children:fe(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function UZ(){const{projectKey:e}=zt(),{workspace:t}=Ie(),{data:r}=Ha(e??""),{data:n,isLoading:s}=OD((r==null?void 0:r.id)??""),{data:i=new Map}=_s(),{data:o=[]}=zu((t==null?void 0:t.id)??""),l=new Map(o.map(d=>[d.id,d.name])),c=(n==null?void 0:n.length)??0;return a.jsx("div",{className:"p-2 pb-24 md:pb-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold",children:"Activity"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"A log of share access changes, member updates, and project edits."})]}),!s&&c>0&&a.jsxs("p",{className:"text-xs text-muted-foreground shrink-0",children:[c," event",c!==1?"s":""]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Log"})}),s?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(d=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(le,{className:"h-8 w-8 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(le,{className:"h-4 w-48"}),a.jsx(le,{className:"h-3 w-64"})]}),a.jsx(le,{className:"h-3 w-32 shrink-0"})]},d))}):!n||n.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[a.jsx(Iu,{className:"h-8 w-8 text-muted-foreground/20 mb-3"}),a.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No activity yet"}),a.jsx("p",{className:"text-xs text-muted-foreground/60 mt-1",children:"Actions like sharing the project or adding members will appear here."})]}):a.jsx("div",{className:"divide-y divide-border",children:n.map(d=>a.jsx(WZ,{activity:d,userMap:i,teamMap:l},d.id))})]})})}function PP(){return Le({queryKey:["me"],queryFn:()=>oe.get("/admin/users/me")})}function qZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:r=>oe.patch("/admin/users/me",r),onSuccess:({user:r})=>{t({first_name:r.first_name??"",last_name:r.last_name??"",designation:r.designation,phone_number:r.phone_number}),e.invalidateQueries({queryKey:["me"]})}})}function HZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),oe.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function KZ(){const e=Ne(),{updateLocalUser:t}=Ie();return ge({mutationFn:()=>oe.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function YZ(){return ge({mutationFn:()=>oe.post("/admin/users/me/password/send-otp",{})})}function GZ(){const e=Ne();return ge({mutationFn:t=>oe.post("/admin/users/me/password",t),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function VZ(){const e=Ne();return ge({mutationFn:()=>oe.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}const XZ=[{key:"mon",label:"Monday",short:"Mon"},{key:"tue",label:"Tuesday",short:"Tue"},{key:"wed",label:"Wednesday",short:"Wed"},{key:"thu",label:"Thursday",short:"Thu"},{key:"fri",label:"Friday",short:"Fri"},{key:"sat",label:"Saturday",short:"Sat"},{key:"sun",label:"Sunday",short:"Sun"}],QZ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function ZZ({open:e,onClose:t,holiday:r}){const[n,s]=h.useState((r==null?void 0:r.name)??""),[i,o]=h.useState(r!=null&&r.date?r.date.split("T")[0]:""),[l,c]=h.useState((r==null?void 0:r.recurring)??!1);h.useEffect(()=>{e&&(s((r==null?void 0:r.name)??""),o(r!=null&&r.date?r.date.split("T")[0]:""),c((r==null?void 0:r.recurring)??!1))},[e,r==null?void 0:r.id]);const d=z4(),u=L4(),f=d.isPending||u.isPending,m=p=>{if(p.preventDefault(),!n.trim()){U.error("Holiday name is required");return}if(!i){U.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{U.success("Holiday updated"),t()},onError:()=>U.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{U.success("Holiday added"),t()},onError:()=>U.error("Failed to add holiday")})};return a.jsx(Ka,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(fa,{className:"sm:max-w-md",children:[a.jsxs(Ya,{children:[a.jsx(Ga,{children:r?"Edit holiday":"Add holiday"}),a.jsx(No,{children:"Holidays are excluded from business day calculations across the app."})]}),a.jsxs("form",{onSubmit:m,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),a.jsx(Me,{value:n,onChange:p=>s(p.target.value),placeholder:"e.g. New Year's Day",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Date"}),a.jsx(Me,{type:"date",value:i,onChange:p=>o(p.target.value),className:"h-9",required:!0})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Oo,{checked:l,onCheckedChange:p=>c(p)}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Recurring annually (applies every year on the same date)"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ne,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function JZ(){const{data:e,isLoading:t}=jx(),r=$4(),n=(e==null?void 0:e.working_days)??QZ,s=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>U.success("Working days updated"),onError:()=>U.error("Failed to update working days")})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 min-h-[45px] flex items-center",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Working days"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure which days count as business days. This affects duration calculations across the app."})}),t?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3,4,5,6,7].map(i=>a.jsx(le,{className:"h-8 w-full"},i))}):XZ.map(({key:i,label:o})=>{const l=n[i];return a.jsxs("div",{className:"grid grid-cols-[180px_1fr_auto] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:o}),a.jsx("span",{className:L("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),a.jsx(Oo,{checked:l,onCheckedChange:c=>s(i,c),disabled:r.isPending})]},i)})]})}function eJ(){const[e,t]=h.useState(new Date().getFullYear()),[r,n]=h.useState(!1),[s,i]=h.useState(null),[o,l]=h.useState(null),{data:c=[],isLoading:d}=Nx(e),u=F4(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{U.success("Holiday removed"),l(null)},onError:()=>U.error("Failed to remove holiday")})},m=[...c].sort((p,x)=>{const g=new Date(p.date).getMonth()*100+new Date(p.date).getDate(),v=new Date(x.date).getMonth()*100+new Date(x.date).getDate();return g-v});return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Holidays"}),a.jsxs(ne,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}),a.jsxs("div",{className:"flex items-center gap-1 px-6 py-3 border-b border-border bg-muted/10",children:[a.jsxs("p",{className:"text-xs text-muted-foreground flex-1",children:["Showing holidays for"," ",a.jsx("span",{className:"font-medium text-foreground",children:e}),". Recurring holidays appear every year."]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>t(p=>p-1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-medium tabular-nums w-10 text-center",children:e}),a.jsx("button",{onClick:()=>t(p=>p+1),className:"h-6 w-6 flex items-center justify-center rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"hidden md:grid grid-cols-[160px_1fr_120px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Date"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Name"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Recurrence"}),a.jsx("span",{})]}),d?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(p=>a.jsx(le,{className:"h-8 w-full"},p))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center",children:[a.jsx(P1,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsxs("p",{className:"text-sm font-medium mb-1",children:["No holidays for ",e]}),a.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Add a holiday or use the year navigation to view other years."}),a.jsxs(ne,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(p=>{const x=new Date(p.date),g=a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(Ea,{className:"h-3.5 w-3.5"})})}),a.jsxs(Er,{align:"end",className:"w-36",children:[a.jsxs(st,{className:"gap-2 cursor-pointer",onClick:()=>{i(p),n(!0)},children:[a.jsx(Ns,{className:"h-3.5 w-3.5"}),"Edit"]}),a.jsxs(st,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(p),children:[a.jsx(Or,{className:"h-3.5 w-3.5"}),"Remove"]})]})]});return a.jsxs("div",{children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[160px_1fr_120px_40px] gap-4 items-center px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors",children:[a.jsx("span",{className:"text-sm tabular-nums text-muted-foreground",children:fe(x,"MMM d, yyyy")}),a.jsx("span",{className:"text-sm font-medium truncate",children:p.name}),a.jsx("span",{className:"text-sm",children:p.recurring?a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Qi,{className:"h-3 w-3"}),"Every year"]}):a.jsx("span",{className:"text-xs text-muted-foreground/60",children:"One-time"})}),a.jsx("div",{className:"flex justify-end",children:g})]}),a.jsxs("div",{className:"md:hidden flex items-center gap-3 px-4 py-3 border-b border-border hover:bg-muted/20 transition-colors",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:p.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:fe(x,"MMM d, yyyy")}),p.recurring&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(Qi,{className:"h-3 w-3"}),"Recurring"]})]})]}),g]})]},p.id)}),a.jsx(ZZ,{open:r,onClose:()=>{n(!1),i(null)},holiday:s}),a.jsx(ei,{open:!!o,onOpenChange:p=>!p&&l(null),children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsxs(xs,{children:['Remove "',o==null?void 0:o.name,'"?']}),a.jsx(gs,{children:"This holiday will no longer be excluded from business day calculations."})]}),a.jsxs(ps,{children:[a.jsx(ys,{children:"Cancel"}),a.jsx(vs,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}const hj=["super-admin","admin","member"],ch={"super-admin":"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300",admin:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/40 dark:text-indigo-300",member:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300"},ld={pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",accepted:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",revoked:"bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400"};function pj({value:e}){const[t,r]=h.useState(!1),n=()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)};return a.jsx("button",{onClick:n,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Copy",children:t?a.jsx(Xt,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Xp,{className:"h-3.5 w-3.5"})})}const dh={"super-admin":3,admin:2,moderator:1,member:0},Fr=20;function tJ(){const{data:e}=PP(),t=dh[(e==null?void 0:e.role)??"member"]??0,[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(0),[c,d]=h.useState(0);h.useEffect(()=>{const z=setTimeout(()=>{i(r.trim()),l(0),d(0)},400);return()=>clearTimeout(z)},[r]);const{data:u,isLoading:f}=UN({limit:Fr,offset:o*Fr,q:s}),m=(u==null?void 0:u.users)??[],p=(u==null?void 0:u.count)??0,{data:x,isLoading:g}=p4({limit:Fr,offset:c*Fr,q:s}),v=(x==null?void 0:x.invitations)??[],y=(x==null?void 0:x.count)??0,{data:w=[]}=lf(),N=sS(),j=y4(),k=b4(),b=w4(),S=x4(),_=g4(),C=v4(),[P,D]=h.useState(null),[E,I]=h.useState(null),[F,Q]=h.useState(null),[Y,X]=h.useState(!1),[re,ee]=h.useState(""),[T,M]=h.useState("member"),$=z=>{z.preventDefault(),re.trim()&&C.mutate({email:re.trim().toLowerCase(),role:T},{onSuccess:()=>{U.success(`Invitation sent to ${re.trim()}`),X(!1),ee(""),M("member")},onError:G=>U.error((G==null?void 0:G.message)??"Failed to send invitation")})},K=()=>{P&&k.mutate(P,{onSuccess:()=>{U.success("User deactivated"),D(null)},onError:()=>U.error("Failed to deactivate user")})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-2 border-b border-border bg-muted/20",children:[a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["All users",!f&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full",children:p})]}),a.jsxs(ne,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>X(!0),children:[a.jsx(ut,{className:"h-3.5 w-3.5"}),"Invite member"]})]}),a.jsxs("div",{className:"px-6 py-2 border-b border-border bg-muted/10 flex items-center gap-3",children:[a.jsx("p",{className:"text-xs text-muted-foreground flex-1",children:"View and manage all platform users. Change a user's custom role or remove them from the system."}),a.jsx(Me,{value:r,onChange:z=>n(z.target.value),placeholder:"Search by email or name…",className:"h-8 text-xs w-56 shrink-0"})]}),a.jsx(Ka,{open:Y,onOpenChange:z=>{z||(X(!1),ee(""),M("member"))},children:a.jsxs(fa,{className:"sm:max-w-md",children:[a.jsx(Ya,{children:a.jsx(Ga,{children:"Invite member"})}),a.jsxs("form",{onSubmit:$,className:"space-y-4 pt-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Email"}),a.jsx(Me,{type:"email",value:re,onChange:z=>ee(z.target.value),placeholder:"name@example.com",className:"h-9",autoFocus:!0,required:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Role"}),a.jsxs(qe,{value:T,onValueChange:M,children:[a.jsx(We,{className:"h-9 text-sm",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:hj.map(z=>a.jsx(ke,{value:z,className:"text-sm capitalize",children:z},z))})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"The user will receive an invite link to create their account. They won't be added to any workspace automatically — you can add them from workspace settings after they join."}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ne,{type:"button",variant:"outline",size:"sm",onClick:()=>X(!1),children:"Cancel"}),a.jsx(ne,{type:"submit",size:"sm",disabled:C.isPending,children:C.isPending?"Sending…":"Send invite"})]})]})]})}),a.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_40px] gap-4 px-6 py-2 border-b border-border bg-muted/20",children:[a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"User"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Global role"}),a.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Custom role"}),a.jsx("span",{})]}),f?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(z=>a.jsx(le,{className:"h-10 w-full"},z))}):m.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(Na,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsx("p",{className:"text-sm font-medium",children:s?"No users match your search":"No users found"}),s&&a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Try a different search term."})]}):a.jsxs(a.Fragment,{children:[m.map(z=>{var pe;const G=z.first_name??"",A=z.last_name??"",O=`${G} ${A}`.trim()||z.email,J=(G[0]??A[0]??((pe=z.email)==null?void 0:pe[0])??"U").toUpperCase(),B=dh[z.role??"member"]??0,ae=z.id===(e==null?void 0:e.id),R=!ae&&B<t,q=R?a.jsxs(qe,{value:z.role??"member",onValueChange:ue=>j.mutate({userId:z.id,role:ue},{onSuccess:()=>U.success("Global role updated"),onError:ve=>U.error((ve==null?void 0:ve.message)??"Failed to update global role")}),children:[a.jsx(We,{className:"h-7 text-xs w-full",children:a.jsx(Xe,{})}),a.jsx(Ue,{children:hj.filter(ue=>(dh[ue]??0)<=t).map(ue=>a.jsx(ke,{value:ue,className:"text-xs",children:a.jsx("span",{className:L("inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",ch[ue]),children:ue})},ue))})]}):a.jsx("span",{className:L("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium",ch[z.role??"member"]??ch.member),children:z.role??"member"}),se=a.jsxs(qe,{value:z.app_role_id??"none",disabled:!R,onValueChange:ue=>N.mutate({userId:z.id,appRoleId:ue==="none"?null:ue},{onSuccess:()=>U.success("Custom role updated"),onError:()=>U.error("Failed to update custom role")}),children:[a.jsx(We,{className:L("h-7 text-xs w-full",!R&&"opacity-60 cursor-not-allowed"),children:a.jsx(Xe,{placeholder:"No role"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"none",className:"text-xs",children:"No role"}),w.map(ue=>a.jsx(ke,{value:ue.id,className:"text-xs",children:ue.name},ue.id))]})]}),V=z.is_active!==!1,ie=R?a.jsxs(Yr,{children:[a.jsx(Gr,{asChild:!0,children:a.jsx("button",{className:"h-6 w-6 flex items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors",children:a.jsx(Ea,{className:"h-3.5 w-3.5"})})}),a.jsx(Er,{align:"end",className:"w-40",children:V?a.jsxs(st,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>D(z.id),children:[a.jsx(U1,{className:"h-3.5 w-3.5"}),"Deactivate user"]}):a.jsxs(st,{className:"gap-2 cursor-pointer",onClick:()=>{b.mutate(z.id,{onSuccess:()=>U.success("User reactivated"),onError:()=>U.error("Failed to reactivate user")})},children:[a.jsx($5,{className:"h-3.5 w-3.5"}),"Reactivate user"]})})]}):null;return a.jsxs("div",{className:"border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsxs("div",{className:"hidden md:grid grid-cols-[1fr_160px_200px_40px] gap-4 items-center px-6 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-xs font-semibold text-zinc-600 dark:text-zinc-300 shrink-0",children:J}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("p",{className:"text-sm font-medium truncate",children:[O,ae&&a.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!V&&a.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:z.email})]})]}),q,se,a.jsx("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:ie})]}),a.jsxs("div",{className:"md:hidden px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0 mb-2",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-xs font-semibold text-zinc-600 dark:text-zinc-300 shrink-0",children:J}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("p",{className:"text-sm font-medium truncate",children:[O,ae&&a.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"}),!V&&a.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",children:"Deactivated"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:z.email})]}),ie]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex-1",children:q}),a.jsx("div",{className:"flex-1",children:se})]})]})]},z.id)}),p>Fr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[o*Fr+1,"–",Math.min((o+1)*Fr,p)," of ",p]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>l(z=>z-1),disabled:o===0,children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[o+1," / ",Math.ceil(p/Fr)]}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>l(z=>z+1),disabled:(o+1)*Fr>=p,children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 mt-2",children:a.jsxs("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-2",children:["Invitations",!g&&y>0&&a.jsx(Dn,{variant:"secondary",className:"h-5 min-w-[20px] px-1.5 text-[11px] font-medium rounded-full bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",children:y})]})}),g?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(z=>a.jsx(le,{className:"h-8 w-full"},z))}):v.length===0?a.jsx("div",{className:"px-6 py-6 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:s?"No invitations match your search.":"No pending invitations."})}):v.map(z=>{const G=`${window.location.origin}/invite/${z.token}`;return a.jsxs("div",{className:"px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(oi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:z.email??"Shareable link"}),a.jsx("span",{className:L("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",z.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":z.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:z.role==="super-admin"?"Super Admin":z.role==="admin"?"Admin":"Member"}),z.workspace_name&&a.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:["· ",z.workspace_name]})]}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate max-w-[320px]",children:G}),a.jsx(pj,{value:G})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:L("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",ld[z.status]??ld.revoked),children:z.status}),a.jsx("span",{className:"text-xs text-muted-foreground",children:fe(new Date(z.created_at),"MMM d")}),z.status==="pending"&&z.email&&a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>Q(z),disabled:_.isPending,className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(Nd,{className:L("h-3.5 w-3.5",_.isPending&&"animate-spin")})})}),a.jsx(Pn,{children:"Resend invite"})]}),z.status==="pending"&&a.jsx("button",{onClick:()=>I(z),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"md:hidden space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(oi,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:z.email??"Shareable link"}),a.jsx("span",{className:L("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium shrink-0",z.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":z.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:z.role==="super-admin"?"Super Admin":z.role==="admin"?"Admin":"Member"})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:L("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",ld[z.status]??ld.revoked),children:z.status}),z.status==="pending"&&z.email&&a.jsx("button",{onClick:()=>Q(z),disabled:_.isPending,className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:a.jsx(Nd,{className:L("h-3.5 w-3.5",_.isPending&&"animate-spin")})}),z.status==="pending"&&a.jsx("button",{onClick:()=>I(z),className:"text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:a.jsx(Je,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"flex items-center gap-2 pl-10",children:[a.jsx("span",{className:"text-xs font-mono text-muted-foreground truncate flex-1 min-w-0",children:G}),a.jsx(pj,{value:G}),z.workspace_name&&a.jsx("span",{className:"text-[11px] text-muted-foreground truncate shrink-0 max-w-[80px]",children:z.workspace_name}),a.jsx("span",{className:"text-[11px] text-muted-foreground shrink-0",children:fe(new Date(z.created_at),"MMM d")})]})]})]},z.id)}),y>Fr&&a.jsxs("div",{className:"flex items-center justify-between px-4 md:px-6 py-3 border-t border-border",children:[a.jsxs("span",{className:"text-xs text-muted-foreground",children:[c*Fr+1,"–",Math.min((c+1)*Fr,y)," of ",y]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>d(z=>z-1),disabled:c===0,children:a.jsx(na,{className:"h-3.5 w-3.5"})}),a.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums w-12 text-center",children:[c+1," / ",Math.ceil(y/Fr)]}),a.jsx(ne,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>d(z=>z+1),disabled:(c+1)*Fr>=y,children:a.jsx(hr,{className:"h-3.5 w-3.5"})})]})]}),a.jsx(ei,{open:!!P,onOpenChange:z=>!z&&D(null),children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsx(xs,{children:"Deactivate this user?"}),a.jsx(gs,{children:"The user will lose access immediately and be hidden from member lists. You can reactivate them later."})]}),a.jsxs(ps,{children:[a.jsx(ys,{children:"Cancel"}),a.jsx(vs,{onClick:K,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Deactivate"})]})]})}),a.jsx(ei,{open:!!E,onOpenChange:z=>!z&&I(null),children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsx(xs,{children:"Revoke this invitation?"}),a.jsxs(gs,{children:["The invite link sent to ",a.jsx("span",{className:"font-medium",children:E==null?void 0:E.email})," will no longer work."]})]}),a.jsxs(ps,{children:[a.jsx(ys,{children:"Cancel"}),a.jsx(vs,{onClick:()=>{E&&S.mutate(E.id,{onSuccess:()=>{U.success("Invitation revoked"),I(null)},onError:()=>U.error("Failed to revoke invitation")})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke"})]})]})}),a.jsx(ei,{open:!!F,onOpenChange:z=>!z&&Q(null),children:a.jsxs(ms,{children:[a.jsxs(hs,{children:[a.jsx(xs,{children:"Resend invitation?"}),a.jsxs(gs,{children:["A new invitation email will be sent to ",a.jsx("span",{className:"font-medium",children:F==null?void 0:F.email}),"."]})]}),a.jsxs(ps,{children:[a.jsx(ys,{children:"Cancel"}),a.jsx(vs,{onClick:()=>{F&&_.mutate(F.id,{onSuccess:()=>{U.success("Invitation resent"),Q(null)},onError:()=>U.error("Failed to resend invitation")})},children:"Resend"})]})]})})]})}const rJ=["working-days","holidays","members"];function nJ(){const[e,t]=Hl(),r=e.get("tab"),n=r&&rJ.includes(r)?r:"working-days",s=o=>t({tab:o},{replace:!0}),i=[{id:"working-days",label:"Working Days"},{id:"holidays",label:"Holidays"},{id:"members",label:"Members"}];return a.jsx("div",{className:"p-2 md:pb-2 h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(P1,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Organization Settings"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Global configuration that applies across the entire Meridian deployment."})]})]})}),a.jsx("div",{className:"flex border-b border-border shrink-0 px-6",children:i.map(o=>a.jsx("button",{onClick:()=>s(o.id),className:L("px-1 py-3 mr-6 text-sm font-medium border-b-2 transition-colors",n===o.id?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:o.label},o.id))}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n==="working-days"&&a.jsx(JZ,{}),n==="holidays"&&a.jsx(eJ,{}),n==="members"&&a.jsx(tJ,{})]})]})})}const uh=e=>{let{transform:t}=e;return{...t,y:0}};function yv(){const[e,t]=h.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),r=h.useRef(null);return h.useLayoutEffect(()=>{const n=s=>{var o;let i={x:s.pageX,y:s.pageY};if(((o=r.current)==null?void 0:o.nodeType)===Node.ELEMENT_NODE){const{left:l,top:c}=r.current.getBoundingClientRect(),d=l+window.scrollX,u=c+window.scrollY,f=s.pageX-d,m=s.pageY-u;i.elementX=f,i.elementY=m,i.elementPositionX=d,i.elementPositionY=u}t(l=>({...l,...i}))};return document.addEventListener("mousemove",n),()=>{document.removeEventListener("mousemove",n)}},[]),[e,r]}function aJ(e,t=500){const[r,n]=h.useState(e),s=h.useRef(null);return h.useEffect(()=>{const i=Date.now();if(s.current&&i>=s.current+t)s.current=i,n(e);else{const o=window.setTimeout(()=>{s.current=i,n(e)},t);return()=>window.clearTimeout(o)}},[e,t]),r}function sJ(){const[e,t]=h.useState({x:null,y:null}),r=h.useCallback((...n)=>{if(typeof n[0]=="object")window.scrollTo(n[0]);else if(typeof n[0]=="number"&&typeof n[1]=="number")window.scrollTo(n[0],n[1]);else throw new Error("Invalid arguments passed to scrollTo. See here for more info. https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return h.useLayoutEffect(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),[e,r]}const Gn={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function OP(e){return"init"in e}function Ap(e){return!!e.write}function xj(e){return"v"in e||"e"in e}function Mu(e){if("e"in e)throw e.e;if((Gn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function Pu(e){return typeof(e==null?void 0:e.then)=="function"}function EP(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function AP(e,t,r){var n;const s=new Set;for(const i of((n=r.get(e))==null?void 0:n.t)||[])s.add(i);for(const i of t.p)s.add(i);return s}const iJ=(e,t,...r)=>t.read(...r),oJ=(e,t,...r)=>t.write(...r),lJ=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},cJ=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},dJ=(e,t)=>{var r;const n=Ut(e),s=n[0],i=n[6],o=n[9];if((Gn?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let l=s.get(t);return l||(l={d:new Map,p:new Set,n:0},s.set(t,l),(r=i.i)==null||r.call(i,t),o==null||o(e,t)),l},uJ=e=>{const t=Ut(e),r=t[1],n=t[3],s=t[4],i=t[5],o=t[6],l=t[13],c=[],d=u=>{try{u()}catch(f){c.push(f)}};do{o.f&&d(o.f);const u=new Set,f=u.add.bind(u);n.forEach(m=>{var p;return(p=r.get(m))==null?void 0:p.l.forEach(f)}),n.clear(),i.forEach(f),i.clear(),s.forEach(f),s.clear(),u.forEach(d),n.size&&l(e)}while(n.size||i.size||s.size);if(c.length)throw new AggregateError(c)},fJ=e=>{const t=Ut(e),r=t[1],n=t[2],s=t[3],i=t[11],o=t[14],l=t[17],c=[],d=new WeakSet,u=new WeakSet,f=Array.from(s);for(;f.length;){const m=f[f.length-1],p=i(e,m);if(u.has(m)){f.pop();continue}if(d.has(m)){if(n.get(m)===p.n)c.push([m,p]);else if((Gn?"production":void 0)!=="production"&&n.has(m))throw new Error("[Bug] invalidated atom exists");u.add(m),f.pop();continue}d.add(m);for(const x of AP(m,p,r))d.has(x)||f.push(x)}for(let m=c.length-1;m>=0;--m){const[p,x]=c[m];let g=!1;for(const v of x.d.keys())if(v!==p&&s.has(v)){g=!0;break}g&&(o(e,p),l(e,p)),n.delete(p)}},Dp=new WeakSet,mJ=(e,t)=>{var r,n;const s=Ut(e),i=s[1],o=s[2],l=s[3],c=s[6],d=s[7],u=s[11],f=s[12],m=s[13],p=s[14],x=s[16],g=s[17],v=s[20],y=s[26],w=u(e,t);if(xj(w)){if(i.has(t)&&o.get(t)!==w.n)return w;let I=!1;for(const[F,Q]of w.d)if(p(e,F).n!==Q){I=!0;break}if(!I)return w}let N=!0;const j=new Set(w.d.keys()),k=new Map,b=()=>{for(const I of j)k.has(I)||w.d.delete(I)},S=()=>{if(i.has(t)){const I=!l.size;g(e,t),I&&(m(e),f(e))}},_=I=>{var F;if(I===t){const Y=u(e,I);if(!xj(Y))if(OP(I))v(e,I,I.init);else throw new Error("no atom init");return Mu(Y)}const Q=p(e,I);try{return Mu(Q)}finally{k.set(I,Q.n),w.d.set(I,Q.n),Pu(w.v)&&EP(t,w.v,Q),i.has(t)&&((F=i.get(I))==null||F.t.add(t)),N||S()}};let C,P;const D={get signal(){return C||(C=new AbortController),C.signal},get setSelf(){return(Gn?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Gn?"production":void 0)!=="production"&&!Ap(t)&&console.warn("setSelf function cannot be used with read-only atom"),!P&&Ap(t)&&(P=(...I)=>{if((Gn?"production":void 0)!=="production"&&N&&console.warn("setSelf function cannot be called in sync"),!N)try{return x(e,t,...I)}finally{m(e),f(e)}}),P}},E=w.n;try{(Gn?"production":void 0)!=="production"&&Dp.delete(e);const I=d(e,t,_,D);if((Gn?"production":void 0)!=="production"&&Dp.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,I),Pu(I)){y(e,I,()=>C==null?void 0:C.abort());const F=()=>{b(),S()};I.then(F,F)}else b();return(r=c.r)==null||r.call(c,t),w}catch(I){return delete w.v,w.e=I,++w.n,w}finally{N=!1,E!==w.n&&o.get(t)===E&&(o.set(t,w.n),l.add(t),(n=c.c)==null||n.call(c,t))}},hJ=(e,t)=>{const r=Ut(e),n=r[1],s=r[2],i=r[11],o=[t];for(;o.length;){const l=o.pop(),c=i(e,l);for(const d of AP(l,c,n)){const u=i(e,d);s.get(d)!==u.n&&(s.set(d,u.n),o.push(d))}}},pJ=(e,t,...r)=>{const n=Ut(e),s=n[3],i=n[6],o=n[8],l=n[11],c=n[12],d=n[13],u=n[14],f=n[15],m=n[16],p=n[17],x=n[20];let g=!0;const v=w=>Mu(u(e,w)),y=(w,...N)=>{var j;const k=l(e,w);try{if(w===t){if(!OP(w))throw new Error("atom not writable");(Gn?"production":void 0)!=="production"&&Dp.add(e);const b=k.n,S=N[0];x(e,w,S),p(e,w),b!==k.n&&(s.add(w),f(e,w),(j=i.c)==null||j.call(i,w));return}else return m(e,w,...N)}finally{g||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{g=!1}},xJ=(e,t)=>{var r;const n=Ut(e),s=n[1],i=n[3],o=n[6],l=n[11],c=n[15],d=n[18],u=n[19],f=l(e,t),m=s.get(t);if(m){for(const[p,x]of f.d)if(!m.d.has(p)){const g=l(e,p);d(e,p).t.add(t),m.d.add(p),x!==g.n&&(i.add(p),c(e,p),(r=o.c)==null||r.call(o,p))}for(const p of m.d)if(!f.d.has(p)){m.d.delete(p);const x=u(e,p);x==null||x.t.delete(t)}}},gJ=(e,t)=>{var r;const n=Ut(e),s=n[1],i=n[4],o=n[6],l=n[10],c=n[11],d=n[12],u=n[13],f=n[14],m=n[16],p=n[18],x=c(e,t);let g=s.get(t);if(!g){f(e,t);for(const v of x.d.keys())p(e,v).t.add(t);if(g={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(t,g),Ap(t)){const v=()=>{let y=!0;const w=(...N)=>{try{return m(e,t,...N)}finally{y||(u(e),d(e))}};try{const N=l(e,t,w);N&&(g.u=()=>{y=!0;try{N()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return g},vJ=(e,t)=>{var r,n;const s=Ut(e),i=s[1],o=s[5],l=s[6],c=s[11],d=s[19],u=c(e,t);let f=i.get(t);if(!f||f.l.size)return f;let m=!1;for(const p of f.t)if((r=i.get(p))!=null&&r.d.has(t)){m=!0;break}if(!m){f.u&&o.add(f.u),f=void 0,i.delete(t);for(const p of u.d.keys()){const x=d(e,p);x==null||x.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},yJ=(e,t,r)=>{const n=Ut(e),s=n[11],i=n[27],o=s(e,t),l="v"in o,c=o.v;if(Pu(r))for(const d of o.d.keys())EP(t,r,s(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,Pu(c)&&i(e,c))},bJ=(e,t)=>{const r=Ut(e)[14];return Mu(r(e,t))},wJ=(e,t,...r)=>{const n=Ut(e),s=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),s(e)}},jJ=(e,t,r)=>{const n=Ut(e),s=n[12],i=n[18],o=n[19],c=i(e,t).l;return c.add(r),s(e),()=>{c.delete(r),o(e,t),s(e)}},NJ=(e,t,r)=>{const s=Ut(e)[25];let i=s.get(t);if(!i){i=new Set,s.set(t,i);const o=()=>s.delete(t);t.then(o,o)}i.add(r)},kJ=(e,t)=>{const s=Ut(e)[25].get(t);s==null||s.forEach(i=>i())},DP=new WeakMap,Ut=e=>{const t=DP.get(e);if((Gn?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function SJ(e){const t=Ut(e),r=t[24];return r?r(t):t}function CJ(...e){const t={get(n){const s=Ut(t)[21];return s(t,n)},set(n,...s){const i=Ut(t)[22];return i(t,n,...s)},sub(n,s){const i=Ut(t)[23];return i(t,n,s)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},iJ,oJ,lJ,cJ,dJ,uJ,fJ,mJ,hJ,pJ,xJ,gJ,vJ,yJ,bJ,wJ,jJ,void 0,new WeakMap,NJ,kJ].map((n,s)=>e[s]||n);return DP.set(t,Object.freeze(r)),t}const TP={};let _J=0;function IP(e,t){const r=`atom${++_J}`,n={toString(){return(TP?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=MJ,n.write=PJ),n}function MJ(e){return e(this)}function PJ(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function OJ(){return CJ()}let ml;function EJ(){return ml||(ml=OJ(),(TP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ml),globalThis.__JOTAI_DEFAULT_STORE__!==ml&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ml}const AJ={},DJ=h.createContext(void 0);function RP(e){return h.useContext(DJ)||EJ()}const Tp=e=>typeof(e==null?void 0:e.then)=="function",Ip=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},TJ=W.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Ip(e),e)}),fh=new WeakMap,gj=(e,t,r)=>{const s=SJ(e)[26];let i=fh.get(t);return i||(i=new Promise((o,l)=>{let c=t;const d=m=>p=>{c===m&&o(p)},u=m=>p=>{c===m&&l(p)},f=()=>{try{const m=r();Tp(m)?(fh.set(m,i),c=m,m.then(d(m),u(m)),s(e,m,f)):o(m)}catch(m){l(m)}};t.then(d(t),u(t)),s(e,t,f)}),fh.set(t,i)),i};function IJ(e,t){const{delay:r,unstable_promiseStatus:n=!W.use}={},s=RP(),[[i,o,l],c]=h.useReducer(u=>{const f=s.get(e);return Object.is(u[0],f)&&u[1]===s&&u[2]===e?u:[f,s,e]},void 0,()=>[s.get(e),s,e]);let d=i;if((o!==s||l!==e)&&(c(),d=s.get(e)),h.useEffect(()=>{const u=s.sub(e,()=>{if(n)try{const f=s.get(e);Tp(f)&&Ip(gj(s,f,()=>s.get(e)))}catch{}if(typeof r=="number"){setTimeout(c,r);return}c()});return c(),u},[s,e,r,n]),h.useDebugValue(d),Tp(d)){const u=gj(s,d,()=>s.get(e));return n&&Ip(u),TJ(u)}return d}function RJ(e,t){const r=RP();return h.useCallback((...s)=>{if((AJ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...s)},[r,e])}function $P(e,t){return[IJ(e),RJ(e)]}var zP="Expected a function",vj=NaN,$J="[object Symbol]",zJ=/^\s+|\s+$/g,LJ=/^[-+]0x[0-9a-f]+$/i,FJ=/^0b[01]+$/i,BJ=/^0o[0-7]+$/i,WJ=parseInt,UJ=typeof Ec=="object"&&Ec&&Ec.Object===Object&&Ec,qJ=typeof self=="object"&&self&&self.Object===Object&&self,HJ=UJ||qJ||Function("return this")(),KJ=Object.prototype,YJ=KJ.toString,GJ=Math.max,VJ=Math.min,mh=function(){return HJ.Date.now()};function XJ(e,t,r){var n,s,i,o,l,c,d=0,u=!1,f=!1,m=!0;if(typeof e!="function")throw new TypeError(zP);t=yj(t)||0,Ou(r)&&(u=!!r.leading,f="maxWait"in r,i=f?GJ(yj(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function p(b){var S=n,_=s;return n=s=void 0,d=b,o=e.apply(_,S),o}function x(b){return d=b,l=setTimeout(y,t),u?p(b):o}function g(b){var S=b-c,_=b-d,C=t-S;return f?VJ(C,i-_):C}function v(b){var S=b-c,_=b-d;return c===void 0||S>=t||S<0||f&&_>=i}function y(){var b=mh();if(v(b))return w(b);l=setTimeout(y,g(b))}function w(b){return l=void 0,m&&n?p(b):(n=s=void 0,o)}function N(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function j(){return l===void 0?o:w(mh())}function k(){var b=mh(),S=v(b);if(n=arguments,s=this,c=b,S){if(l===void 0)return x(c);if(f)return l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return k.cancel=N,k.flush=j,k}function QJ(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(zP);return Ou(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),XJ(e,t,{leading:n,maxWait:t,trailing:s})}function Ou(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ZJ(e){return!!e&&typeof e=="object"}function JJ(e){return typeof e=="symbol"||ZJ(e)&&YJ.call(e)==$J}function yj(e){if(typeof e=="number")return e;if(JJ(e))return vj;if(Ou(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ou(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(zJ,"");var r=FJ.test(e);return r||BJ.test(e)?WJ(e.slice(2),r?2:8):LJ.test(e)?vj:+e}var eee=QJ;const tee=Ua(eee),LP=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:L("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));LP.displayName="Card";const ree=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:L("flex flex-col space-y-1.5 p-6",e),...t}));ree.displayName="CardHeader";const nee=h.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:L("text-2xl font-semibold leading-none tracking-tight",e),...t}));nee.displayName="CardTitle";const aee=h.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:L("text-sm text-muted-foreground",e),...t}));aee.displayName="CardDescription";const see=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:L("p-6 pt-0",e),...t}));see.displayName="CardContent";const iee=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:L("flex items-center p-6 pt-0",e),...t}));iee.displayName="CardFooter";function oee(e,t=[]){let r=[];function n(i,o){const l=h.createContext(o),c=r.length;r=[...r,o];const d=f=>{var y;const{scope:m,children:p,...x}=f,g=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>x,Object.values(x));return a.jsx(g.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var g;const p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,x=h.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=r.map(o=>h.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,lee(s,...t)]}function lee(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function cee(e){const t=dee(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(fee);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return a.jsx(t,{...o,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...o,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function dee(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=hee(s),l=mee(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Xj(n,o):o),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uee=Symbol("radix.slottable");function fee(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uee}function mee(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function hee(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xee=pee.reduce((e,t)=>{const r=cee(`Primitive.${t}`),n=h.forwardRef((s,i)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),bv="ContextMenu",[gee]=oee(bv,[Jj]),Rr=Jj(),[vee,FP]=gee(bv),BP=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:s,modal:i=!0}=e,[o,l]=h.useState(!1),c=Rr(t),d=cE(n),u=h.useCallback(f=>{l(f),d(f)},[d]);return a.jsx(vee,{scope:t,open:o,onOpenChange:u,modal:i,children:a.jsx(dE,{...c,dir:s,open:o,onOpenChange:u,modal:i,children:r})})};BP.displayName=bv;var WP="ContextMenuTrigger",UP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...s}=e,i=FP(WP,r),o=Rr(r),l=h.useRef({x:0,y:0}),c=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=h.useRef(0),u=h.useCallback(()=>window.clearTimeout(d.current),[]),f=m=>{l.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return h.useEffect(()=>u,[u]),h.useEffect(()=>void(n&&u()),[n,u]),a.jsxs(a.Fragment,{children:[a.jsx(uE,{...o,virtualRef:c}),a.jsx(xee.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Ws(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:Ws(e.onPointerDown,cd(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:Ws(e.onPointerMove,cd(u)),onPointerCancel:n?e.onPointerCancel:Ws(e.onPointerCancel,cd(u)),onPointerUp:n?e.onPointerUp:Ws(e.onPointerUp,cd(u))})]})});UP.displayName=WP;var yee="ContextMenuPortal",qP=e=>{const{__scopeContextMenu:t,...r}=e,n=Rr(t);return a.jsx(tE,{...n,...r})};qP.displayName=yee;var HP="ContextMenuContent",KP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=FP(HP,r),i=Rr(r),o=h.useRef(!1);return a.jsx(rE,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var c;(c=e.onCloseAutoFocus)==null||c.call(e,l),!l.defaultPrevented&&o.current&&l.preventDefault(),o.current=!1},onInteractOutside:l=>{var c;(c=e.onInteractOutside)==null||c.call(e,l),!l.defaultPrevented&&!s.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});KP.displayName=HP;var bee="ContextMenuGroup",wee=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(fE,{...s,...n,ref:t})});wee.displayName=bee;var jee="ContextMenuLabel",YP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(oE,{...s,...n,ref:t})});YP.displayName=jee;var Nee="ContextMenuItem",GP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(nE,{...s,...n,ref:t})});GP.displayName=Nee;var kee="ContextMenuCheckboxItem",VP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(aE,{...s,...n,ref:t})});VP.displayName=kee;var See="ContextMenuRadioGroup",Cee=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(mE,{...s,...n,ref:t})});Cee.displayName=See;var _ee="ContextMenuRadioItem",XP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(iE,{...s,...n,ref:t})});XP.displayName=_ee;var Mee="ContextMenuItemIndicator",QP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(sE,{...s,...n,ref:t})});QP.displayName=Mee;var Pee="ContextMenuSeparator",ZP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(lE,{...s,...n,ref:t})});ZP.displayName=Pee;var Oee="ContextMenuArrow",Eee=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(hE,{...s,...n,ref:t})});Eee.displayName=Oee;var Aee="ContextMenuSubTrigger",JP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(JO,{...s,...n,ref:t})});JP.displayName=Aee;var Dee="ContextMenuSubContent",eO=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Rr(r);return a.jsx(eE,{...s,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eO.displayName=Dee;function cd(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Tee=BP,Iee=UP,Ree=qP,tO=KP,rO=YP,nO=GP,aO=VP,sO=XP,iO=QP,oO=ZP,lO=JP,cO=eO;const $ee=Tee,zee=Iee,Lee=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(lO,{ref:s,className:L("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,a.jsx(hr,{className:"ml-auto h-4 w-4"})]}));Lee.displayName=lO.displayName;const Fee=h.forwardRef(({className:e,...t},r)=>a.jsx(cO,{ref:r,className:L("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fee.displayName=cO.displayName;const dO=h.forwardRef(({className:e,...t},r)=>a.jsx(Ree,{children:a.jsx(tO,{ref:r,className:L("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));dO.displayName=tO.displayName;const uO=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(nO,{ref:n,className:L("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));uO.displayName=nO.displayName;const Bee=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(aO,{ref:s,className:L("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(iO,{children:a.jsx(Xt,{className:"h-4 w-4"})})}),t]}));Bee.displayName=aO.displayName;const Wee=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(sO,{ref:n,className:L("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(iO,{children:a.jsx(Pr,{className:"h-2 w-2 fill-current"})})}),t]}));Wee.displayName=sO.displayName;const Uee=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(rO,{ref:n,className:L("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));Uee.displayName=rO.displayName;const qee=h.forwardRef(({className:e,...t},r)=>a.jsx(oO,{ref:r,className:L("-mx-1 my-1 h-px bg-border",e),...t}));qee.displayName=oO.displayName;const Hee=IP(!1),Kee=IP(0),wv=()=>$P(Hee),jv=()=>$P(Kee),Yee=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=Ss),t},Oc=e=>{let t=AN;return(e==="monthly"||e==="quarterly")&&(t=IN),t},Nv=e=>{let t=X3;return(e==="monthly"||e==="quarterly")&&(t=AN),t},Wl=e=>{let t=Ji;return(e==="monthly"||e==="quarterly")&&(t=$N),t},Gee=e=>{let t=TN;return(e==="monthly"||e==="quarterly")&&(t=vx),t},fO=e=>{let t=Hr;return(e==="monthly"||e==="quarterly")&&(t=px),t},vl=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,s=Math.floor(t/n),i=Yee(e.range),l=fO(e.range)(r,s),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Hr(l,u)},Vee=e=>{const t=[];t.push({year:e.getFullYear()-1,quarters:new Array(4).fill(null)},{year:e.getFullYear(),quarters:new Array(4).fill(null)},{year:e.getFullYear()+1,quarters:new Array(4).fill(null)});for(const r of t)r.quarters=new Array(4).fill(null).map((n,s)=>({months:new Array(3).fill(null).map((i,o)=>{const l=s*3+o;return{days:Ss(new Date(r.year,l,1))}})}));return t},mO=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,s=Oc(r.range),i=Wl(r.range),o=s(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=Ss(e),d=n/c;return o*n+l*d},Xee=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const s=Oc(r.range);if(r.range==="daily"){const x=s(t,e);return n*(x||1)}const i=Ss(e),o=n/i;if(eo(e,t))return o;const l=Nv(r.range),c=Wl(r.range);if(eo(c(e),c(t)))return l(t,e)*o;const d=i-bl(e),u=bl(t),f=s(c(t),c(e)),m=Ss(t),p=n/m;return(f-1)*n+d*o+u*p},hO=(e,t,r)=>{const n=Wl(t),s=Gee(t),i=Nv(t),o=n(e),l=s(e),c=i(l,o);return e.getDate()/c*r},zn=h.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),kv=({title:e,columns:t,renderHeaderItem:r})=>{const n=h.useId();return a.jsxs("div",{className:"sticky top-0 z-20 grid w-full shrink-0 bg-backdrop/90 backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("div",{children:a.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:a.jsx("p",{children:e})})}),a.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((s,i)=>a.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:r(i)},`${n}-${i}`))})]})},Qee=()=>h.useContext(zn).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(kv,{columns:r.days,renderHeaderItem:s=>a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx("p",{children:fe(Hr(new Date(t.year,n,1),s),"d")}),a.jsx("p",{className:"text-muted-foreground",children:fe(Hr(new Date(t.year,n,1),s),"EEEEE")})]}),title:fe(new Date(t.year,n,1),"MMMM yyyy")}),a.jsx(Sv,{columns:r.days,isColumnSecondary:s=>[0,6].includes(Hr(new Date(t.year,n,1),s).getDay())})]},`${t.year}-${n}`))),Zee=()=>h.useContext(zn).timelineData.map(t=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(kv,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>a.jsx("p",{children:fe(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),a.jsx(Sv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),Jee=()=>h.useContext(zn).timelineData.map(t=>t.quarters.map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(kv,{columns:r.months.length,renderHeaderItem:s=>a.jsx("p",{children:fe(new Date(t.year,n*3+s,1),"MMM")}),title:`Q${n+1} ${t.year}`}),a.jsx(Sv,{columns:r.months.length})]},`${t.year}-${n}`))),ete={daily:Qee,monthly:Zee,quarterly:Jee},tte=({className:e})=>{const t=h.useContext(zn),r=ete[t.range];return a.jsx("div",{className:L("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:a.jsx(r,{})})},hh=({feature:e,onSelectItem:t,className:r,duration:n})=>{const s=h.useContext(zn),i=e.endAt&&eo(e.startAt,e.endAt)?Hr(e.endAt,1):e.endAt,o=n??(i?Sh(e.startAt,i):`${Sh(e.startAt,new Date)} so far`),l=d=>{var u;d.target===d.currentTarget&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))},c=d=>{var u;d.key==="Enter"&&((u=s.scrollToFeature)==null||u.call(s,e),t==null||t(e.id))};return a.jsxs("div",{className:L("relative flex items-center gap-2.5 p-2.5 text-xs hover:bg-secondary",r),onClick:l,onKeyDown:c,role:"button",style:{height:"var(--gantt-row-height)"},tabIndex:0,children:[a.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),a.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),a.jsx("p",{className:"pointer-events-none text-muted-foreground",children:o})]},e.id)},rte=()=>a.jsxs("div",{className:"sticky top-0 z-10 flex shrink-0 items-end justify-between gap-2.5 border-border/50 border-b bg-backdrop/90 p-2.5 font-medium text-muted-foreground text-xs backdrop-blur-sm",style:{height:"var(--gantt-header-height)"},children:[a.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),a.jsx("p",{className:"shrink-0",children:"Duration"})]}),ph=({children:e,name:t,className:r})=>a.jsxs("div",{className:r,children:[a.jsx("p",{className:"w-full truncate p-2.5 text-left font-medium text-muted-foreground text-xs",style:{height:"var(--gantt-row-height)"},children:t}),a.jsx("div",{className:"divide-y divide-border/50",children:e})]}),nte=({children:e,className:t})=>a.jsxs("div",{className:L("sticky left-0 z-30 h-max min-h-full overflow-clip border-border/50 border-r bg-white dark:bg-zinc-950 backdrop-blur-md",t),"data-roadmap-ui":"gantt-sidebar",children:[a.jsx(rte,{}),a.jsx("div",{className:"space-y-4",children:e})]}),ate=({top:e,className:t})=>{const[r]=jv(),n=h.useContext(zn),[s,i]=yv(),o=()=>{var u,f,m;const l=(f=(u=n.ref)==null?void 0:u.current)==null?void 0:f.getBoundingClientRect(),c=s.x-((l==null?void 0:l.left)??0)+r-n.sidebarWidth,d=vl(n,c);(m=n.onAddItem)==null||m.call(n,d)};return a.jsx("div",{className:L("absolute top-0 w-full px-0.5",t),ref:i,style:{marginTop:-n.rowHeight/2,transform:`translateY(${e}px)`},children:a.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:o,type:"button",children:a.jsx(ut,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},ste=({index:e,isColumnSecondary:t})=>{var m;const r=h.useContext(zn),[n]=wv(),[s,i]=yv(),[o,l]=h.useState(!1),[c]=sJ(),d=()=>l(!0),u=()=>l(!1),f=aJ(s.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return a.jsx("div",{className:L("group relative h-full overflow-hidden",t!=null&&t(e)?"bg-[#f59e0b]/5 dark:bg-[#f59e0b]/5":""),onMouseEnter:d,onMouseLeave:u,ref:i,children:!n&&o&&r.onAddItem?a.jsx(ate,{top:f}):null})},Sv=({columns:e,isColumnSecondary:t})=>{const r=h.useId();return a.jsx("div",{className:"divide grid h-full w-full divide-x divide-border/50",style:{gridTemplateColumns:`repeat(${e}, var(--gantt-column-width))`},children:Array.from({length:e}).map((n,s)=>a.jsx(ste,{index:s,isColumnSecondary:t},`${r}-${s}`))})},bj=({direction:e,featureId:t,date:r})=>{const[,n]=wv(),{attributes:s,listeners:i,setNodeRef:o}=n1({id:`feature-drag-helper-${t}`}),l=!!s["aria-pressed"];return h.useEffect(()=>n(l),[l,n]),a.jsxs("div",{className:L("group -translate-y-1/2 !cursor-col-resize absolute top-1/2 z-[3] h-full w-6 rounded-md outline-none",e==="left"?"-left-2.5":"-right-2.5"),ref:o,...s,...i,children:[a.jsx("div",{className:L("-translate-y-1/2 absolute top-1/2 h-[80%] w-1 rounded-sm bg-muted-foreground opacity-0 transition-all",e==="left"?"left-2.5":"right-2.5",e==="left"?"group-hover:left-0":"group-hover:right-0",l&&(e==="left"?"left-0":"right-0"),"group-hover:opacity-100",l&&"opacity-100")}),r&&a.jsx("div",{className:L("-translate-x-1/2 absolute top-10 hidden whitespace-nowrap rounded-lg border border-border/50 bg-background/90 px-2 py-1 text-foreground text-xs backdrop-blur-lg group-hover:block",l&&"block"),children:fe(r,"MMM dd, yyyy")})]})},ite=({id:e,children:t})=>{const[,r]=wv(),{attributes:n,listeners:s,setNodeRef:i}=n1({id:e}),o=!!n["aria-pressed"];return h.useEffect(()=>r(o),[o,r]),a.jsx(LP,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:a.jsx("div",{className:L("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...s,ref:i,children:t})})},wj=({onMove:e,children:t,className:r,...n})=>{const[s]=jv(),i=h.useContext(zn),o=h.useMemo(()=>{var D;return new Date(((D=i.timelineData.at(0))==null?void 0:D.year)??0,0,1)},[i.timelineData]),[l,c]=h.useState(n.startAt),[d,u]=h.useState(n.endAt),f=h.useMemo(()=>Xee(l,d,i),[l,d,i]),m=h.useMemo(()=>mO(l,o,i),[l,o,i]),p=h.useMemo(()=>fO(i.range),[i.range]),[x]=yv(),[g,v]=h.useState(0),[y,w]=h.useState(l),[N,j]=h.useState(d),k=Lp(wE,{activationConstraint:{distance:10}}),b=h.useCallback(()=>{v(x.x),w(l),j(d)},[x.x,l,d]),S=h.useCallback(()=>{const D=vl(i,x.x),E=vl(i,g),I=i.range==="daily"?Oc(i.range)(D,E):Nv(i.range)(D,E),F=Hr(y,I),Q=N?Hr(N,I):null;c(F),u(Q)},[i,x.x,g,y,N]),_=h.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),C=h.useCallback(()=>{var Q,Y;const D=(Y=(Q=i.ref)==null?void 0:Q.current)==null?void 0:Y.getBoundingClientRect(),E=x.x-((D==null?void 0:D.left)??0)+s-i.sidebarWidth,F=Wl(i.range)(vl(i,E));c(F)},[i,x.x,s]),P=h.useCallback(()=>{var Q,Y;const D=(Y=(Q=i.ref)==null?void 0:Q.current)==null?void 0:Y.getBoundingClientRect(),E=x.x-((D==null?void 0:D.left)??0)+s-i.sidebarWidth,F=Wl(i.range)(vl(i,E));u(F)},[i,x.x,s]);return a.jsx("div",{className:L("relative flex w-max min-w-full py-0.5",r),style:{height:"var(--gantt-row-height)"},children:a.jsxs("div",{className:"pointer-events-auto absolute top-0.5",style:{height:"calc(var(--gantt-row-height) - 4px)",width:Math.round(f),left:Math.round(m)},children:[e&&a.jsx(yl,{modifiers:[uh],onDragEnd:_,onDragMove:C,sensors:[k],children:a.jsx(bj,{date:l,direction:"left",featureId:n.id})}),a.jsx(yl,{modifiers:[uh],onDragEnd:_,onDragMove:S,onDragStart:b,sensors:[k],children:a.jsx(ite,{id:n.id,children:t??a.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&a.jsx(yl,{modifiers:[uh],onDragEnd:_,onDragMove:P,sensors:[k],children:a.jsx(bj,{date:d?WN(d,1):p(l,1),direction:"right",featureId:n.id})})]})})},xh=({children:e,className:t})=>a.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),ote=({className:e,children:t})=>a.jsx("div",{className:L("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),pO=h.memo(({label:e,date:t,id:r,onRemove:n,className:s})=>{const i=h.useContext(zn),o=h.useMemo(()=>Oc(i.range),[i.range]),l=h.useMemo(()=>{var f;return new Date(((f=i.timelineData.at(0))==null?void 0:f.year)??0,0,1)},[i.timelineData]),c=h.useMemo(()=>o(t,l),[o,t,l]),d=h.useMemo(()=>hO(t,i.range,i.columnWidth*i.zoom/100),[t,i.range,i.columnWidth,i.zoom]),u=h.useCallback(()=>n==null?void 0:n(r),[n,r]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${c} + ${d}px))`},children:[a.jsxs($ee,{children:[a.jsx(zee,{asChild:!0,children:a.jsxs("div",{className:L("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",s),children:[e,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:fe(t,"MMM dd, yyyy")})]})}),a.jsx(dO,{children:n?a.jsxs(uO,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[a.jsx(D5,{size:16}),"Remove marker"]}):null})]}),a.jsx("div",{className:L("h-full w-px bg-card",s)})]})});pO.displayName="GanttMarker";const lte=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:s})=>{const i=h.useRef(null),[o,l]=h.useState(Vee(new Date)),[,c]=jv(),[d,u]=h.useState(0),f=60,m=36;let p=50;t==="monthly"?p=150:t==="quarterly"&&(p=100);const x=h.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*p}px`,"--gantt-header-height":`${f}px`,"--gantt-row-height":`${m}px`,"--gantt-sidebar-width":`${d}px`}),[e,p,d]);h.useEffect(()=>{i.current&&(i.current.scrollLeft=i.current.scrollWidth/2-i.current.clientWidth/2,c(i.current.scrollLeft))},[c]),h.useEffect(()=>{const y=()=>{var k;const j=((k=i.current)==null?void 0:k.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;u(j)};y();const w=new MutationObserver(y);return i.current&&w.observe(i.current,{childList:!0,subtree:!0}),()=>{w.disconnect()}},[]);const g=h.useCallback(tee(()=>{var k,b;const y=i.current;if(!y)return;const{scrollLeft:w,scrollWidth:N,clientWidth:j}=y;if(c(w),w===0){const S=(k=o[0])==null?void 0:k.year;if(!S)return;const _=[...o];_.unshift({year:S-1,quarters:new Array(4).fill(null).map((C,P)=>({months:new Array(3).fill(null).map((D,E)=>{const I=P*3+E;return{days:Ss(new Date(S,I,1))}})}))}),l(_),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(w+j>=N){const S=(b=o.at(-1))==null?void 0:b.year;if(!S)return;const _=[...o];_.push({year:S+1,quarters:new Array(4).fill(null).map((C,P)=>({months:new Array(3).fill(null).map((D,E)=>{const I=P*3+E;return{days:Ss(new Date(S,I,1))}})}))}),l(_),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);h.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",g),()=>{y&&y.removeEventListener("scroll",g)}},[g]);const v=h.useCallback(y=>{const w=i.current;if(!w)return;const N=new Date(o[0].year,0,1),j=mO(y.startAt,N,{zoom:e,range:t,columnWidth:p}),k=Math.max(0,j);w.scrollTo({left:k,behavior:"smooth"})},[o,e,t,p,d,r]);return a.jsx(zn.Provider,{value:{zoom:e,range:t,headerHeight:f,columnWidth:p,sidebarWidth:d,rowHeight:m,onAddItem:r,timelineData:o,placeholderLength:2,ref:i,scrollToFeature:v},children:a.jsx("div",{className:L("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:i,style:{...x,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},cte=({children:e,className:t})=>a.jsx("div",{className:L("relative flex h-full w-max flex-none overflow-clip",t),children:e}),dte=({className:e})=>{const t="Today",r=h.useMemo(()=>new Date,[]),n=h.useContext(zn),s=h.useMemo(()=>Oc(n.range),[n.range]),i=h.useMemo(()=>{var c;return new Date(((c=n.timelineData.at(0))==null?void 0:c.year)??0,0,1)},[n.timelineData]),o=h.useMemo(()=>s(r,i),[s,r,i]),l=h.useMemo(()=>hO(r,n.range,n.columnWidth*n.zoom/100),[r,n.range,n.columnWidth,n.zoom]);return a.jsxs("div",{className:"pointer-events-none absolute top-0 left-0 z-20 flex h-full select-none flex-col items-center justify-center overflow-visible",style:{width:0,transform:`translateX(calc(var(--gantt-column-width) * ${o} + ${l}px))`},children:[a.jsxs("div",{className:L("group pointer-events-auto sticky top-0 flex select-auto flex-col flex-nowrap items-center justify-center whitespace-nowrap rounded-b-md bg-card px-2 py-1 text-foreground text-xs",e),children:[t,a.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:fe(r,"MMM dd, yyyy")})]}),a.jsx("div",{className:L("h-full w-px bg-card",e)})]})};function ute(e){return Le({queryKey:["public","share",e],queryFn:()=>oe.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function Cv(e,t={}){const r=new URLSearchParams;t.status&&r.set("status",t.status),t.priority&&r.set("priority",t.priority),t.search&&r.set("search",t.search);const n=r.toString()?`?${r.toString()}`:"";return Le({queryKey:["public","share",e,"issues",t],queryFn:()=>oe.get(`/public/share/${e}/issues${n}`),select:s=>s.issues,enabled:!!e,retry:!1})}function xO(e){return Le({queryKey:["public","share",e,"sprints"],queryFn:()=>oe.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function fte({priority:e,className:t}){const r=L("h-3.5 w-3.5 shrink-0",oc[e],t);switch(e){case"urgent":return a.jsx(da,{className:r});case"high":return a.jsx(ji,{className:r});case"medium":return a.jsx(qa,{className:r});case"low":return a.jsx(wi,{className:r});default:return a.jsx(Pr,{className:L("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const Rp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function gO({issue:e,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:i=!1,children:o=[],childrenMap:l}){const[c,d]=h.useState(!1),u=o.length>0,f=n[e.status]??"#94a3b8",m=s.find(p=>p.id===e.sprint_id);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:L(`group grid ${Rp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[a.jsx("span",{className:L("text-xs font-mono text-muted-foreground truncate","sticky left-0 z-10 pl-6 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"text-muted-foreground/60"),children:e.identifier}),a.jsxs("div",{className:L("flex items-center gap-1 min-w-0 pr-3","sticky left-[70px] z-10 transition-colors","bg-white dark:bg-card group-hover:bg-[#f9fafb] dark:group-hover:bg-muted/30",i&&"bg-[#f8f9fa] dark:bg-muted/20"),children:[u?a.jsxs(Jn,{children:[a.jsx(ea,{asChild:!0,children:a.jsx("button",{onClick:()=>d(!c),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:c?a.jsx(ca,{className:"h-3.5 w-3.5"}):a.jsx(hr,{className:"h-3.5 w-3.5"})})}),a.jsx(Pn,{side:"top",children:c?"Collapse":"Expand"})]}):i?a.jsx(On,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:L("text-sm text-foreground truncate",i&&"text-muted-foreground"),children:e.title}),u&&a.jsxs("span",{className:"shrink-0 flex items-center gap-0.5 ml-1 text-[10px] font-medium text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 px-1 py-0.5 rounded",children:[a.jsx(On,{className:"h-2.5 w-2.5"}),o.length]})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:f}}),a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r[e.status]??e.status})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(fte,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:an[e.priority]??e.priority})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 max-w-full",children:[a.jsx(Kr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:L("text-xs truncate",m?"text-foreground":"text-muted-foreground/50"),children:(m==null?void 0:m.name)??"—"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1",children:[a.jsx(Wt,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:L("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?fe(new Date(e.due_date),"MMM d, yyyy"):"—"})]}),a.jsx("div",{className:"flex items-center px-1.5",children:a.jsx("div",{className:"flex -space-x-1.5",children:(e.assignees??[]).slice(0,3).map(p=>a.jsx("div",{title:p.name,className:"h-5 w-5 rounded-full bg-indigo-100 dark:bg-indigo-900 border border-white dark:border-card flex items-center justify-center text-[10px] font-medium text-indigo-700 dark:text-indigo-300",children:p.initials},p.id))})})]}),c&&o.map(p=>a.jsx(gO,{issue:p,statuses:t,statusLabels:r,statusColorMap:n,sprints:s,isChild:!0,children:(l==null?void 0:l[p.id])??[],childrenMap:l},p.id))]})}function mte({issues:e,childrenMap:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,totalCount:o}){const[l,c]=h.useState(!1);return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 px-6 py-2 bg-muted/20 border-b border-border",children:[a.jsx("button",{onClick:()=>c(!l),className:"text-muted-foreground hover:text-foreground transition-colors",children:l?a.jsx(hr,{className:"h-3.5 w-3.5"}):a.jsx(ca,{className:"h-3.5 w-3.5"})}),a.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:"Issues"}),a.jsx("span",{className:"text-[11px] text-muted-foreground/60 font-mono",children:o})]}),!l&&a.jsx("div",{className:"divide-y divide-border/60",children:e.length===0?a.jsx("div",{className:"px-14 py-5 text-xs text-muted-foreground/50 italic",children:"No issues match your filters"}):e.map(d=>a.jsx(gO,{issue:d,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function hte({token:e,statuses:t}){const[r,n]=h.useState("all"),[s,i]=h.useState("all"),[o,l]=h.useState("all"),[c,d]=h.useState(""),{data:u=[],isLoading:f}=Cv(e),{data:m=[]}=xO(e),p=Object.fromEntries(t.map(N=>[N.key,N.name])),x=Object.fromEntries(t.map(N=>[N.key,N.color])),g={};for(const N of u)N.parent_id&&(g[N.parent_id]||(g[N.parent_id]=[]),g[N.parent_id].push(N));const v=u.filter(N=>!N.parent_id).filter(N=>{const j=c.toLowerCase(),k=!c||N.title.toLowerCase().includes(j)||N.identifier.toLowerCase().includes(j),b=r==="all"||N.status===r,S=s==="all"||N.priority===s,_=o==="all"?!0:o==="none"?!N.sprint_id:N.sprint_id===o;return k&&b&&S&&_}).sort((N,j)=>{const k=parseInt(N.identifier.split("-")[1]??"0",10),b=parseInt(j.identifier.split("-")[1]??"0",10);return k-b}),y=v.reduce((N,j)=>{var k;return N+(((k=g[j.id])==null?void 0:k.length)??0)},0),w=v.length+y;return a.jsx("div",{className:"p-2",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(qe,{value:o,onValueChange:l,children:[a.jsx(We,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Xe,{placeholder:"Sprint"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(ke,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(N=>a.jsx(ke,{value:N.id,className:"text-xs",children:N.name},N.id))]})]}),a.jsxs(qe,{value:r,onValueChange:n,children:[a.jsx(We,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Xe,{placeholder:"Status"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:N,name:j})=>a.jsx(ke,{value:N,className:"text-xs",children:j},N))]})]}),a.jsxs(qe,{value:s,onValueChange:i,children:[a.jsx(We,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Xe,{placeholder:"Priority"})}),a.jsxs(Ue,{children:[a.jsx(ke,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(an).map(([N,j])=>a.jsx(ke,{value:N,className:"text-xs",children:j},N))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(ki,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),a.jsx(Me,{placeholder:"Search...",value:c,onChange:N=>d(N.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-[900px]",children:[a.jsxs("div",{className:L("grid items-center py-2.5 border-b border-border",Rp),children:[a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-0 z-10 bg-white dark:bg-card pl-6",children:"ID"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280] sticky left-[70px] z-10 bg-white dark:bg-card",children:"Title"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Status"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Priority"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Sprint"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Due Date"}),a.jsx("span",{className:"text-xs font-medium text-[#6b7280]",children:"Assignees"})]}),f?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(N=>a.jsxs("div",{className:L("grid items-center px-6 py-3 gap-4",Rp),children:[a.jsx(le,{className:"h-4 w-14"}),a.jsx(le,{className:"h-4 w-56"}),a.jsx(le,{className:"h-5 w-20"}),a.jsx(le,{className:"h-4 w-16"}),a.jsx(le,{className:"h-4 w-20"}),a.jsx(le,{className:"h-4 w-24"}),a.jsx(le,{className:"h-6 w-16"})]},N))}):u.length===0?a.jsx("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:a.jsx("p",{className:"text-sm font-medium mb-1",children:"No issues yet"})}):a.jsx(Du,{delayDuration:200,children:a.jsx(mte,{issues:v,childrenMap:g,statuses:t,statusLabels:p,statusColorMap:x,sprints:m,totalCount:w})})]})}),!f&&w>0&&a.jsx("div",{className:"flex items-center px-6 py-3 border-t border-border",children:a.jsxs("span",{className:"text-xs text-muted-foreground",children:[w," issue",w!==1?"s":""]})})]})})}function dd(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Hr(new Date(e.due_date),1):Hr(r,1);return{id:e.id,name:`${e.identifier} ${e.title}`,startAt:r,endAt:n,status:{id:e.status,name:e.status,color:t}}}function pte({token:e,statuses:t}){const[r,n]=h.useState("monthly"),s=h.useRef(null),{data:i=[]}=Cv(e),{data:o=[]}=xO(e);h.useEffect(()=>{const m=requestAnimationFrame(()=>{var w;const p=(w=s.current)==null?void 0:w.querySelector(".gantt");if(!p)return;const x=new Date,g=x.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((x.getTime()-new Date(g,0,1).getTime())/864e5)*50;else{const N=r==="monthly"?150:100,j=(x.getFullYear()-g)*12+x.getMonth(),k=new Date(x.getFullYear(),x.getMonth()+1,0).getDate();y=j*N+(x.getDate()-1)/k*N}p.scrollLeft=Math.max(0,y-(p.clientWidth-v)/2)});return()=>cancelAnimationFrame(m)},[r]);const l=Object.fromEntries(t.map(m=>[m.key,m.color])),c=i.filter(m=>m.due_date),d=i.filter(m=>!m.due_date),u={},f=[];for(const m of c)m.sprint_id?(u[m.sprint_id]||(u[m.sprint_id]=[]),u[m.sprint_id].push(m)):f.push(m);return a.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[a.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:a.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>a.jsx("button",{onClick:()=>n(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${r===m?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:m},m))})}),a.jsx("div",{ref:s,className:"flex-1 min-h-0 overflow-hidden",children:a.jsxs(lte,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(nte,{children:[o.map(m=>{const p=u[m.id]??[];return a.jsx(ph,{name:m.name,children:p.map(x=>a.jsx(hh,{feature:dd(x,l[x.status]??"#94a3b8")},x.id))},m.id)}),f.length>0&&a.jsx(ph,{name:"No Sprint",children:f.map(m=>a.jsx(hh,{feature:dd(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&a.jsx(ph,{name:"Unscheduled",children:d.map(m=>a.jsx(hh,{feature:{id:m.id,name:`${m.identifier} ${m.title}`,startAt:new Date,endAt:new Date,status:{id:m.status,name:m.status,color:l[m.status]??"#94a3b8"}}},m.id))})]}),a.jsxs(cte,{children:[a.jsx(tte,{}),a.jsxs(ote,{children:[o.map(m=>a.jsx(xh,{children:(u[m.id]??[]).map(p=>a.jsx("div",{className:"flex",children:a.jsx(wj,{...dd(p,l[p.status]??"#94a3b8")})},p.id))},m.id)),f.length>0&&a.jsx(xh,{children:f.map(m=>a.jsx("div",{className:"flex",children:a.jsx(wj,{...dd(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&a.jsx(xh,{children:d.map(m=>a.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),o.filter(m=>m.end_date).map(m=>a.jsx(pO,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),a.jsx(dte,{})]})]})})]})}function xte(){const{token:e}=zt(),[t,r]=h.useState("board"),{data:n,isLoading:s,isError:i}=ute(e??""),{data:o}=Cv(e??"");if(!e)return null;if(s)return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading…"})});if(i||!n)return a.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-3",children:[a.jsx("p",{className:"text-lg font-semibold",children:"Link not found"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This share link is invalid or has been revoked."})]});const l=[{key:"board",label:"Board"},{key:"issues",label:"Issues"},{key:"timeline",label:"Timeline"}];return a.jsxs("div",{className:"h-screen flex flex-col bg-background overflow-hidden",children:[a.jsx("header",{className:"border-b border-border px-6 py-3 bg-white dark:bg-card shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&a.jsx("span",{className:"text-xl",children:n.icon}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-mono text-indigo-700 dark:text-indigo-300 bg-indigo-50 dark:bg-indigo-950/50 border border-indigo-200 dark:border-indigo-800 px-2 py-0.5 rounded",children:n.identifier}),a.jsx("h1",{className:"text-sm font-semibold",children:n.name})]}),a.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"Read-only view"})]})}),a.jsx("div",{className:"border-b border-border bg-white dark:bg-card px-6 shrink-0",children:a.jsx("div",{className:"flex -mb-px",children:l.map(({key:c,label:d})=>a.jsx("button",{onClick:()=>r(c),className:`px-3 py-2 text-sm border-b-2 transition-colors ${t===c?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:d},c))})}),a.jsxs("div",{className:`flex-1 min-h-0 ${t==="timeline"?"overflow-hidden":"overflow-auto"}`,children:[t==="board"&&a.jsx(GN,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&a.jsx(hte,{token:e,statuses:n.statuses}),t==="timeline"&&a.jsx(pte,{token:e,statuses:n.statuses})]})]})}const gte=new URLSearchParams(window.location.search);function vte(){const[e,t]=h.useState(null),r=pt(),n=Ie(),s=h.useRef(!1);if(h.useEffect(()=>{if(s.current)return;s.current=!0;const i=gte;if(history.replaceState(null,"",window.location.pathname),i.get("linked")==="true"){r("/profile?linked=true",{replace:!0});return}const l=i.get("error");if(l){t(decodeURIComponent(l));return}const c=i.get("code");if(!c){t("No authorization code received from Google sign-in");return}(async()=>{const u=await fetch(`${Xi}/auth/google/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:c})});if(!u.ok)throw new Error(`Code exchange failed (${u.status}). Please try signing in again.`);const{token:f}=await u.json(),m=await fetch(`${Xi}/admin/users/me`,{headers:{Authorization:`Bearer ${f}`}});if(!m.ok)throw new Error(`Failed to load user profile (${m.status})`);const p=await m.json();n.login({id:p.id,email:p.email,first_name:p.first_name??"",last_name:p.last_name??"",avatar_url:p.avatar_url},f),r("/",{replace:!0})})().catch(u=>t(u.message??"Failed to complete sign-in"))},[]),e){const i=e.startsWith("GOOGLE_NOT_LINKED:"),o=i?e.replace("GOOGLE_NOT_LINKED: ",""):e;return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[400px] bg-white dark:bg-card border border-border rounded-xl p-6 text-center space-y-4",children:[a.jsx("p",{className:"text-sm font-medium",children:i?"Google account not connected":"Sign-in failed"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:o}),i?a.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[a.jsx(Mr,{to:"/login",children:a.jsx(ne,{className:"w-full",size:"sm",children:"Sign in with email & password"})}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["After signing in, go to ",a.jsx("strong",{children:"Profile"})," → ",a.jsx("strong",{children:"Connections"})," to link your Google account."]})]}):a.jsx(Mr,{to:"/login",children:a.jsx(ne,{variant:"outline",size:"sm",children:"Back to login"})})]})})}return a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Completing sign-in..."})})}function jj({className:e}){return a.jsxs("svg",{className:e??"size-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[a.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),a.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),a.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z",fill:"#FBBC05"}),a.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}function yte(){var B,ae,R,q;const[e,t]=Hl(),{user:r}=Ie(),{data:n,isLoading:s}=PP(),i=qZ(),o=HZ(),l=KZ(),c=VZ(),d=YZ(),u=GZ(),f=h.useRef(null),[m,p]=h.useState(""),[x,g]=h.useState(""),[v,y]=h.useState(""),[w,N]=h.useState(""),[j,k]=h.useState(!1),[b,S]=h.useState(!1),[_,C]=h.useState(""),[P,D]=h.useState(""),[E,I]=h.useState(""),[F,Q]=h.useState(!1),[Y,X]=h.useState(0),re=h.useRef(null);h.useEffect(()=>{n&&(p(n.first_name??""),g(n.last_name??""),y(n.designation??""),N(n.phone_number??""))},[n]),h.useEffect(()=>{e.get("linked")==="true"&&(U.success("Google account connected successfully"),t(se=>(se.delete("linked"),se),{replace:!0}))},[e,t]);const ee=r&&(`${((B=r.first_name)==null?void 0:B[0])??""}${((ae=r.last_name)==null?void 0:ae[0])??""}`.toUpperCase()||((q=(R=r.email)==null?void 0:R[0])==null?void 0:q.toUpperCase()))||"?",T=se=>{var ie;const V=(ie=se.target.files)==null?void 0:ie[0];V&&(o.mutate(V,{onSuccess:()=>U.success("Avatar updated"),onError:pe=>U.error(pe.message??"Failed to upload avatar")}),se.target.value="")},M=()=>{l.mutate(void 0,{onSuccess:()=>U.success("Avatar removed"),onError:se=>U.error(se.message??"Failed to remove avatar")})},$=()=>{i.mutate({first_name:m,last_name:x,designation:v||null,phone_number:w||null},{onSuccess:()=>U.success("Profile updated"),onError:se=>U.error(se.message??"Failed to update profile")})},K=()=>{const se=localStorage.getItem("meridian_token");if(!se){U.error("You must be logged in to connect Google");return}window.location.href=`${Xi}/auth/google/link?token=${encodeURIComponent(se)}`},z=()=>{c.mutate(void 0,{onSuccess:()=>U.success("Google account disconnected"),onError:se=>U.error(se.message??"Failed to unlink Google account")})},G=h.useCallback(()=>{X(30),re.current&&clearInterval(re.current),re.current=setInterval(()=>{X(se=>se<=1?(re.current&&clearInterval(re.current),0):se-1)},1e3)},[]);h.useEffect(()=>()=>{re.current&&clearInterval(re.current)},[]);const A=()=>{d.mutate(void 0,{onSuccess:()=>{S(!0),G(),U.success("Verification code sent to your email")},onError:se=>U.error(se.message??"Failed to send verification code")})},O=()=>{if(P.length<8){U.error("New password must be at least 8 characters");return}if(P!==E){U.error("Passwords do not match");return}u.mutate({otp:_,new_password:P},{onSuccess:()=>{U.success("Password updated"),J()},onError:se=>U.error(se.message??"Failed to set password")})},J=()=>{k(!1),S(!1),C(""),D(""),I(""),Q(!1),X(0),re.current&&clearInterval(re.current)};return a.jsx("div",{className:"p-2 md:h-full",children:a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden flex flex-col md:h-full",children:[a.jsx("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border shrink-0",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ql,{className:"h-5 w-5 text-muted-foreground"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-base font-semibold",children:"Profile"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Manage your personal details and account connections."})]})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between px-4 md:px-6 py-4 border-b border-border gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground shrink-0",children:"Profile photo"}),a.jsxs("div",{className:"flex flex-1 items-center gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsxs(Rt,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?a.jsx(Nl,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,a.jsx($t,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:ee})]}),o.isPending&&a.jsx("div",{className:"absolute inset-0 rounded-xl bg-black/40 flex items-center justify-center",children:a.jsx("span",{className:"text-white text-[10px]",children:"…"})})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(ne,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var se;return(se=f.current)==null?void 0:se.click()},disabled:o.isPending,children:[a.jsx(l5,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&a.jsxs(ne,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:M,disabled:l.isPending,children:[a.jsx(Or,{className:"size-3.5"}),"Remove"]})]}),a.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:T})]})]}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Personal information"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"First name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Me,{value:m,onChange:se=>p(se.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"First name"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Last name"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Me,{value:x,onChange:se=>g(se.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"Last name"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),s?a.jsx(le,{className:"h-4 w-48"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.email)??"—"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Designation"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Me,{value:v,onChange:se=>y(se.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"e.g. Software Engineer"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Phone number"}),s?a.jsx(le,{className:"h-8 w-56"}):a.jsx(Me,{value:w,onChange:se=>N(se.target.value),className:"h-8 w-full max-w-64 text-sm bg-transparent",placeholder:"+1 555 000 0000"})]}),a.jsx("div",{className:"flex justify-end px-6 py-4 border-b border-border",children:a.jsx(ne,{size:"sm",onClick:$,disabled:i.isPending,children:i.isPending?"Saving…":"Save changes"})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Connections"})}),a.jsx("div",{className:"px-4 md:px-6 py-3.5 border-b border-border",children:s?a.jsx(le,{className:"h-8 w-48"}):n!=null&&n.google_id?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(jj,{className:"size-3.5 shrink-0"}),a.jsx("span",{className:"text-foreground font-medium",children:"Google"}),a.jsx(aa,{className:"size-3.5 text-emerald-500 shrink-0"}),a.jsx("span",{className:"text-foreground font-medium",children:"Connected"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground truncate flex-1",children:n.email}),a.jsxs(ne,{size:"sm",className:"h-7 gap-1.5 bg-red-600 hover:bg-red-700 text-white shrink-0",onClick:z,disabled:c.isPending,children:[a.jsx(Vp,{className:"size-3.5"}),"Disconnect"]})]})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(jj,{className:"size-3.5 shrink-0"}),a.jsx("span",{className:"text-sm font-medium",children:"Google"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"}),a.jsx(ne,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:K,children:"Connect"})]})}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/10",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"Security"})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[180px_1fr] items-start md:items-center gap-1 md:gap-4 px-4 md:px-6 py-4 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Password"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:(n==null?void 0:n.has_password)===!1?"No password set":"••••••••"}),a.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:()=>k(!0),children:[a.jsx(y5,{className:"size-3.5"}),(n==null?void 0:n.has_password)===!1?"Create password":"Change password"]})]})]}),a.jsx(Ka,{open:j,onOpenChange:se=>{se||J()},children:a.jsxs(fa,{className:"sm:max-w-md",children:[a.jsxs(Ya,{children:[a.jsx(Ga,{children:(n==null?void 0:n.has_password)===!1?"Create password":"Change password"}),a.jsxs(No,{children:["We'll send a 6-digit verification code to ",a.jsx("span",{className:"font-medium text-foreground",children:n==null?void 0:n.email})]})]}),a.jsxs("div",{className:"space-y-4 py-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(mt,{className:"text-sm",children:"Verification code"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(fx,{maxLength:6,value:_,onChange:C,children:[a.jsxs(_d,{children:[a.jsx(Jr,{index:0}),a.jsx(Jr,{index:1}),a.jsx(Jr,{index:2})]}),a.jsx(xN,{}),a.jsxs(_d,{children:[a.jsx(Jr,{index:3}),a.jsx(Jr,{index:4}),a.jsx(Jr,{index:5})]})]}),b?Y>0?a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums w-16 text-center",children:["Resend in ",Y,"s"]}):a.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 shrink-0 text-indigo-500 hover:text-indigo-600",onClick:A,disabled:d.isPending,children:d.isPending?"Sending…":"Resend"}):a.jsx(ne,{variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:A,disabled:d.isPending,children:d.isPending?"Sending…":"Send code"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(mt,{className:"text-sm",children:"New password"}),a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:F?"text":"password",value:P,onChange:se=>D(se.target.value),className:"h-9 text-sm pr-9",placeholder:"At least 8 characters",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>Q(!F),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:F?a.jsx(Xl,{className:"size-3.5"}):a.jsx(Ni,{className:"size-3.5"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(mt,{className:"text-sm",children:"Confirm password"}),a.jsx(Me,{type:"password",value:E,onChange:se=>I(se.target.value),className:"h-9 text-sm",placeholder:"Re-enter new password",autoComplete:"new-password"})]})]}),a.jsxs(lx,{children:[a.jsx(ne,{variant:"ghost",size:"sm",onClick:J,children:"Cancel"}),a.jsx(ne,{size:"sm",onClick:O,disabled:u.isPending||_.length!==6||!P||!E,children:u.isPending?"Saving…":(n==null?void 0:n.has_password)===!1?"Create password":"Update password"})]})]})})]})]})})}function bte(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),s=sD(),i=o=>{o.preventDefault(),s.mutate({email:e},{onSuccess:()=>n(!0),onError:l=>U.error(l.message??"Something went wrong")})};return a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:r?"Check your email":"Forgot password?"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:r?"If an account exists with that email, we've sent a reset link.":"Enter your email and we'll send you a reset link."})]})]}),r?a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Didn't receive an email? Check your spam folder or try again."}),a.jsx(ne,{variant:"outline",className:"w-full h-10",onClick:()=>{n(!1),t("")},children:"Try again"})]}):a.jsxs("form",{onSubmit:i,className:"space-y-2",children:[a.jsx(Me,{type:"email",placeholder:"Email",value:e,onChange:o=>t(o.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10",autoFocus:!0}),a.jsx("div",{className:"pt-1",children:a.jsx(ne,{type:"submit",className:"w-full h-10 font-medium",disabled:s.isPending,children:s.isPending?"Sending...":"Send reset link"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs(Mr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(go,{className:"size-3.5"}),"Back to login"]})})]})})}function wte(){const[e]=Hl(),t=e.get("token")??"",r=pt(),n=iD(),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=f=>{if(f.preventDefault(),s.length<8){U.error("Password must be at least 8 characters");return}if(s!==o){U.error("Passwords do not match");return}n.mutate({token:t,password:s},{onSuccess:()=>{U.success("Password has been reset. Please sign in."),r("/login",{replace:!0})},onError:m=>U.error(m.message??"Failed to reset password")})};return t?a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px]",children:[a.jsxs("div",{className:"flex flex-col items-center gap-4 mb-8",children:[a.jsx("div",{className:"relative h-16 w-16 rounded-2xl bg-white dark:bg-card border border-border shadow-sm flex items-center justify-center",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-foreground flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 rounded-full bg-background/20 flex items-center justify-center",children:a.jsx("div",{className:"h-2 w-2 rounded-full bg-background/60"})})})}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Set new password"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Enter your new password below."})]})]}),a.jsxs("form",{onSubmit:u,className:"space-y-2",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Me,{type:c?"text":"password",placeholder:"New password",value:s,onChange:f=>i(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10 pr-10",autoFocus:!0}),a.jsx("button",{type:"button",onClick:()=>d(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",tabIndex:-1,children:c?a.jsx(Xl,{className:"h-4 w-4"}):a.jsx(Ni,{className:"h-4 w-4"})})]}),a.jsx(Me,{type:"password",placeholder:"Confirm password",value:o,onChange:f=>l(f.target.value),autoComplete:"new-password",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx("div",{className:"pt-1",children:a.jsx(ne,{type:"submit",className:"w-full h-10 font-medium",disabled:n.isPending,children:n.isPending?"Resetting...":"Reset password"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs(Mr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(go,{className:"size-3.5"}),"Back to login"]})})]})}):a.jsx("div",{className:"min-h-screen bg-[hsl(60_5%_96%)] dark:bg-background flex items-center justify-center p-4",children:a.jsxs("div",{className:"w-full max-w-[360px] text-center space-y-4",children:[a.jsx("p",{className:"text-sm font-medium",children:"Invalid reset link"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"This link is missing or expired."}),a.jsx(Mr,{to:"/forgot-password",children:a.jsx(ne,{variant:"outline",size:"sm",children:"Request a new link"})})]})})}const jte=h.lazy(()=>u1(()=>import("./ProjectTimelinePage-B-dYvsY6.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),Nte=h.lazy(()=>u1(()=>import("./WorkspaceReportingPage-DMV616MH.js"),__vite__mapDeps([6,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function $s({children:e}){const{isAuthenticated:t}=Ie();return t?a.jsx(a.Fragment,{children:e}):a.jsx(Zn,{to:"/login",replace:!0})}function kte({children:e}){var r;const{user:t}=Ie();return(r=t==null?void 0:t.roles)!=null&&r.includes("super-admin")?a.jsx(a.Fragment,{children:e}):a.jsx(Zn,{to:"/",replace:!0})}function Nj({children:e}){var s,i,o;const{user:t}=Ie(),r=((s=t==null?void 0:t.roles)==null?void 0:s.includes("super-admin"))||((i=t==null?void 0:t.roles)==null?void 0:i.includes("admin")),n=(o=t==null?void 0:t.permissions)==null?void 0:o.includes("workspace:admin");return r||n?a.jsx(a.Fragment,{children:e}):a.jsx(Zn,{to:"/",replace:!0})}function ud({children:e}){const{isAuthenticated:t}=Ie(),{data:r}=Lu(),n=Ul();return t?a.jsx(Zn,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?a.jsx(Zn,{to:"/register",replace:!0}):r&&!r.needsSetup&&!r.registrationEnabled&&n.pathname==="/register"?a.jsx(Zn,{to:"/login",replace:!0}):a.jsx(a.Fragment,{children:e})}function Ste(){const{workspace:e,setWorkspace:t,user:r}=Ie(),n=pt(),{data:s,isLoading:i}=bo();return h.useEffect(()=>{var o,l;if(!i&&s!==void 0){if(e){if(s.some(d=>d.id===e.id)){n(`/${e.slug}/projects`,{replace:!0});return}t(null)}if(s.length>0){const c=s[0];t({id:c.id,name:c.name,slug:c.slug,logo_url:c.logo_url}),n(`/${c.slug}/projects`,{replace:!0})}else{const c=((o=r==null?void 0:r.roles)==null?void 0:o.includes("super-admin"))||((l=r==null?void 0:r.roles)==null?void 0:l.includes("admin"));n(c?"/setup":"/awaiting-access",{replace:!0})}}},[s,i,n,t,r,e]),a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})})}function Cte(){const{workspace:e}=zt(),{workspace:t,setWorkspace:r,user:n}=Ie();dD();const s=pt(),{data:i,isLoading:o,isFetching:l}=bo();return h.useEffect(()=>{var d,u;if(o||!i)return;const c=i.find(f=>f.slug===e);if(c)c.id!==(t==null?void 0:t.id)&&r({id:c.id,name:c.name,slug:c.slug,logo_url:c.logo_url});else{if(l)return;if(i.length>0)r({id:i[0].id,name:i[0].name,slug:i[0].slug,logo_url:i[0].logo_url}),s(`/${i[0].slug}/projects`,{replace:!0});else{r(null);const f=((d=n==null?void 0:n.roles)==null?void 0:d.includes("super-admin"))||((u=n==null?void 0:n.roles)==null?void 0:u.includes("admin"));s(f?"/setup":"/awaiting-access",{replace:!0})}}},[i,e,o,l,t==null?void 0:t.id,s,r,n]),o||!t||t.slug!==e?a.jsx("div",{className:"min-h-screen flex items-center justify-center",children:a.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading..."})}):a.jsxs(a.Fragment,{children:[a.jsx(rT,{}),a.jsx(FT,{})]})}function _te(){const{isAuthenticated:e}=Ie(),t=Ne(),r=h.useRef(e);h.useEffect(()=>{r.current&&!e&&t.clear(),r.current=e},[e,t])}function Mte(){return _te(),a.jsxs(CO,{children:[a.jsx(Ye,{path:"/login",element:a.jsx(ud,{children:a.jsx(WT,{})})}),a.jsx(Ye,{path:"/register",element:a.jsx(ud,{children:a.jsx(r3,{})})}),a.jsx(Ye,{path:"/forgot-password",element:a.jsx(ud,{children:a.jsx(bte,{})})}),a.jsx(Ye,{path:"/reset-password",element:a.jsx(ud,{children:a.jsx(wte,{})})}),a.jsx(Ye,{path:"/invite/:token",element:a.jsx(zz,{})}),a.jsx(Ye,{path:"/oauth/google/callback",element:a.jsx(vte,{})}),a.jsx(Ye,{path:"/share/:token",element:a.jsx(xte,{})}),a.jsx(Ye,{path:"/reporting",element:a.jsx($s,{children:a.jsx(Nj,{children:a.jsx(lT,{})})}),children:a.jsx(Ye,{index:!0,element:a.jsx(zZ,{})})}),a.jsx(Ye,{path:"/org/settings",element:a.jsx($s,{children:a.jsx(Nj,{children:a.jsx(uT,{})})}),children:a.jsx(Ye,{index:!0,element:a.jsx(nJ,{})})}),a.jsx(Ye,{path:"/profile",element:a.jsx($s,{children:a.jsx(hT,{})}),children:a.jsx(Ye,{index:!0,element:a.jsx(yte,{})})}),a.jsx(Ye,{path:"/setup",element:a.jsx($s,{children:a.jsx(n3,{})})}),a.jsx(Ye,{path:"/awaiting-access",element:a.jsx($s,{children:a.jsx(a3,{})})}),a.jsx(Ye,{index:!0,element:a.jsx($s,{children:a.jsx(Ste,{})})}),a.jsxs(Ye,{path:"/:workspace",element:a.jsx($s,{children:a.jsx(Cte,{})}),children:[a.jsx(Ye,{index:!0,element:a.jsx(Zn,{to:"projects",replace:!0})}),a.jsx(Ye,{path:"projects",element:a.jsx(d4,{})}),a.jsxs(Ye,{path:"projects/:projectKey",element:a.jsx(sT,{}),children:[a.jsx(Ye,{path:"board",element:a.jsx(Y6,{})}),a.jsx(Ye,{path:"issues",element:a.jsx(G6,{})}),a.jsx(Ye,{path:"issues/new",element:a.jsx(oz,{})}),a.jsx(Ye,{path:"issues/:issueId",element:a.jsx(rz,{})}),a.jsx(Ye,{path:"sprints",element:a.jsx(wz,{})}),a.jsx(Ye,{path:"timeline",element:a.jsx(h.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(jte,{})})}),a.jsx(Ye,{path:"access",element:a.jsx(Q6,{})}),a.jsx(Ye,{path:"reports",element:a.jsx(LZ,{})}),a.jsx(Ye,{path:"activity",element:a.jsx(UZ,{})})]}),a.jsx(Ye,{path:"my-tasks",element:a.jsx(pz,{})}),a.jsx(Ye,{path:"notifications",element:a.jsx(gz,{})}),a.jsx(Ye,{path:"reporting",element:a.jsx(h.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading…"}),children:a.jsx(Nte,{})})}),a.jsx(Ye,{path:"settings",element:a.jsx(Dz,{})}),a.jsx(Ye,{path:"roles",element:a.jsx(kte,{children:a.jsx(Rz,{})})})]}),a.jsx(Ye,{path:"*",element:a.jsx(Zn,{to:"/",replace:!0})})]})}window.__React=W;window.__ReactJsxRuntime=wO;const Pte=new jO({defaultOptions:{queries:{staleTime:1e3*30,retry:1}}});(async()=>{let e=[];try{const r=await import("/admin-extensions.js");Array.isArray(r==null?void 0:r.default)&&(e=r.default)}catch{}d1(document.getElementById("root")).render(a.jsx(h.StrictMode,{children:a.jsx(e5,{widgets:[...F5,...e],children:a.jsx(yA,{children:a.jsxs(NO,{client:Pte,children:[a.jsx(bA,{children:a.jsx(wA,{children:a.jsx(_O,{children:a.jsxs(Du,{delayDuration:300,children:[a.jsx(Mte,{}),a.jsx(lA,{position:"bottom-right",toastOptions:{classNames:{toast:"bg-white dark:bg-card border border-border text-foreground text-sm rounded-lg shadow-sm",description:"text-muted-foreground"}}})]})})})}),a.jsx(IE,{initialIsOpen:!1})]})})})}))})();export{Ie as A,ne as B,of as C,Qp as D,lte as G,tS as I,ut as P,zZ as R,_r as W,u1 as _,Hr as a,Ha as b,Ch as c,Gl as d,Mo as e,fe as f,Po as g,jx as h,W4 as i,Nx as j,_s as k,nte as l,ph as m,hh as n,cte as o,tte as p,ote as q,xh as r,WN as s,wj as t,rN as u,pO as v,dte as w,U as x,Tt as y,oe as z};