@meridianjs/admin-dashboard 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/ProjectTimelinePage-CpMsZyRM.js +1 -0
- package/dist/assets/WorkspaceReportingPage-JQfr6bSh.js +1 -0
- package/dist/assets/index-CpG8Mt5c.css +1 -0
- package/dist/assets/index-PJTvPCLS.js +619 -0
- package/dist/assets/{vendor-dnd-6EGxH1Lf.js → vendor-dnd-B31T8w2X.js} +1 -1
- package/dist/assets/{vendor-editor-BmhD0BxF.js → vendor-editor-BoEtjgAn.js} +1 -1
- package/dist/assets/{vendor-query-DtBTlSlq.js → vendor-query-CaIGp3JB.js} +1 -1
- package/dist/assets/{vendor-radix-Bj-t5iGX.js → vendor-radix-CeigSZIw.js} +1 -1
- package/dist/assets/{vendor-react-aoclG454.js → vendor-react-Lycsri1F.js} +1 -1
- package/dist/index.html +7 -7
- package/package.json +1 -1
- package/dist/assets/ProjectTimelinePage-CND6RpOG.js +0 -1
- package/dist/assets/WorkspaceReportingPage-B3aVl4VS.js +0 -1
- package/dist/assets/index-CX9BzWjk.js +0 -614
- package/dist/assets/index-D5vyNUoI.css +0 -1
|
@@ -1,614 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectTimelinePage-CND6RpOG.js","assets/vendor-query-DtBTlSlq.js","assets/vendor-react-aoclG454.js","assets/vendor-radix-Bj-t5iGX.js","assets/vendor-dnd-6EGxH1Lf.js","assets/vendor-editor-BmhD0BxF.js","assets/WorkspaceReportingPage-B3aVl4VS.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var GP=Object.defineProperty;var VP=(e,t,r)=>t in e?GP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var am=(e,t,r)=>VP(e,typeof t!="symbol"?t+"":t,r);import{j as a,u as We,a as Se,b as be,R as XP,Q as QP,c as ZP}from"./vendor-query-DtBTlSlq.js";import{a as Op,c as I,r as h,b as JP,u as Vt,d as vu,N as oa,e as St,L as Yr,O as Al,f as Dl,g as Oa,R as eM,h as jc,i as tM,j as Ke,k as Xa,B as rM}from"./vendor-react-aoclG454.js";import{C as mj,R as nM,T as aM,P as sM,S as Pp,a as hj,O as ai,b as Tl,c as si,d as yu,e as Qi,D as Zi,f as Il,g as pj,h as gj,i as iM,j as xj,I as vj,k as yj,l as bj,m as wj,L as jj,n as Nj,o as oM,p as lM,q as kj,r as Sj,F as Cj,u as Oi,t as os,s as cM,v as _j,w as Oj,x as dM,y as Pj,z as Mj,A as uM,B as Ej,V as fM,E as Aj,G as Dj,H as mM,J as hM,K as Tj,M as pM,N as gM,Q as xM,U as Ij,W as vM,X as yM,Y as Rj,Z as bu,_ as bM,$ as ks,a0 as wM,a1 as jM,a2 as $j,a3 as NM,a4 as kM,a5 as zj,a6 as SM,a7 as CM,a8 as Lj,a9 as _M,aa as OM,ab as PM,ac as MM,ad as EM,ae as AM,af as DM,ag as TM,ah as IM,ai as RM,aj as $M,ak as Fj,al as zM,am as LM,an as FM,ao as BM,ap as WM,aq as UM}from"./vendor-radix-Bj-t5iGX.js";import{u as Bj,a as Mp,P as Wj,D as al,S as Ep,h as Uj,b as td,c as Ap,C as Dp,d as qM,v as HM,r as KM,e as YM,f as GM,M as VM,g as qj}from"./vendor-dnd-6EGxH1Lf.js";import{P as Hj,a as XM,D as QM,b as ZM,e as JM,N as eE,c as tE,d as rE,m as Nc,E as nE,u as Kj,i as Yj,f as Gj,g as Vj,h as Xj,j as aE,k as sE,w as iE}from"./vendor-editor-BmhD0BxF.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 Qj,kv=Op;Qj=kv.createRoot,kv.hydrateRoot;const oE="modulepreload",lE=function(e){return"/"+e},Sv={},Zj=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=lE(c),c in Sv)return;Sv[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":oE,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 cE=function(){return null},dE=e=>{switch(e){case"success":return mE;case"info":return pE;case"warning":return hE;case"error":return gE;default:return null}},uE=Array(12).fill(0),fE=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},uE.map((r,n)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),mE=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),hE=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),pE=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),gE=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),xE=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vE=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},lh=1,yE=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:lh++,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],I.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(wE(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)||lh++;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}},Er=new yE,bE=(e,t)=>{let r=(t==null?void 0:t.id)||lh++;return Er.addToast({title:e,...t,id:r}),r},wE=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jE=bE,NE=()=>Er.toasts,kE=()=>Er.getActiveToasts(),L=Object.assign(jE,{success:Er.success,info:Er.info,warning:Er.warning,error:Er.error,custom:Er.custom,message:Er.message,promise:Er.promise,dismiss:Er.dismiss,loading:Er.loading},{getHistory:NE,getToasts:kE});function SE(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))}SE(`: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 kc(e){return e.label!==void 0}var CE=3,_E="32px",OE="16px",Cv=4e3,PE=356,ME=14,EE=20,AE=200;function pn(...e){return e.filter(Boolean).join(" ")}function DE(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var TE=e=>{var t,r,n,s,i,o,l,c,d,u,f;let{invert:m,toast:p,unstyled:g,interacting:x,setHeights:v,visibleToasts:y,heights:w,index:N,toasts:j,expanded:k,removeToast:b,defaultRichColors:C,closeButton:S,style:_,cancelButtonStyle:A,actionButtonStyle:M,className:P="",descriptionClassName:T="",duration:D,position:B,gap:E,loadingIcon:z,expandByDefault:Q,classNames:K,icons:se,closeButtonAriaLabel:te="Close toast",pauseWhenPageIsHidden:U}=e,[G,J]=I.useState(null),[X,O]=I.useState(null),[F,ae]=I.useState(!1),[W,q]=I.useState(!1),[le,Z]=I.useState(!1),[de,V]=I.useState(!1),[oe,pe]=I.useState(!1),[we,_e]=I.useState(0),[H,ve]=I.useState(0),De=I.useRef(p.duration||D||Cv),He=I.useRef(null),Fe=I.useRef(null),Qe=N===0,gt=N+1<=y,Ge=p.type,Ze=p.dismissible!==!1,pr=p.className||"",mn=p.descriptionClassName||"",Pr=I.useMemo(()=>w.findIndex(ie=>ie.toastId===p.id)||0,[w,p.id]),hn=I.useMemo(()=>{var ie;return(ie=p.closeButton)!=null?ie:S},[p.closeButton,S]),gr=I.useMemo(()=>p.duration||D||Cv,[p.duration,D]),Ct=I.useRef(0),Rt=I.useRef(0),qt=I.useRef(0),er=I.useRef(null),[Mn,ta]=B.split("-"),Pe=I.useMemo(()=>w.reduce((ie,Ce,Te)=>Te>=Pr?ie:ie+Ce.height,0),[w,Pr]),me=vE(),ye=p.invert||m,fe=Ge==="loading";Rt.current=I.useMemo(()=>Pr*E+Pe,[Pr,Pe]),I.useEffect(()=>{De.current=gr},[gr]),I.useEffect(()=>{ae(!0)},[]),I.useEffect(()=>{let ie=Fe.current;if(ie){let Ce=ie.getBoundingClientRect().height;return ve(Ce),v(Te=>[{toastId:p.id,height:Ce,position:p.position},...Te]),()=>v(Te=>Te.filter(xt=>xt.toastId!==p.id))}},[v,p.id]),I.useLayoutEffect(()=>{if(!F)return;let ie=Fe.current,Ce=ie.style.height;ie.style.height="auto";let Te=ie.getBoundingClientRect().height;ie.style.height=Ce,ve(Te),v(xt=>xt.find(tt=>tt.toastId===p.id)?xt.map(tt=>tt.toastId===p.id?{...tt,height:Te}:tt):[{toastId:p.id,height:Te,position:p.position},...xt])},[F,p.title,p.description,v,p.id]);let ge=I.useCallback(()=>{q(!0),_e(Rt.current),v(ie=>ie.filter(Ce=>Ce.toastId!==p.id)),setTimeout(()=>{b(p)},AE)},[p,b,v,Rt]);I.useEffect(()=>{if(p.promise&&Ge==="loading"||p.duration===1/0||p.type==="loading")return;let ie;return k||x||U&&me?(()=>{if(qt.current<Ct.current){let Ce=new Date().getTime()-Ct.current;De.current=De.current-Ce}qt.current=new Date().getTime()})():De.current!==1/0&&(Ct.current=new Date().getTime(),ie=setTimeout(()=>{var Ce;(Ce=p.onAutoClose)==null||Ce.call(p,p),ge()},De.current)),()=>clearTimeout(ie)},[k,x,p,Ge,U,me,ge]),I.useEffect(()=>{p.delete&&ge()},[ge,p.delete]);function Ve(){var ie,Ce,Te;return se!=null&&se.loading?I.createElement("div",{className:pn(K==null?void 0:K.loader,(ie=p==null?void 0:p.classNames)==null?void 0:ie.loader,"sonner-loader"),"data-visible":Ge==="loading"},se.loading):z?I.createElement("div",{className:pn(K==null?void 0:K.loader,(Ce=p==null?void 0:p.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":Ge==="loading"},z):I.createElement(fE,{className:pn(K==null?void 0:K.loader,(Te=p==null?void 0:p.classNames)==null?void 0:Te.loader),visible:Ge==="loading"})}return I.createElement("li",{tabIndex:0,ref:Fe,className:pn(P,pr,K==null?void 0:K.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[Ge],(r=p==null?void 0:p.classNames)==null?void 0:r[Ge]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:C,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":F,"data-promise":!!p.promise,"data-swiped":oe,"data-removed":W,"data-visible":gt,"data-y-position":Mn,"data-x-position":ta,"data-index":N,"data-front":Qe,"data-swiping":le,"data-dismissible":Ze,"data-type":Ge,"data-invert":ye,"data-swipe-out":de,"data-swipe-direction":X,"data-expanded":!!(k||Q&&F),style:{"--index":N,"--toasts-before":N,"--z-index":j.length-N,"--offset":`${W?we:Rt.current}px`,"--initial-height":Q?"auto":`${H}px`,..._,...p.style},onDragEnd:()=>{Z(!1),J(null),er.current=null},onPointerDown:ie=>{fe||!Ze||(He.current=new Date,_e(Rt.current),ie.target.setPointerCapture(ie.pointerId),ie.target.tagName!=="BUTTON"&&(Z(!0),er.current={x:ie.clientX,y:ie.clientY}))},onPointerUp:()=>{var ie,Ce,Te,xt;if(de||!Ze)return;er.current=null;let tt=Number(((ie=Fe.current)==null?void 0:ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rt=Number(((Ce=Fe.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xr=new Date().getTime()-((Te=He.current)==null?void 0:Te.getTime()),tr=G==="x"?tt:rt,En=Math.abs(tr)/xr;if(Math.abs(tr)>=EE||En>.11){_e(Rt.current),(xt=p.onDismiss)==null||xt.call(p,p),O(G==="x"?tt>0?"right":"left":rt>0?"down":"up"),ge(),V(!0),pe(!1);return}Z(!1),J(null)},onPointerMove:ie=>{var Ce,Te,xt,tt;if(!er.current||!Ze||((Ce=window.getSelection())==null?void 0:Ce.toString().length)>0)return;let rt=ie.clientY-er.current.y,xr=ie.clientX-er.current.x,tr=(Te=e.swipeDirections)!=null?Te:DE(B);!G&&(Math.abs(xr)>1||Math.abs(rt)>1)&&J(Math.abs(xr)>Math.abs(rt)?"x":"y");let En={x:0,y:0};G==="y"?(tr.includes("top")||tr.includes("bottom"))&&(tr.includes("top")&&rt<0||tr.includes("bottom")&&rt>0)&&(En.y=rt):G==="x"&&(tr.includes("left")||tr.includes("right"))&&(tr.includes("left")&&xr<0||tr.includes("right")&&xr>0)&&(En.x=xr),(Math.abs(En.x)>0||Math.abs(En.y)>0)&&pe(!0),(xt=Fe.current)==null||xt.style.setProperty("--swipe-amount-x",`${En.x}px`),(tt=Fe.current)==null||tt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},hn&&!p.jsx?I.createElement("button",{"aria-label":te,"data-disabled":fe,"data-close-button":!0,onClick:fe||!Ze?()=>{}:()=>{var ie;ge(),(ie=p.onDismiss)==null||ie.call(p,p)},className:pn(K==null?void 0:K.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=se==null?void 0:se.close)!=null?i:xE):null,p.jsx||h.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:I.createElement(I.Fragment,null,Ge||p.icon||p.promise?I.createElement("div",{"data-icon":"",className:pn(K==null?void 0:K.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||(se==null?void 0:se[Ge])||dE(Ge):null):null,I.createElement("div",{"data-content":"",className:pn(K==null?void 0:K.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},I.createElement("div",{"data-title":"",className:pn(K==null?void 0:K.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?I.createElement("div",{"data-description":"",className:pn(T,mn,K==null?void 0:K.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&&kc(p.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:ie=>{var Ce,Te;kc(p.cancel)&&Ze&&((Te=(Ce=p.cancel).onClick)==null||Te.call(Ce,ie),ge())},className:pn(K==null?void 0:K.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&&kc(p.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||M,onClick:ie=>{var Ce,Te;kc(p.action)&&((Te=(Ce=p.action).onClick)==null||Te.call(Ce,ie),!ie.defaultPrevented&&ge())},className:pn(K==null?void 0:K.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function _v(){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 IE(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",l=i?OE:_E;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 RE=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:g=CE,toastOptions:x,dir:v=_v(),gap:y=ME,loadingIcon:w,icons:N,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:k}=e,[b,C]=I.useState([]),S=I.useMemo(()=>Array.from(new Set([n].concat(b.filter(U=>U.position).map(U=>U.position)))),[b,n]),[_,A]=I.useState([]),[M,P]=I.useState(!1),[T,D]=I.useState(!1),[B,E]=I.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=I.useRef(null),Q=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=I.useRef(null),se=I.useRef(!1),te=I.useCallback(U=>{C(G=>{var J;return(J=G.find(X=>X.id===U.id))!=null&&J.delete||Er.dismiss(U.id),G.filter(({id:X})=>X!==U.id)})},[]);return I.useEffect(()=>Er.subscribe(U=>{if(U.dismiss){C(G=>G.map(J=>J.id===U.id?{...J,delete:!0}:J));return}setTimeout(()=>{JP.flushSync(()=>{C(G=>{let J=G.findIndex(X=>X.id===U.id);return J!==-1?[...G.slice(0,J),{...G[J],...U},...G.slice(J+1)]:[U,...G]})})})}),[]),I.useEffect(()=>{if(u!=="system"){E(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:G})=>{E(G?"dark":"light")})}catch{U.addListener(({matches:J})=>{try{E(J?"dark":"light")}catch(X){console.error(X)}})}},[u]),I.useEffect(()=>{b.length<=1&&P(!1)},[b]),I.useEffect(()=>{let U=G=>{var J,X;s.every(O=>G[O]||G.code===O)&&(P(!0),(J=z.current)==null||J.focus()),G.code==="Escape"&&(document.activeElement===z.current||(X=z.current)!=null&&X.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[s]),I.useEffect(()=>{if(z.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,se.current=!1)}},[z.current]),I.createElement("section",{ref:t,"aria-label":`${j} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((U,G)=>{var J;let[X,O]=U.split("-");return b.length?I.createElement("ol",{key:U,dir:v==="auto"?_v():v,tabIndex:-1,ref:z,className:l,"data-sonner-toaster":!0,"data-theme":B,"data-y-position":X,"data-lifted":M&&b.length>1&&!i,"data-x-position":O,style:{"--front-toast-height":`${((J=_[0])==null?void 0:J.height)||0}px`,"--width":`${PE}px`,"--gap":`${y}px`,...p,...IE(c,d)},onBlur:F=>{se.current&&!F.currentTarget.contains(F.relatedTarget)&&(se.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||se.current||(se.current=!0,K.current=F.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{T||P(!1)},onDragEnd:()=>P(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},b.filter(F=>!F.position&&G===0||F.position===U).map((F,ae)=>{var W,q;return I.createElement(TE,{key:F.id,icons:N,index:ae,toast:F,defaultRichColors:f,duration:(W=x==null?void 0:x.duration)!=null?W:m,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:g,closeButton:(q=x==null?void 0:x.closeButton)!=null?q:o,interacting:T,position:U,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:te,toasts:b.filter(le=>le.position==F.position),heights:_.filter(le=>le.position==F.position),setHeights:A,expandByDefault:i,gap:y,loadingIcon:w,expanded:M,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))}),$E=(e,t,r,n,s,i,o,l)=>{let c=document.documentElement,d=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(g=>{let x=g==="class",v=x&&i?s.map(y=>i[y]||y):s;x?(c.classList.remove(...v),c.classList.add(i&&i[p]?i[p]:p)):c.setAttribute(g,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,g=o&&p==="system"?m():p;u(g)}catch{}},Ov=["light","dark"],Jj="(prefers-color-scheme: dark)",zE=typeof window>"u",Tp=h.createContext(void 0),LE={setTheme:e=>{},themes:[]},FE=()=>{var e;return(e=h.useContext(Tp))!=null?e:LE},BE=e=>h.useContext(Tp)?h.createElement(h.Fragment,null,e.children):h.createElement(UE,{...e}),WE=["light","dark"],UE=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:i=WE,defaultTheme:o=r?"system":"light",attribute:l="data-theme",value:c,children:d,nonce:u,scriptProps:f})=>{let[m,p]=h.useState(()=>HE(s,o)),[g,x]=h.useState(()=>m==="system"?sm():m),v=c?Object.values(c):i,y=h.useCallback(k=>{let b=k;if(!b)return;k==="system"&&r&&(b=sm());let C=c?c[b]:b,S=t?KE(u):null,_=document.documentElement,A=M=>{M==="class"?(_.classList.remove(...v),C&&_.classList.add(C)):M.startsWith("data-")&&(C?_.setAttribute(M,C):_.removeAttribute(M))};if(Array.isArray(l)?l.forEach(A):A(l),n){let M=Ov.includes(o)?o:null,P=Ov.includes(b)?b:M;_.style.colorScheme=P}S==null||S()},[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=sm(k);x(b),m==="system"&&r&&!e&&y("system")},[m,e]);h.useEffect(()=>{let k=window.matchMedia(Jj);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"?g:m,themes:r?[...i,"system"]:i,systemTheme:r?g:void 0}),[m,w,e,g,r,i]);return h.createElement(Tp.Provider,{value:j},h.createElement(qE,{forcedTheme:e,storageKey:s,attribute:l,enableSystem:r,enableColorScheme:n,defaultTheme:o,value:c,themes:i,nonce:u,scriptProps:f}),d)},qE=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:`(${$E.toString()})(${u})`}})}),HE=(e,t)=>{if(zE)return;let r;try{r=localStorage.getItem(e)||void 0}catch{}return r||t},KE=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)}},sm=e=>(e||(e=window.matchMedia(Jj)),e.matches?"dark":"light");function YE({children:e}){return a.jsx(BE,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:e})}const e1=h.createContext(null),ps="meridian_token",Co="meridian_user",Sc="meridian_workspace";function Pv(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 GE({children:e}){const[t,r]=h.useState(()=>{try{const f=localStorage.getItem(Co),m=localStorage.getItem(ps);if(!f)return null;const p=JSON.parse(f),{roles:g,permissions:x}=m?Pv(m):{roles:[],permissions:[]};return p.roles=g,p.permissions=x,p}catch{return null}}),[n,s]=h.useState(()=>{const f=localStorage.getItem(ps),m=localStorage.getItem(Co);return f&&!m?(localStorage.removeItem(ps),null):f}),[i,o]=h.useState(()=>{try{const f=localStorage.getItem(Sc);return f?JSON.parse(f):null}catch{return null}}),l=(f,m)=>{const{roles:p,permissions:g}=Pv(m),x={...f,roles:p,permissions:g};r(x),s(m),localStorage.setItem(ps,m),localStorage.setItem(Co,JSON.stringify(x))},c=()=>{const f=localStorage.getItem(ps);f&&fetch("/auth/logout",{method:"POST",headers:{Authorization:`Bearer ${f}`,"Content-Type":"application/json"}}).catch(()=>{}),r(null),s(null),o(null),localStorage.removeItem(ps),localStorage.removeItem(Co),localStorage.removeItem(Sc)};h.useEffect(()=>{const f=()=>{localStorage.getItem(ps)&&c()};return window.addEventListener("meridian:unauthorized",f),()=>window.removeEventListener("meridian:unauthorized",f)},[]);const d=f=>{o(f),f?localStorage.setItem(Sc,JSON.stringify(f)):localStorage.removeItem(Sc)},u=f=>{r(m=>{if(!m)return m;const p={...m,...f};return localStorage.setItem(Co,JSON.stringify(p)),p})};return a.jsx(e1.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(e1);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const t1=h.createContext(null);function VE({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(t1.Provider,{value:{open:t,setOpen:r,toggle:()=>r(n=>!n)},children:e})}function r1(){const e=h.useContext(t1);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}function n1(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=n1(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function st(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=n1(e))&&(n&&(n+=" "),n+=t);return n}const Ip="-",XE=e=>{const t=ZE(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Ip);return l[0]===""&&l.length!==1&&l.shift(),a1(l,t)||QE(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},a1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?a1(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Ip);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},Mv=/^\[(.+)\]$/,QE=e=>{if(Mv.test(e)){const t=Mv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},ZE=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return eA(Object.entries(e.classGroups),r).forEach(([i,o])=>{ch(o,n,i,t)}),n},ch=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Ev(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(JE(s)){ch(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{ch(o,Ev(t,i),r,n)})})},Ev=(e,t)=>{let r=e;return t.split(Ip).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},JE=e=>e.isThemeGetter,eA=(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,tA=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)}}},s1="!",rA=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(s1),g=p?m.substring(1):m,x=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}};return r?l=>r({className:l,parseClassName:o}):o},nA=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},aA=e=>({cache:tA(e.cacheSize),parseClassName:rA(e),...XE(e)}),sA=/\s+/,iA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(sA);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 g=!!p,x=n(g?m.substring(0,p):m);if(!x){if(!g){l=d+(l.length>0?" "+l:l);continue}if(x=n(m),!x){l=d+(l.length>0?" "+l:l);continue}g=!1}const v=nA(u).join(":"),y=f?v+s1:v,w=y+x;if(i.includes(w))continue;i.push(w);const N=s(x,g);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 oA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=i1(t))&&(n&&(n+=" "),n+=r);return n}const i1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=i1(e[n]))&&(r&&(r+=" "),r+=t);return r};function lA(e,...t){let r,n,s,i=o;function o(c){const d=t.reduce((u,f)=>f(u),e());return r=aA(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=iA(c,r);return s(c,u),u}return function(){return i(oA.apply(null,arguments))}}const dt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},o1=/^\[(?:([a-z-]+):)?(.+)\]$/i,cA=/^\d+\/\d+$/,dA=new Set(["px","full","screen"]),uA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fA=/\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$/,mA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aa=e=>Pi(e)||dA.has(e)||cA.test(e),Ua=e=>Ji(e,"length",NA),Pi=e=>!!e&&!Number.isNaN(Number(e)),im=e=>Ji(e,"number",Pi),_o=e=>!!e&&Number.isInteger(Number(e)),gA=e=>e.endsWith("%")&&Pi(e.slice(0,-1)),Re=e=>o1.test(e),qa=e=>uA.test(e),xA=new Set(["length","size","percentage"]),vA=e=>Ji(e,xA,l1),yA=e=>Ji(e,"position",l1),bA=new Set(["image","url"]),wA=e=>Ji(e,bA,SA),jA=e=>Ji(e,"",kA),Oo=()=>!0,Ji=(e,t,r)=>{const n=o1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},NA=e=>fA.test(e)&&!mA.test(e),l1=()=>!1,kA=e=>hA.test(e),SA=e=>pA.test(e),CA=()=>{const e=dt("colors"),t=dt("spacing"),r=dt("blur"),n=dt("brightness"),s=dt("borderColor"),i=dt("borderRadius"),o=dt("borderSpacing"),l=dt("borderWidth"),c=dt("contrast"),d=dt("grayscale"),u=dt("hueRotate"),f=dt("invert"),m=dt("gap"),p=dt("gradientColorStops"),g=dt("gradientColorStopPositions"),x=dt("inset"),v=dt("margin"),y=dt("opacity"),w=dt("padding"),N=dt("saturate"),j=dt("scale"),k=dt("sepia"),b=dt("skew"),C=dt("space"),S=dt("translate"),_=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Re,t],P=()=>[Re,t],T=()=>["",aa,Ua],D=()=>["auto",Pi,Re],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],E=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Re],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>[Pi,Re];return{cacheSize:500,separator:":",theme:{colors:[Oo],spacing:[aa,Ua],blur:["none","",qa,Re],brightness:te(),borderColor:[e],borderRadius:["none","","full",qa,Re],borderSpacing:P(),borderWidth:T(),contrast:te(),grayscale:K(),hueRotate:te(),invert:K(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[gA,Ua],inset:M(),margin:M(),opacity:te(),padding:P(),saturate:te(),scale:te(),sepia:K(),skew:te(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[qa]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"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:[...B(),Re]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_o,Re]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",_o,Re]}],"grid-cols":[{"grid-cols":[Oo]}],"col-start-end":[{col:["auto",{span:["full",_o,Re]},Re]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Oo]}],"row-start-end":[{row:["auto",{span:[_o,Re]},Re]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[qa]},qa]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qa,Ua]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",im]}],"font-family":[{font:[Oo]}],"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",Re]}],"line-clamp":[{"line-clamp":["none",Pi,im]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",aa,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"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:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",aa,Ua]}],"underline-offset":[{"underline-offset":["auto",aa,Re]}],"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:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],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",Re]}],"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:[...B(),yA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"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:[...E(),"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:E()}],"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:["",...E()]}],"outline-offset":[{"outline-offset":[aa,Re]}],"outline-w":[{outline:[aa,Ua]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[aa,Ua]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qa,jA]}],"shadow-color":[{shadow:[Oo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",qa,Re]}],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",Re]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[_o,Re]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"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",Re]}],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",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[aa,Ua,im]}],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"]}}},_A=lA(CA);function R(...e){return _A(st(e))}const wu=sM,Qa=nM,Za=aM,pa=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(mj,{ref:n,sideOffset:t,className:R("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}));pa.displayName=mj.displayName;const c1=h.createContext([]);function OA({widgets:e,children:t}){return I.createElement(c1.Provider,{value:e},t)}function PA(e){return h.useContext(c1).filter(r=>r.zone===e).map(r=>r.component)}var uj;const Ti=((uj=window.__MERIDIAN_CONFIG__)==null?void 0:uj.apiUrl)??void 0??"";class Rp extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n,this.name="ApiError"}}function d1(){return localStorage.getItem("meridian_token")}async function Po(e,t={}){var i;const r=d1(),n={"Content-Type":"application/json",...t.headers};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ti}${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 Rp(s.status,l,o)}if(s.status!==204)return s.json()}const re={get:e=>Po(e,{method:"GET"}),post:(e,t)=>Po(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Po(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Po(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Po(e,{method:"DELETE"}),upload:async(e,t)=>{var i;const r=d1(),n={};r&&(n.Authorization=`Bearer ${r}`);const s=await fetch(`${Ti}${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 Rp(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 Rl(e,t){return We({queryKey:e?Tt.byProject(e,t):Tt.all,queryFn:()=>{var n,s,i;const r=new URLSearchParams;return e&&r.set("project_id",e),(n=t==null?void 0:t.priority)!=null&&n.length&&r.set("priority",t.priority.join(",")),t!=null&&t.assignee_id&&r.set("assignee_id",t.assignee_id),(s=t==null?void 0:t.type)!=null&&s.length&&r.set("type",t.type.join(",")),(i=t==null?void 0:t.status)!=null&&i.length&&r.set("status",t.status.join(",")),re.get(`/admin/issues?${r}`)},select:r=>r.issues,enabled:e!==void 0?!!e:!0})}function u1(e){return We({queryKey:Tt.detail(e),queryFn:()=>re.get(`/admin/issues/${e}`),select:t=>t.issue,enabled:!!e})}function MA(e){return We({queryKey:Tt.comments(e),queryFn:()=>re.get(`/admin/issues/${e}/comments`),select:t=>t.comments,enabled:!!e})}function f1(){const e=Se();return be({mutationFn:t=>re.post("/admin/issues",t),onSuccess:(t,r)=>{e.invalidateQueries({queryKey:Tt.byProject(r.project_id)})}})}function ju(e,t){const r=Se();return be({mutationFn:n=>re.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 EA(e){return We({queryKey:Tt.activities(e),queryFn:()=>re.get(`/admin/issues/${e}/activities`),select:t=>t.activities,enabled:!!e})}function AA(e){const t=Se();return be({mutationFn:({body:r,metadata:n})=>re.post(`/admin/issues/${e}/comments`,{body:r,metadata:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Tt.comments(e)})}})}const Av=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dv=st,$l=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Dv(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=Av(u)||Av(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(g=>{let[x,v]=g;return Array.isArray(v)?v.includes({...i,...l}[x]):{...i,...l}[x]===v})?[...d,f,m]:d},[]);return Dv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)},Mi=$l("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"}}),ee=h.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const o=n?Pp:"button";return a.jsx(o,{className:R(Mi({variant:t,size:r,className:e})),ref:i,...s})});ee.displayName="Button";const Ae=h.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:R("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}));Ae.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 DA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=(...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 TA={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 IA=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,...TA,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:m1("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 ne=(e,t)=>{const r=h.forwardRef(({className:n,...s},i)=>h.createElement(IA,{ref:i,iconNode:t,className:m1(`lucide-${DA(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 Nu=ne("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 zl=ne("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 Ll=ne("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 $p=ne("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 Fl=ne("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 Ii=ne("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 h1=ne("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 p1=ne("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 RA=ne("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 g1=ne("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 eo=ne("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 mr=ne("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 $A=ne("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 rs=ne("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 zA=ne("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 ir=ne("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 Vn=ne("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 ku=ne("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 _n=ne("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 zp=ne("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 to=ne("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 ls=ne("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 x1=ne("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 Lp=ne("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 sn=ne("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 LA=ne("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 Xn=ne("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 v1=ne("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 y1=ne("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 Fp=ne("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 FA=ne("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 Bp=ne("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 cs=ne("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 b1=ne("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 Bl=ne("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 ii=ne("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 BA=ne("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 WA=ne("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 UA=ne("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 qA=ne("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 HA=ne("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 Wp=ne("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 ga=ne("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 dh=ne("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 w1=ne("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 KA=ne("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 YA=ne("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 GA=ne("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 j1=ne("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 VA=ne("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 Rr=ne("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 ud=ne("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 XA=ne("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"}]]);/**
|
|
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 Wl=ne("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"}]]);/**
|
|
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 QA=ne("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"}]]);/**
|
|
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 N1=ne("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"}]]);/**
|
|
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 jn=ne("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"}]]);/**
|
|
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 k1=ne("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"}]]);/**
|
|
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 ro=ne("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"}]]);/**
|
|
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 Su=ne("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"}]]);/**
|
|
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 ZA=ne("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"}]]);/**
|
|
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 S1=ne("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"}]]);/**
|
|
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 oi=ne("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
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 JA=ne("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 eD=ne("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
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 tD=ne("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 Up=ne("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 Ls=ne("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 Cu=ne("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 ct=ne("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 rD=ne("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 nD=ne("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 ol=ne("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 Ul=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 aD=ne("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"}]]);/**
|
|
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 qp=ne("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"}]]);/**
|
|
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 Hp=ne("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"}]]);/**
|
|
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 sD=ne("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"}]]);/**
|
|
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 iD=ne("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"}]]);/**
|
|
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 uh=ne("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"}]]);/**
|
|
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 C1=ne("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"}]]);/**
|
|
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 _1=ne("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"}]]);/**
|
|
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 oD=ne("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 O1=ne("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"}]]);/**
|
|
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 lD=ne("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"}]]);/**
|
|
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 cD=ne("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"}]]);/**
|
|
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 dD=ne("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"}]]);/**
|
|
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 uD=ne("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"}]]);/**
|
|
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 fD=ne("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"}]]);/**
|
|
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 $r=ne("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"}]]);/**
|
|
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 mD=ne("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"}]]);/**
|
|
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 hD=ne("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
|
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 pD=ne("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"}]]);/**
|
|
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 gD=ne("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"}]]);/**
|
|
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 P1=ne("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"}]]);/**
|
|
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 no=ne("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"}]]);/**
|
|
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 xD=ne("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
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 vD=ne("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"}]]);/**
|
|
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 _u=ne("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"}]]);/**
|
|
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 Fs=ne("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"}]]);/**
|
|
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 da=ne("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"}]]);/**
|
|
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 at=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 ds=ne("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 yD({issue:e}){const t=ju(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:()=>{L.success("Metadata saved"),n(""),i(""),l(!1)},onError:()=>L.error("Failed to save metadata")})},f=m=>{const p={...c};delete p[m],t.mutate({metadata:Object.keys(p).length?p:null},{onSuccess:()=>L.success("Entry removed"),onError:()=>L.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(FA,{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(ct,{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($r,{className:"h-3 w-3"})})]},m)),o&&a.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[a.jsx(Ae,{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(Ae,{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(ee,{size:"sm",className:"h-7 px-2 text-xs",onClick:u,disabled:!r.trim()||t.isPending,children:"Save"}),a.jsx(ee,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>{l(!1),n(""),i("")},children:"Cancel"})]})]})]})}const bD=[{zone:"issue.details.after",component:yD}];function Ou(e=!0){return We({queryKey:["workspaces"],queryFn:()=>re.get("/admin/workspaces"),select:t=>t.workspaces,enabled:e})}function wD(){const e=Se();return be({mutationFn:t=>re.post("/admin/workspaces",t),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]})}})}function jD(e){const t=Se();return be({mutationFn:r=>re.put(`/admin/workspaces/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:["workspaces"]})}})}function ND(e){const t=Se();return be({mutationFn:r=>{const n=new FormData;return n.append("logo",r),re.upload(`/admin/workspaces/${e}/logo`,n)},onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}function kD(e){const t=Se();return be({mutationFn:()=>re.delete(`/admin/workspaces/${e}/logo`),onSuccess:()=>t.invalidateQueries({queryKey:["workspaces"]})})}const Kp={list:e=>["workspaces",e,"invitations"]};function SD(e){return We({queryKey:Kp.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/invitations`),select:t=>t.invitations,enabled:!!e})}function CD(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/workspaces/${e}/invitations`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Kp.list(e)})}})}function _D(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/workspaces/${e}/invitations/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Kp.list(e)})}})}const Yp={list:e=>["workspaces",e,"members"]};function ql(e){return We({queryKey:Yp.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/members`),select:t=>t.members,enabled:!!e})}function OD(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/workspaces/${e}/members`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Yp.list(e)})}})}function PD(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/workspaces/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Yp.list(e)})}})}const ns={list:e=>["workspaces",e,"teams"],members:(e,t)=>["workspaces",e,"teams",t,"members"]};function Pu(e){return We({queryKey:ns.list(e),queryFn:()=>re.get(`/admin/workspaces/${e}/teams`),select:t=>t.teams,enabled:!!e})}function MD(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/workspaces/${e}/teams`,r),onSuccess:()=>{t.invalidateQueries({queryKey:ns.list(e)})}})}function ED(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/workspaces/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:ns.list(e)})}})}function AD(e,t){return We({queryKey:ns.members(e,t),queryFn:()=>re.get(`/admin/workspaces/${e}/teams/${t}/members`),select:r=>r.members,enabled:!!(e&&t)})}function DD(e,t){const r=Se();return be({mutationFn:n=>re.post(`/admin/workspaces/${e}/teams/${t}/members`,{user_id:n}),onSuccess:()=>{r.invalidateQueries({queryKey:ns.members(e,t)}),r.invalidateQueries({queryKey:ns.list(e)})}})}function TD(e,t){const r=Se();return be({mutationFn:n=>re.delete(`/admin/workspaces/${e}/teams/${t}/members/${n}`),onSuccess:()=>{r.invalidateQueries({queryKey:ns.members(e,t)}),r.invalidateQueries({queryKey:ns.list(e)})}})}function Mu(){return We({queryKey:["setup-status"],queryFn:()=>re.get("/auth/setup"),staleTime:6e4,retry:!1})}function ID(){const{login:e}=Ie();return be({mutationFn:t=>re.post("/auth/login",t),onSuccess:t=>{e(t.user,t.token)}})}function RD(){const{login:e}=Ie();return be({mutationFn:t=>re.post("/auth/register",t),onSuccess:t=>{e(t.user,t.token)}})}function $D(){return be({mutationFn:e=>re.post("/auth/forgot-password",e)})}function zD(){return be({mutationFn:e=>re.post("/auth/reset-password",e)})}function LD(e){const{login:t}=Ie();return be({mutationFn:r=>re.post(`/auth/invite/${e}`,r),onSuccess:r=>{t(r.user,r.token)}})}var fj;const FD=((fj=window.__MERIDIAN_CONFIG__)==null?void 0:fj.apiUrl)??void 0??"";function BD(e,t){const r=`${FD}/admin/events?token=${encodeURIComponent(e)}&workspaceId=${encodeURIComponent(t)}`;return new EventSource(r)}function WD(){const{token:e,workspace:t}=Ie(),r=Se(),n=h.useRef(null);h.useEffect(()=>{if(!e||!t)return;const s=BD(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.onerror=()=>{},()=>{s.close(),n.current=null}},[e,t==null?void 0:t.id,r])}const om=768;function UD(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const r=window.matchMedia(`(max-width: ${om-1}px)`),n=()=>{t(window.innerWidth<om)};return r.addEventListener("change",n),t(window.innerWidth<om),()=>r.removeEventListener("change",n)},[]),!!e}const ao=h.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>a.jsx(hj,{ref:s,decorative:r,orientation:t,className:R("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));ao.displayName=hj.displayName;const qD=Il,HD=Tl,M1=h.forwardRef(({className:e,...t},r)=>a.jsx(ai,{className:R("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}));M1.displayName=ai.displayName;const KD=$l("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"}}),E1=h.forwardRef(({side:e="right",className:t,children:r,...n},s)=>a.jsxs(HD,{children:[a.jsx(M1,{}),a.jsxs(si,{ref:s,className:R(KD({side:e}),t),...n,children:[r,a.jsxs(yu,{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(at,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));E1.displayName=si.displayName;const A1=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border",e),...t});A1.displayName="SheetHeader";const D1=h.forwardRef(({className:e,...t},r)=>a.jsx(Qi,{ref:r,className:R("text-base font-semibold text-foreground",e),...t}));D1.displayName=Qi.displayName;const T1=h.forwardRef(({className:e,...t},r)=>a.jsx(Zi,{ref:r,className:R("text-sm text-muted-foreground",e),...t}));T1.displayName=Zi.displayName;function ue({className:e,...t}){return a.jsx("div",{className:R("animate-pulse rounded-md bg-muted",e),...t})}const YD="sidebar_state",GD=60*60*24*7,VD="16rem",XD="18rem",QD="3rem",ZD="b",I1=h.createContext(null);function Gp(){const e=h.useContext(I1);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Eu({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=`${YD}=${w}; path=/; max-age=${GD}`},[r,m]),g=h.useCallback(()=>l?d(y=>!y):p(y=>!y),[l,p,d]);h.useEffect(()=>{const y=w=>{w.key===ZD&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[g]);const x=m?"expanded":"collapsed",v=h.useMemo(()=>({state:x,open:m,setOpen:p,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[x,m,p,l,c,d,g]);return a.jsx(I1.Provider,{value:v,children:a.jsx(wu,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":VD,"--sidebar-width-icon":QD,...s},className:R("group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex h-svh w-full",n),...o,children:i})})})}function Au({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...i}){const{isMobile:o,state:l,openMobile:c,setOpenMobile:d}=Gp();return r==="none"?a.jsx("div",{"data-slot":"sidebar",className:R("bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col",n),...i,children:s}):o?a.jsx(qD,{open:c,onOpenChange:d,...i,children:a.jsxs(E1,{"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":XD},side:e,children:[a.jsxs(A1,{className:"sr-only",children:[a.jsx(D1,{children:"Sidebar"}),a.jsx(T1,{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:R("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:R("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 Du({className:e,onClick:t,...r}){const{toggleSidebar:n}=Gp();return a.jsxs(ee,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:R("size-7",e),onClick:s=>{t==null||t(s),n()},...r,children:[a.jsx(eD,{}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Tu({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:R("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 Iu({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:R("flex flex-col gap-2 p-2",e),...t})}function Ru({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:R("flex flex-col gap-2 p-2",e),...t})}function Tv({className:e,...t}){return a.jsx(ao,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:R("bg-sidebar-border mx-2 w-auto",e),...t})}function $u({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:R("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function _s({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:R("relative flex w-full min-w-0 flex-col p-2",e),...t})}function Iv({className:e,asChild:t=!1,...r}){const n=t?Pp:"div";return a.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:R("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 Os({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:R("w-full text-sm",e),...t})}function br({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:R("flex w-full min-w-0 flex-col gap-1",e),...t})}function Dt({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:R("group/menu-item relative",e),...t})}const JD=$l("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"}}),_t=h.forwardRef(function({asChild:t=!1,isActive:r=!1,variant:n="default",size:s="default",tooltip:i,className:o,...l},c){const d=t?Pp:"button",{isMobile:u,state:f}=Gp(),m=a.jsx(d,{ref:c,"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:R(JD({variant:n,size:s}),o),...l});return i?(typeof i=="string"&&(i={children:i}),a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:m}),a.jsx(pa,{side:"right",align:"center",hidden:f!=="collapsed"||u,...i})]})):m});_t.displayName="SidebarMenuButton";const eT=250,tT=300,qr={all:["projects"],list:()=>[...qr.all,"list"],detail:e=>[...qr.all,e],byKey:e=>[...qr.all,"key",e],activities:e=>[...qr.all,e,"activities"]};function so(){const{workspace:e}=Ie();return We({queryKey:[...qr.list(),e==null?void 0:e.id],queryFn:()=>{const t=e!=null&&e.id?`?workspace_id=${e.id}`:"";return re.get(`/admin/projects${t}`)},select:t=>t.projects,enabled:!!(e!=null&&e.id)})}function Pa(e){return We({queryKey:qr.byKey(e),queryFn:()=>re.get(`/admin/projects/by-identifier/${encodeURIComponent(e)}`),select:t=>t.project,enabled:!!e})}function rT(e,t={}){const[r,n]=h.useState(e),s=t.enabled!==!1;return h.useEffect(()=>{if(!s)return;const l=setTimeout(()=>n(e),eT);return()=>clearTimeout(l)},[e,s]),{...We({queryKey:["projects","suggest-identifier",r],queryFn:()=>re.get(`/admin/projects/suggest-identifier?name=${encodeURIComponent(r)}`),select:l=>l.identifier,enabled:s&&r.trim().length>0}),flush:()=>n(e)}}function nT(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),tT);return()=>clearTimeout(l)},[r]);const o=We({queryKey:["projects","check-identifier",n],queryFn:()=>re.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 aT(){const e=Se();return be({mutationFn:t=>re.post("/admin/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:qr.list()})}})}function sT(){const e=Se();return be({mutationFn:t=>re.delete(`/admin/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:qr.list()})}})}function iT(e){const t=Se();return be({mutationFn:()=>re.post(`/admin/projects/${e}/share`,{}),onSuccess:()=>{t.invalidateQueries({queryKey:qr.detail(e)}),t.invalidateQueries({queryKey:qr.list()})}})}function oT(e){const t=Se();return be({mutationFn:()=>re.delete(`/admin/projects/${e}/share`),onSuccess:()=>{t.invalidateQueries({queryKey:qr.detail(e)}),t.invalidateQueries({queryKey:qr.list()})}})}function lT(e){return We({queryKey:qr.activities(e),queryFn:()=>re.get(`/admin/projects/${e}/activities`),select:t=>t.activities,enabled:!!e})}const Xr=oM,Qr=lM,cT=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(pj,{ref:s,className:R("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(_n,{className:"ml-auto"})]}));cT.displayName=pj.displayName;const dT=h.forwardRef(({className:e,...t},r)=>a.jsx(gj,{ref:r,className:R("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}));dT.displayName=gj.displayName;const zr=h.forwardRef(({className:e,sideOffset:t=4,...r},n)=>a.jsx(iM,{children:a.jsx(xj,{ref:n,sideOffset:t,className:R("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})}));zr.displayName=xj.displayName;const bt=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(vj,{ref:n,className:R("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}));bt.displayName=vj.displayName;const uT=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(yj,{ref:s,className:R("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(bj,{children:a.jsx(ir,{className:"h-4 w-4"})})}),t]}));uT.displayName=yj.displayName;const fT=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(wj,{ref:n,className:R("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(bj,{children:a.jsx(sn,{className:"h-2 w-2 fill-current"})})}),t]}));fT.displayName=wj.displayName;const Vp=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(jj,{ref:n,className:R("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r}));Vp.displayName=jj.displayName;const qn=h.forwardRef(({className:e,...t},r)=>a.jsx(Nj,{ref:r,className:R("-mx-1 my-1 h-px bg-border",e),...t}));qn.displayName=Nj.displayName;const Ft=h.forwardRef(({className:e,...t},r)=>a.jsx(kj,{ref:r,className:R("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full",e),...t}));Ft.displayName=kj.displayName;const ll=h.forwardRef(({className:e,...t},r)=>a.jsx(Sj,{ref:r,className:R("aspect-square h-full w-full",e),...t}));ll.displayName=Sj.displayName;const Bt=h.forwardRef(({className:e,...t},r)=>a.jsx(Cj,{ref:r,className:R("flex h-full w-full items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground",e),...t}));Bt.displayName=Cj.displayName;function mT(){var s;const{workspace:e,setWorkspace:t}=Ie(),{data:r}=Ou(),n=St();return a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(_t,{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(to,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(zr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"bottom",align:"start",sideOffset:4,children:[a.jsx(Vp,{className:"text-xs text-muted-foreground font-normal",children:"Workspaces"}),r==null?void 0:r.map(i=>a.jsxs(bt,{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(ir,{className:"size-3.5 text-muted-foreground shrink-0"})]},i.id)),a.jsx(qn,{}),a.jsxs(bt,{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 hT(){var i,o,l,c;const{user:e,logout:t}=Ie(),r=St(),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(br,{children:a.jsx(Dt,{children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(ll,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Bt,{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(to,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(zr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(Vp,{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(Ft,{className:"h-8 w-8 rounded-lg",children:[(e==null?void 0:e.avatar_url)&&a.jsx(ll,{src:e.avatar_url,alt:s??"",className:"object-cover"}),a.jsx(Bt,{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(qn,{}),a.jsxs(bt,{className:"cursor-pointer gap-2",onClick:()=>r("/profile"),children:[a.jsx(_u,{className:"size-4"}),"Profile"]}),a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Su,{className:"size-4"}),"Sign out"]})]})]})})})}function pT({...e}){var N,j,k;const{workspace:t,projectKey:r}=Vt(),{data:n}=so(),{toggle:s}=r1(),{user:i}=Ie(),o=vu(),l=t??"",c=o.pathname===`/${l}/projects`,d=o.pathname.includes("/notifications"),u=o.pathname.includes("/settings"),f=o.pathname.includes("/roles"),m=o.pathname===`/${l}/reporting`,p=o.pathname.startsWith("/reporting"),g=o.pathname.startsWith("/org/settings"),x=((N=i==null?void 0:i.roles)==null?void 0:N.includes("super-admin"))??!1,v=x||(((j=i==null?void 0:i.roles)==null?void 0:j.includes("admin"))??!1),y=((k=i==null?void 0:i.permissions)==null?void 0:k.includes("workspace:admin"))??!1,w=v||y;return a.jsxs(Au,{collapsible:"offcanvas",...e,children:[a.jsx(Iu,{children:a.jsx(mT,{})}),a.jsxs($u,{children:[a.jsx(_s,{children:a.jsx(Os,{children:a.jsxs(br,{children:[a.jsx(Dt,{children:a.jsxs(_t,{onClick:s,tooltip:"Search",children:[a.jsx(Ul,{}),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(Dt,{children:a.jsx(_t,{asChild:!0,isActive:c,tooltip:"Projects",children:a.jsxs(oa,{to:`/${l}/projects`,end:!0,children:[a.jsx(Rr,{}),a.jsx("span",{children:"Projects"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:d,tooltip:"Notifications",children:a.jsxs(oa,{to:`/${l}/notifications`,children:[a.jsx(Ii,{}),a.jsx("span",{children:"Notifications"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:m,tooltip:"Reports",children:a.jsxs(oa,{to:`/${l}/reporting`,children:[a.jsx(rs,{}),a.jsx("span",{children:"Reports"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:u,tooltip:"Settings",children:a.jsxs(oa,{to:`/${l}/settings`,children:[a.jsx(Hp,{}),a.jsx("span",{children:"Workspace settings"})]})})})]})})}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Tv,{}),a.jsxs(_s,{children:[a.jsx(Iv,{children:"Recent"}),a.jsx(Os,{children:a.jsx(br,{children:n.slice(0,5).map(b=>a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:b.identifier===r,tooltip:b.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(oa,{to:`/${l}/projects/${b.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:b.identifier}),a.jsx("span",{className:"truncate",children:b.name})]})})},b.id))})})]})]}),w&&a.jsxs(a.Fragment,{children:[a.jsx(Tv,{}),a.jsxs(_s,{children:[a.jsx(Iv,{children:"Global"}),a.jsx(Os,{children:a.jsxs(br,{children:[a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:p,tooltip:"Global Reports",children:a.jsxs(oa,{to:"/reporting",children:[a.jsx(rs,{}),a.jsx("span",{children:"Global Reports"})]})})}),a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:g,tooltip:"Org Settings",children:a.jsxs(oa,{to:"/org/settings",children:[a.jsx(qp,{}),a.jsx("span",{children:"Org Settings"})]})})})]})})]})]}),a.jsx(_s,{className:"mt-auto",children:a.jsx(Os,{children:a.jsx(br,{children:x&&a.jsx(Dt,{children:a.jsx(_t,{asChild:!0,isActive:f,tooltip:"Roles & Permissions",children:a.jsxs(oa,{to:`/${l}/roles`,children:[a.jsx(uh,{}),a.jsx("span",{children:"Custom Roles"})]})})})})})})]}),a.jsx(Ru,{children:a.jsx(hT,{})})]})}function zu(){const{theme:e,setTheme:t}=FE();return a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsxs(ee,{variant:"ghost",size:"icon-sm",onClick:()=>t(e==="dark"?"light":"dark"),className:"text-muted-foreground hover:text-foreground",children:[a.jsx(lD,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),a.jsx(JA,{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(pa,{children:"Toggle theme"})]})}const Hl={all:["notifications"],list:()=>[...Hl.all,"list"]};function gT(){return We({queryKey:Hl.list(),queryFn:()=>re.get("/admin/notifications"),select:e=>e.notifications})}function xT(){return We({queryKey:[...Hl.list(),"unread"],queryFn:()=>re.get("/admin/notifications?unread=true"),select:e=>e.count,refetchInterval:3e4})}function vT(){const e=Se();return be({mutationFn:t=>re.post(`/admin/notifications/${t}/read`),onSuccess:()=>{e.invalidateQueries({queryKey:Hl.all})}})}function yT(){const e=Se();return be({mutationFn:()=>re.post("/admin/notifications/read-all"),onSuccess:()=>{e.invalidateQueries({queryKey:Hl.all})}})}function bT(){const e=vu(),{projectKey:t}=Vt(),{data:r}=so(),n=r==null?void 0:r.find(i=>i.identifier===t),s=e.pathname;return s.includes("/board")?{icon:Rr,label:n?`${n.name} / Board`:"Board"}:s.includes("/issues")?{icon:ga,label:n?`${n.name} / Issues`:"Issues"}:s.includes("/sprints")?{icon:ds,label:n?`${n.name} / Sprints`:"Sprints"}:s.includes("/timeline")?{icon:eo,label:n?`${n.name} / Timeline`:"Timeline"}:s.includes("/access")?{icon:ro,label:n?`${n.name} / Access`:"Access"}:s.includes("/reports")?{icon:rs,label:n?`${n.name} / Reports`:"Reports"}:s.includes("/activity")?{icon:Nu,label:n?`${n.name} / Activity`:"Activity"}:s.endsWith("/projects")?{icon:ud,label:"Projects"}:s.includes("/notifications")?{icon:Ii,label:"Notifications"}:s.includes("/settings")?{icon:Hp,label:"Settings"}:{icon:ud,label:"Meridian"}}function wT(){const{data:e=0}=xT(),{icon:t,label:r}=bT(),{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(Du,{className:"-ml-1"}),a.jsx(ao,{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-1",children:[a.jsx(zu,{}),a.jsx(ee,{variant:"ghost",size:"icon",asChild:!0,className:"relative size-8 text-muted-foreground hover:text-foreground",children:a.jsxs(Yr,{to:`/${s}/notifications`,children:[a.jsx(Ii,{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 jT(){const{user:e,token:t,login:r}=Ie();h.useEffect(()=>{!e||!t||!e.email||fetch("/admin/users/me",{headers:{Authorization:`Bearer ${t}`}}).then(n=>n.ok?n.json():null).then(n=>{n&&r({id:n.id,email:n.email,first_name:n.first_name??"",last_name:n.last_name??"",avatar_url:n.avatar_url??null},t)}).catch(()=>{})},[e==null?void 0:e.id])}function NT(){return jT(),a.jsxs(Eu,{children:[a.jsx(pT,{variant:"inset"}),a.jsxs(Tu,{className:"flex flex-col min-w-0",children:[a.jsx(wT,{}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Al,{})})]})]})}const Kl={project:e=>["projects",e,"access"]};function Qn(e){return We({queryKey:Kl.project(e),queryFn:()=>re.get(`/admin/projects/${e}/access`),enabled:!!e})}function R1(e){const t=Se();return be({mutationFn:({userId:r,role:n})=>re.post(`/admin/projects/${e}/members`,{user_id:r,role:n}),onSuccess:()=>{t.invalidateQueries({queryKey:Kl.project(e)})}})}function $1(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/projects/${e}/members/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Kl.project(e)})}})}function z1(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/projects/${e}/teams`,{team_id:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Kl.project(e)})}})}function L1(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/projects/${e}/teams/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Kl.project(e)})}})}const Ma=Il,kT=Tl,F1=h.forwardRef(({className:e,...t},r)=>a.jsx(ai,{ref:r,className:R("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}));F1.displayName=ai.displayName;const Zn=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(kT,{children:[a.jsx(F1,{}),a.jsxs(si,{ref:n,className:R("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(yu,{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(at,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zn.displayName=si.displayName;const Ea=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col space-y-1.5",e),...t});Ea.displayName="DialogHeader";const Xp=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Xp.displayName="DialogFooter";const Aa=h.forwardRef(({className:e,...t},r)=>a.jsx(Qi,{ref:r,className:R("text-base font-semibold leading-none tracking-tight",e),...t}));Aa.displayName=Qi.displayName;const io=h.forwardRef(({className:e,...t},r)=>a.jsx(Zi,{ref:r,className:R("text-sm text-muted-foreground",e),...t}));io.displayName=Zi.displayName;function ST({open:e,onClose:t,project:r}){const[n,s]=h.useState(null),i=iT(r.id),o=oT(r.id),l=r.share_token,c=n??(l?`${window.location.origin}/share/${l}`:null),d=()=>{i.mutate(void 0,{onSuccess:p=>{const g=`${window.location.origin}/share/${p.project.share_token}`;s(g),L.success("Public link enabled")},onError:()=>L.error("Failed to enable public link")})},u=()=>{o.mutate(void 0,{onSuccess:()=>{s(null),L.success("Public link revoked")},onError:()=>L.error("Failed to revoke link")})},f=()=>{c&&navigator.clipboard.writeText(c).then(()=>{L.success("Link copied to clipboard")})},m=!!c;return a.jsx(Ma,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(Zn,{className:"sm:max-w-md overflow-hidden",children:[a.jsxs(Ea,{children:[a.jsxs(Aa,{className:"flex items-center gap-2",children:[a.jsx(Wl,{className:"h-4 w-4"}),"Share project"]}),a.jsx(io,{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(dh,{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(ee,{variant:"outline",size:"sm",className:"flex-1",onClick:f,children:[a.jsx(Fp,{className:"h-3.5 w-3.5 mr-1.5"}),"Copy link"]}),a.jsxs(ee,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:u,disabled:o.isPending,children:[a.jsx($r,{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(ro,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm text-muted-foreground",children:"This project is private"})]}),a.jsxs(ee,{className:"w-full",onClick:d,disabled:i.isPending,children:[a.jsx(dh,{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."})]})})]})})}const Rv=["board","issues","sprints","timeline","access","reports","activity"];function CT(){const{projectKey:e,workspace:t}=Vt(),{data:r,error:n}=Pa(e??""),{user:s}=Ie(),{data:i}=Qn((r==null?void 0:r.id)??""),[o,l]=h.useState(!1),c=St(),d=vu(),[u]=Dl(),f=(s==null?void 0:s.roles)??[],m=f.includes("super-admin")||f.includes("admin"),p=i==null?void 0:i.members.some(y=>y.user_id===(s==null?void 0:s.id)&&y.role==="manager"),g=m||p;h.useEffect(()=>{n&&n instanceof Rp&&(n.status===403||n.status===404)&&c(`/${t}/projects`,{replace:!0})},[n,t,c]),h.useEffect(()=>{const y=u.get("tab");if(!y||!Rv.includes(y))return;Rv.every(N=>!d.pathname.endsWith(`/${N}`))&&c(`/${t}/projects/${e}/${y}`,{replace:!0})},[]);const x=`/${t}/projects/${e}`,v=[{to:`${x}/board`,label:"Board",icon:ud,end:!0},{to:`${x}/issues`,label:"Issues",icon:ga,end:!1},{to:`${x}/sprints`,label:"Sprints",icon:ds,end:!0},{to:`${x}/timeline`,label:"Timeline",icon:eo,end:!0},{to:`${x}/access`,label:"Access",icon:ro,end:!0},{to:`${x}/reports`,label:"Reports",icon:rs,end:!0},{to:`${x}/activity`,label:"Activity",icon:Nu,end:!0}];return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"px-6 pt-5 border-b border-border bg-white dark:bg-card shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-2.5 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:"flex items-center -mb-px",children:[a.jsx("div",{className:"flex flex-1",children:v.map(({to:y,label:w,icon:N,end:j})=>a.jsxs(oa,{to:y,end:j,className:({isActive:k})=>`flex items-center gap-1.5 px-3 py-2 text-sm border-b-2 transition-colors ${k?"border-foreground text-foreground font-medium":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[a.jsx(N,{className:"h-3.5 w-3.5",strokeWidth:1.5}),w]},y))}),g&&r&&a.jsx("div",{className:"pb-px pr-1",children:a.jsxs(ee,{variant:"ghost",size:"sm",onClick:()=>l(!0),className:"h-7 px-2 text-xs text-muted-foreground",children:[a.jsx(sD,{className:"h-3.5 w-3.5 mr-1"}),"Share"]})})]})]}),a.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:a.jsx(Al,{})}),r&&a.jsx(ST,{open:o,onClose:()=>l(!1),project:r})]})}function _T(){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(br,{children:a.jsx(Dt,{children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Bt,{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(to,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(zr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Su,{className:"size-4"}),"Sign out"]})]})]})})})}function OT(){const{workspace:e}=Ie(),t=St(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Au,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Iu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(rs,{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($u,{children:a.jsx(_s,{children:a.jsx(Os,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Ll,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Ru,{children:a.jsx(_T,{})})]})}function PT(){return a.jsxs(Eu,{children:[a.jsx(OT,{}),a.jsxs(Tu,{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(Du,{className:"-ml-1"}),a.jsx(ao,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(rs,{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(zu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Al,{})})]})]})}function MT(){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(br,{children:a.jsx(Dt,{children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsx(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:a.jsx(Bt,{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(to,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(zr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Su,{className:"size-4"}),"Sign out"]})]})]})})})}function ET(){const{workspace:e}=Ie(),t=St(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Au,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Iu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(qp,{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($u,{children:a.jsx(_s,{children:a.jsx(Os,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Ll,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Ru,{children:a.jsx(MT,{})})]})}function AT(){return a.jsxs(Eu,{children:[a.jsx(ET,{}),a.jsxs(Tu,{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(Du,{className:"-ml-1"}),a.jsx(ao,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(qp,{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(zu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Al,{})})]})]})}function DT(){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(br,{children:a.jsx(Dt,{children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsxs(_t,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[a.jsxs(Ft,{className:"h-8 w-8 rounded-lg shrink-0",children:[(e==null?void 0:e.avatar_url)&&a.jsx(ll,{src:e.avatar_url,alt:n??"",className:"object-cover"}),a.jsx(Bt,{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(to,{className:"ml-auto size-4 shrink-0"})]})}),a.jsxs(zr,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:"top",align:"end",sideOffset:4,children:[a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive cursor-pointer",onClick:t,children:[a.jsx(Su,{className:"size-4"}),"Sign out"]})]})]})})})}function TT(){const{workspace:e}=Ie(),t=St(),r=(e==null?void 0:e.slug)??"";return a.jsxs(Au,{collapsible:"offcanvas",variant:"inset",children:[a.jsx(Iu,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{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(_u,{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($u,{children:a.jsx(_s,{children:a.jsx(Os,{children:a.jsx(br,{children:a.jsx(Dt,{children:a.jsxs(_t,{onClick:()=>t(r?`/${r}/projects`:"/"),tooltip:"Back to workspace",children:[a.jsx(Ll,{}),a.jsx("span",{children:"Back to workspace"})]})})})})})}),a.jsx(Ru,{children:a.jsx(DT,{})})]})}function IT(){return a.jsxs(Eu,{children:[a.jsx(TT,{}),a.jsxs(Tu,{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(Du,{className:"-ml-1"}),a.jsx(ao,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(_u,{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(zu,{})})]})}),a.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-y-auto overflow-x-hidden",children:a.jsx(Al,{})})]})]})}var $v=1,RT=.9,$T=.8,zT=.17,lm=.1,cm=.999,LT=.9999,FT=.99,BT=/[\\\/_+.#"@\[\(\{&]/,WT=/[\\\/_+.#"@\[\(\{&]/g,UT=/[\s-]/,B1=/[\s-]/g;function fh(e,t,r,n,s,i,o){if(i===t.length)return s===e.length?$v:FT;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,g;d>=0;)f=fh(e,t,r,n,d+1,i+1,o),f>u&&(d===s?f*=$v:BT.test(e.charAt(d-1))?(f*=$T,p=e.slice(s,d-1).match(WT),p&&s>0&&(f*=Math.pow(cm,p.length))):UT.test(e.charAt(d-1))?(f*=RT,g=e.slice(s,d-1).match(B1),g&&s>0&&(f*=Math.pow(cm,g.length))):(f*=zT,s>0&&(f*=Math.pow(cm,d-s))),e.charAt(d)!==t.charAt(i)&&(f*=LT)),(f<lm&&r.charAt(d-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(d-1)!==n.charAt(i))&&(m=fh(e,t,r,n,d+1,i+2,o),m*lm>f&&(f=m*lm)),f>u&&(u=f),d=r.indexOf(c,d+1);return o[l]=u,u}function zv(e){return e.toLowerCase().replace(B1," ")}function qT(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,fh(e,t,zv(e),zv(t),0,0,{})}var Mo='[cmdk-group=""]',dm='[cmdk-group-items=""]',HT='[cmdk-group-heading=""]',Qp='[cmdk-item=""]',Lv=`${Qp}:not([aria-disabled="true"])`,mh="cmdk-item-select",Ss="data-value",KT=(e,t,r)=>qT(e,t,r),W1=h.createContext(void 0),Yl=()=>h.useContext(W1),U1=h.createContext(void 0),Zp=()=>h.useContext(U1),q1=h.createContext(void 0),H1=h.forwardRef((e,t)=>{let r=Ni(()=>{var U,G;return{search:"",value:(G=(U=e.value)!=null?U:e.defaultValue)!=null?G:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=Ni(()=>new Set),s=Ni(()=>new Map),i=Ni(()=>new Map),o=Ni(()=>new Set),l=K1(e),{label:c,children:d,value:u,onValueChange:f,filter:m,shouldFilter:p,loop:g,disablePointerSelection:x=!1,vimBindings:v=!0,...y}=e,w=Oi(),N=Oi(),j=Oi(),k=h.useRef(null),b=n5();Bs(()=>{if(u!==void 0){let U=u.trim();r.current.value=U,C.emit()}},[u]),Bs(()=>{b(6,T)},[]);let C=h.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>r.current,setState:(U,G,J)=>{var X,O,F;if(!Object.is(r.current[U],G)){if(r.current[U]=G,U==="search")P(),A(),b(1,M);else if(U==="value"&&(J||b(5,T),((X=l.current)==null?void 0:X.value)!==void 0)){let ae=G??"";(F=(O=l.current).onValueChange)==null||F.call(O,ae);return}C.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),S=h.useMemo(()=>({value:(U,G,J)=>{var X;G!==((X=i.current.get(U))==null?void 0:X.value)&&(i.current.set(U,{value:G,keywords:J}),r.current.filtered.items.set(U,_(G,J)),b(2,()=>{A(),C.emit()}))},item:(U,G)=>(n.current.add(U),G&&(s.current.has(G)?s.current.get(G).add(U):s.current.set(G,new Set([U]))),b(3,()=>{P(),A(),r.current.value||M(),C.emit()}),()=>{i.current.delete(U),n.current.delete(U),r.current.filtered.items.delete(U);let J=D();b(4,()=>{P(),(J==null?void 0:J.getAttribute("id"))===U&&M(),C.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{i.current.delete(U),s.current.delete(U)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:w,inputId:j,labelId:N,listInnerRef:k}),[]);function _(U,G){var J,X;let O=(X=(J=l.current)==null?void 0:J.filter)!=null?X:KT;return U?O(U,r.current.search,G):0}function A(){if(!r.current.search||l.current.shouldFilter===!1)return;let U=r.current.filtered.items,G=[];r.current.filtered.groups.forEach(X=>{let O=s.current.get(X),F=0;O.forEach(ae=>{let W=U.get(ae);F=Math.max(W,F)}),G.push([X,F])});let J=k.current;B().sort((X,O)=>{var F,ae;let W=X.getAttribute("id"),q=O.getAttribute("id");return((F=U.get(q))!=null?F:0)-((ae=U.get(W))!=null?ae:0)}).forEach(X=>{let O=X.closest(dm);O?O.appendChild(X.parentElement===O?X:X.closest(`${dm} > *`)):J.appendChild(X.parentElement===J?X:X.closest(`${dm} > *`))}),G.sort((X,O)=>O[1]-X[1]).forEach(X=>{var O;let F=(O=k.current)==null?void 0:O.querySelector(`${Mo}[${Ss}="${encodeURIComponent(X[0])}"]`);F==null||F.parentElement.appendChild(F)})}function M(){let U=B().find(J=>J.getAttribute("aria-disabled")!=="true"),G=U==null?void 0:U.getAttribute(Ss);C.setState("value",G||void 0)}function P(){var U,G,J,X;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let O=0;for(let F of n.current){let ae=(G=(U=i.current.get(F))==null?void 0:U.value)!=null?G:"",W=(X=(J=i.current.get(F))==null?void 0:J.keywords)!=null?X:[],q=_(ae,W);r.current.filtered.items.set(F,q),q>0&&O++}for(let[F,ae]of s.current)for(let W of ae)if(r.current.filtered.items.get(W)>0){r.current.filtered.groups.add(F);break}r.current.filtered.count=O}function T(){var U,G,J;let X=D();X&&(((U=X.parentElement)==null?void 0:U.firstChild)===X&&((J=(G=X.closest(Mo))==null?void 0:G.querySelector(HT))==null||J.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function D(){var U;return(U=k.current)==null?void 0:U.querySelector(`${Qp}[aria-selected="true"]`)}function B(){var U;return Array.from(((U=k.current)==null?void 0:U.querySelectorAll(Lv))||[])}function E(U){let G=B()[U];G&&C.setState("value",G.getAttribute(Ss))}function z(U){var G;let J=D(),X=B(),O=X.findIndex(ae=>ae===J),F=X[O+U];(G=l.current)!=null&&G.loop&&(F=O+U<0?X[X.length-1]:O+U===X.length?X[0]:X[O+U]),F&&C.setState("value",F.getAttribute(Ss))}function Q(U){let G=D(),J=G==null?void 0:G.closest(Mo),X;for(;J&&!X;)J=U>0?t5(J,Mo):r5(J,Mo),X=J==null?void 0:J.querySelector(Lv);X?C.setState("value",X.getAttribute(Ss)):z(U)}let K=()=>E(B().length-1),se=U=>{U.preventDefault(),U.metaKey?K():U.altKey?Q(1):z(1)},te=U=>{U.preventDefault(),U.metaKey?E(0):U.altKey?Q(-1):z(-1)};return h.createElement(os.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:U=>{var G;if((G=y.onKeyDown)==null||G.call(y,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{v&&U.ctrlKey&&se(U);break}case"ArrowDown":{se(U);break}case"p":case"k":{v&&U.ctrlKey&&te(U);break}case"ArrowUp":{te(U);break}case"Home":{U.preventDefault(),E(0);break}case"End":{U.preventDefault(),K();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let J=D();if(J){let X=new Event(mh);J.dispatchEvent(X)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:s5},c),Lu(e,U=>h.createElement(U1.Provider,{value:C},h.createElement(W1.Provider,{value:S},U))))}),YT=h.forwardRef((e,t)=>{var r,n;let s=Oi(),i=h.useRef(null),o=h.useContext(q1),l=Yl(),c=K1(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;Bs(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=Y1(s,i,[e.value,e.children,i],e.keywords),f=Zp(),m=Ws(b=>b.value&&b.value===u.current),p=Ws(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(mh,g),()=>b.removeEventListener(mh,g)},[p,e.onSelect,e.disabled]);function g(){var b,C;x(),(C=(b=c.current).onSelect)==null||C.call(b,u.current)}function x(){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(os.div,{ref:cl([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:x,onClick:v?void 0:g},e.children)}),GT=h.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Oi(),l=h.useRef(null),c=h.useRef(null),d=Oi(),u=Yl(),f=Ws(p=>s||u.filter()===!1?!0:p.search?p.filtered.groups.has(o):!0);Bs(()=>u.group(o),[]),Y1(o,l,[e.value,e.heading,c]);let m=h.useMemo(()=>({id:o,forceMount:s}),[s]);return h.createElement(os.div,{ref:cl([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),Lu(e,p=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},h.createElement(q1.Provider,{value:m},p))))}),VT=h.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=h.useRef(null),i=Ws(o=>!o.search);return!r&&!i?null:h.createElement(os.div,{ref:cl([s,t]),...n,"cmdk-separator":"",role:"separator"})}),XT=h.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,i=Zp(),o=Ws(u=>u.search),l=Ws(u=>u.value),c=Yl(),d=h.useMemo(()=>{var u;let f=(u=c.listInnerRef.current)==null?void 0:u.querySelector(`${Qp}[${Ss}="${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(os.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)}})}),QT=h.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=h.useRef(null),o=h.useRef(null),l=Yl();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(os.div,{ref:cl([i,t]),...s,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},Lu(e,c=>h.createElement("div",{ref:cl([o,l.listInnerRef]),"cmdk-list-sizer":""},c)))}),ZT=h.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...l}=e;return h.createElement(Il,{open:r,onOpenChange:n},h.createElement(Tl,{container:o},h.createElement(ai,{"cmdk-overlay":"",className:s}),h.createElement(si,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(H1,{ref:t,...l}))))}),JT=h.forwardRef((e,t)=>Ws(r=>r.filtered.count===0)?h.createElement(os.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),e5=h.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return h.createElement(os.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Lu(e,o=>h.createElement("div",{"aria-hidden":!0},o)))}),Lr=Object.assign(H1,{List:QT,Item:YT,Input:XT,Group:GT,Separator:VT,Dialog:ZT,Empty:JT,Loading:e5});function t5(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function r5(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function K1(e){let t=h.useRef(e);return Bs(()=>{t.current=e}),t}var Bs=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Ni(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function cl(e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}function Ws(e){let t=Zp(),r=()=>e(t.snapshot());return cM.useSyncExternalStore(t.subscribe,r,r)}function Y1(e,t,r,n=[]){let s=h.useRef(),i=Yl();return Bs(()=>{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(Ss,l),s.current=l}),s}var n5=()=>{let[e,t]=h.useState(),r=Ni(()=>new Map);return Bs(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function a5(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Lu({asChild:e,children:t},r){return e&&h.isValidElement(t)?h.cloneElement(a5(t),{ref:t.ref},r(t.props.children)):r(t)}var s5={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ts=h.forwardRef(({className:e,...t},r)=>a.jsx(Lr,{ref:r,className:R("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Ts.displayName=Lr.displayName;const i5=({children:e,open:t,onOpenChange:r})=>a.jsx(Ma,{open:t,onOpenChange:r,children:a.jsx(Zn,{className:"overflow-hidden p-0 shadow-lg max-w-[560px]",children:a.jsx(Ts,{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})})}),Fu=h.forwardRef(({className:e,...t},r)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(Ul,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(Lr.Input,{ref:r,className:R("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})]}));Fu.displayName=Lr.Input.displayName;const Is=h.forwardRef(({className:e,...t},r)=>a.jsx(Lr.List,{ref:r,className:R("max-h-[320px] overflow-y-auto overflow-x-hidden",e),...t}));Is.displayName=Lr.List.displayName;const Bu=h.forwardRef((e,t)=>a.jsx(Lr.Empty,{ref:t,className:"py-6 text-center text-sm text-muted-foreground",...e}));Bu.displayName=Lr.Empty.displayName;const Ja=h.forwardRef(({className:e,...t},r)=>a.jsx(Lr.Group,{ref:r,className:R("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}));Ja.displayName=Lr.Group.displayName;const G1=h.forwardRef(({className:e,...t},r)=>a.jsx(Lr.Separator,{ref:r,className:R("-mx-1 h-px bg-border",e),...t}));G1.displayName=Lr.Separator.displayName;const nn=h.forwardRef(({className:e,...t},r)=>a.jsx(Lr.Item,{ref:r,className:R("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}));nn.displayName=Lr.Item.displayName;function o5(){const{open:e,setOpen:t}=r1(),r=St(),{data:n}=so(),{workspace:s}=Ie(),i=(s==null?void 0:s.slug)??"",o=l=>{t(!1),l()};return a.jsxs(i5,{open:e,onOpenChange:t,children:[a.jsx(Fu,{placeholder:"Search or jump to..."}),a.jsxs(Is,{children:[a.jsx(Bu,{children:"No results found."}),a.jsxs(Ja,{heading:"Navigation",children:[a.jsxs(nn,{onSelect:()=>o(()=>r(`/${i}/projects`)),children:[a.jsx(ud,{className:"text-muted-foreground"}),a.jsx("span",{children:"Projects"})]}),a.jsxs(nn,{onSelect:()=>o(()=>r(`/${i}/notifications`)),children:[a.jsx(Ii,{className:"text-muted-foreground"}),a.jsx("span",{children:"Notifications"})]}),a.jsxs(nn,{onSelect:()=>o(()=>r(`/${i}/settings`)),children:[a.jsx(Hp,{className:"text-muted-foreground"}),a.jsx("span",{children:"Settings"})]})]}),n&&n.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(G1,{}),a.jsxs(Ja,{heading:"Projects",children:[n.map(l=>a.jsxs(nn,{value:`${l.name} board`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/board`)),children:[a.jsx(Rr,{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(nn,{value:`${l.name} issues`,onSelect:()=>o(()=>r(`/${i}/projects/${l.identifier}/issues`)),children:[a.jsx(ga,{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 Nr({zone:e,props:t}){const r=PA(e);return r.length?a.jsx(a.Fragment,{children:r.map((n,s)=>a.jsx(n,{...t},n.displayName??n.name??s))}):null}function Jp({flow:e,inviteToken:t,label:r,disabled:n}){const s=()=>{const i=`${Ti}/auth/google?flow=${e}${t?`&invite_token=${encodeURIComponent(t)}`:""}`;window.location.href=i};return a.jsxs(ee,{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 l5(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(!1),o=St(),l=ID(),{data:c}=Mu(),d=u=>{u.preventDefault(),l.mutate({email:e,password:r},{onSuccess:()=>o("/"),onError:f=>L.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(Nr,{zone:"login.before",props:{}}),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:"Welcome to Meridian"}),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(Ae,{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(Ae,{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(Bl,{className:"h-4 w-4"}):a.jsx(ii,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(Yr,{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(ee,{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(Jp,{flow:"login"})]}),a.jsxs("p",{className:"text-sm text-center text-muted-foreground mt-6",children:["Don't have an account?"," ",a.jsx(Yr,{to:"/register",className:"text-indigo hover:opacity-80 transition-opacity",children:"Create one"})]}),a.jsx(Nr,{zone:"login.after",props:{}})]})})}function c5(){const[e,t]=h.useState(""),[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=St(),f=RD(),{data:m}=Mu(),p=(m==null?void 0:m.needsSetup)===!0,g=x=>{x.preventDefault(),f.mutate({email:s,password:o,first_name:e,last_name:r},{onSuccess:()=>u("/"),onError:v=>L.error(v.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-[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:p?"Set up your account":"Create your account"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:p?"You're the first user — you'll be the super admin.":"Get started with Meridian"})]})]}),a.jsxs("form",{onSubmit:g,className:"space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsx(Ae,{placeholder:"First name",value:e,onChange:x=>t(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"}),a.jsx(Ae,{placeholder:"Last name",value:r,onChange:x=>n(x.target.value),required:!0,className:"bg-white dark:bg-card h-10"})]}),a.jsx(Ae,{type:"email",placeholder:"Email",value:s,onChange:x=>i(x.target.value),autoComplete:"email",required:!0,className:"bg-white dark:bg-card h-10"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:c?"text":"password",placeholder:"Password",value:o,onChange:x=>l(x.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(Bl,{className:"h-4 w-4"}):a.jsx(ii,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(ee,{type:"submit",className:"w-full h-10 font-medium",disabled:f.isPending,children:f.isPending?"Creating account...":"Create Account"})})]}),(m==null?void 0:m.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(Jp,{flow:"register",label:p?"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(Yr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]})})}function d5(){const[e,t]=h.useState(""),r=St(),{setWorkspace:n}=Ie(),s=wD(),i=o=>{o.preventDefault(),e.trim()&&s.mutate({name:e.trim()},{onSuccess:l=>{const c={id:l.workspace.id,name:l.workspace.name,slug:l.workspace.slug};n(c),r(`/${c.slug}/projects`,{replace:!0})},onError:l=>L.error(l.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("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:"Create your 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:i,className:"space-y-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(Ae,{placeholder:"Workspace name (e.g. Acme Corp)",value:e,onChange:o=>t(o.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.jsx(ee,{type:"submit",className:"w-full h-10 font-medium",disabled:!e.trim()||s.isPending,children:s.isPending?"Creating workspace...":"Create workspace"})]})]})})}function u5(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 V1=I.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}),Gl=()=>{const e=I.useContext(V1);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};u5(`[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(
|
|
539
|
-
[data-state=closed]
|
|
540
|
-
){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 f5(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function m5(){return eg(/^Mac/)}function h5(){return eg(/^iPhone/)}function Fv(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function p5(){return eg(/^iPad/)||m5()&&navigator.maxTouchPoints>1}function X1(){return h5()||p5()}function eg(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const g5=24,x5=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Bv(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const um=typeof document<"u"&&window.visualViewport;function Wv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Q1(e){for(Wv(e)&&(e=e.parentElement);e&&!Wv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const v5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Cc=0,fm;function y5(e={}){let{isDisabled:t}=e;x5(()=>{if(!t)return Cc++,Cc===1&&X1()&&(fm=b5()),()=>{Cc--,Cc===0&&(fm==null||fm())}},[t])}function b5(){let e,t=0,r=f=>{e=Q1(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,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&m>t||p>=g&&m<t)&&f.preventDefault(),t=m)},s=f=>{let m=f.target;hh(m)&&m!==document.activeElement&&(f.preventDefault(),m.style.transform="translateY(-2000px)",m.focus(),requestAnimationFrame(()=>{m.style.transform=""}))},i=f=>{let m=f.target;hh(m)&&(m.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{m.style.transform="",um&&(um.height<window.innerHeight?requestAnimationFrame(()=>{Uv(m)}):um.addEventListener("resize",()=>Uv(m),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},l=window.pageXOffset,c=window.pageYOffset,d=Bv(w5(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Bv(Eo(document,"touchstart",r,{passive:!1,capture:!0}),Eo(document,"touchmove",n,{passive:!1,capture:!0}),Eo(document,"touchend",s,{passive:!1,capture:!0}),Eo(document,"focus",i,!0),Eo(window,"scroll",o));return()=>{d(),u(),window.scrollTo(l,c)}}function w5(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function Eo(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function Uv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=Q1(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+g5;i>o&&(r.scrollTop+=s-n)}e=r.parentElement}}function hh(e){return e instanceof HTMLInputElement&&!v5.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function j5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function N5(...e){return t=>e.forEach(r=>j5(r,t))}function Z1(...e){return h.useCallback(N5(...e),e)}const J1=new WeakMap;function $t(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&&J1.set(e,n)}function k5(e,t){if(!e||!(e instanceof HTMLElement))return;let r=J1.get(e);r&&(e.style[t]=r[t])}const At=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function _c(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(", ")[At(t)?13:12]):(s=n.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[At(t)?5:4]):null)}function S5(e){return 8*(Math.log(e+1)-2)}function mm(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function C5(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const vt={DURATION:.5,EASE:[.32,.72,0,1]},eN=.4,_5=.25,O5=100,tN=8,gs=16,ph=26,hm="vaul-dragging";function rN(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function P5({defaultProp:e,onChange:t}){const r=I.useState(e),[n]=r,s=I.useRef(n),i=rN(t);return I.useEffect(()=>{s.current!==n&&(i(n),s.current=n)},[n,s,i]),r}function nN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=P5({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=rN(r),c=I.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 M5({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:s,fadeFromIndex:i,onSnapPointChange:o,direction:l="bottom",container:c,snapToSequentialPoint:d}){const[u,f]=nN({prop:e,defaultProp:r==null?void 0:r[0],onChange:t}),[m,p]=I.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);I.useEffect(()=>{function C(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const g=I.useMemo(()=>u===(r==null?void 0:r[r.length-1])||null,[r,u]),x=I.useMemo(()=>{var C;return(C=r==null?void 0:r.findIndex(S=>S===u))!=null?C:null},[r,u]),v=r&&r.length>0&&(i||i===0)&&!Number.isNaN(i)&&r[i]===u||!r,y=I.useMemo(()=>{const C=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var S;return(S=r==null?void 0:r.map(_=>{const A=typeof _=="string";let M=0;if(A&&(M=parseInt(_,10)),At(l)){const T=A?M:m?_*C.height:0;return m?l==="bottom"?C.height-T:-C.height+T:T}const P=A?M:m?_*C.width:0;return m?l==="right"?C.width-P:-C.width+P:P}))!=null?S:[]},[r,m,c]),w=I.useMemo(()=>x!==null?y==null?void 0:y[x]:null,[y,x]),N=I.useCallback(C=>{var S;const _=(S=y==null?void 0:y.findIndex(A=>A===C))!=null?S:null;o(_),$t(n.current,{transition:`transform ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,transform:At(l)?`translate3d(0, ${C}px, 0)`:`translate3d(${C}px, 0, 0)`}),y&&_!==y.length-1&&i!==void 0&&_!==i&&_<i?$t(s.current,{transition:`opacity ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,opacity:"0"}):$t(s.current,{transition:`opacity ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,opacity:"1"}),f(r==null?void 0:r[Math.max(_,0)])},[n.current,r,y,i,s,f]);I.useEffect(()=>{if(u||e){var C;const S=(C=r==null?void 0:r.findIndex(_=>_===e||_===u))!=null?C:-1;y&&S!==-1&&typeof y[S]=="number"&&N(y[S])}},[u,e,r,y,N]);function j({draggedDistance:C,closeDrawer:S,velocity:_,dismissible:A}){if(i===void 0)return;const M=l==="bottom"||l==="right"?(w??0)-C:(w??0)+C,P=x===i-1,T=x===0,D=C>0;if(P&&$t(s.current,{transition:`opacity ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`}),!d&&_>2&&!D){A?S():N(y[0]);return}if(!d&&_>2&&D&&y&&r){N(y[r.length-1]);return}const B=y==null?void 0:y.reduce((z,Q)=>typeof z!="number"||typeof Q!="number"?z:Math.abs(Q-M)<Math.abs(z-M)?Q:z),E=At(l)?window.innerHeight:window.innerWidth;if(_>eN&&Math.abs(C)<E*.4){const z=D?1:-1;if(z>0&&g&&r){N(y[r.length-1]);return}if(T&&z<0&&A&&S(),x===null)return;N(y[x+z]);return}N(B)}function k({draggedDistance:C}){if(w===null)return;const S=l==="bottom"||l==="right"?w-C:w+C;(l==="bottom"||l==="right")&&S<y[y.length-1]||(l==="top"||l==="left")&&S>y[y.length-1]||$t(n.current,{transform:At(l)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`})}function b(C,S){if(!r||typeof x!="number"||!y||i===void 0)return null;const _=x===i-1;if(x>=i&&S)return 0;if(_&&!S)return 1;if(!v&&!_)return null;const M=_?x+1:x-1,P=_?y[M]-y[M-1]:y[M+1]-y[M],T=C/Math.abs(P);return _?1-T:T}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:v,getPercentageDragged:b,setActiveSnapPoint:f,activeSnapPointIndex:x,onRelease:j,onDrag:k,snapPointsOffset:y}}const E5=()=>()=>{};function A5(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:s}=Gl(),i=I.useRef(null),o=h.useMemo(()=>document.body.style.backgroundColor,[]);function l(){return(window.innerWidth-ph)/window.innerWidth}I.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;C5(n&&!s?mm(document.body,{background:"black"}):E5,mm(c,{transformOrigin:At(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${vt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${vt.EASE.join(",")})`}));const d=mm(c,{borderRadius:`${tN}px`,overflow:"hidden",...At(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")},vt.DURATION*1e3)}}},[t,r,o])}let Ao=null;function D5({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:s,noBodyStyles:i}){const[o,l]=I.useState(()=>typeof window<"u"?window.location.href:""),c=I.useRef(0),d=I.useCallback(()=>{if(Fv()&&Ao===null&&e&&!i){Ao={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=I.useCallback(()=>{if(Fv()&&Ao!==null&&!i){const f=-parseInt(document.body.style.top,10),m=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ao),window.requestAnimationFrame(()=>{if(s&&o!==window.location.href){l(window.location.href);return}window.scrollTo(m,f)}),Ao=null}},[o]);return I.useEffect(()=>{function f(){c.current=window.scrollY}return f(),window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f)}},[]),I.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),I.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 T5({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:s,snapPoints:i,shouldScaleBackground:o=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=_5,scrollLockTimeout:d=O5,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:m=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:x,modal:v=!0,onClose:y,nested:w,noBodyStyles:N=!1,direction:j="bottom",defaultOpen:k=!1,disablePreventScroll:b=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:S=!1,repositionInputs:_=!0,onAnimationEnd:A,container:M,autoFocus:P=!1}){var T,D;const[B=!1,E]=nN({defaultProp:k,prop:e,onChange:Pe=>{t==null||t(Pe),!Pe&&!w&&Ze(),setTimeout(()=>{A==null||A(Pe)},vt.DURATION*1e3),Pe&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Pe||(document.body.style.pointerEvents="auto")}}),[z,Q]=I.useState(!1),[K,se]=I.useState(!1),[te,U]=I.useState(!1),G=I.useRef(null),J=I.useRef(null),X=I.useRef(null),O=I.useRef(null),F=I.useRef(null),ae=I.useRef(!1),W=I.useRef(null),q=I.useRef(0),le=I.useRef(!1),Z=I.useRef(!k),de=I.useRef(0),V=I.useRef(null),oe=I.useRef(((T=V.current)==null?void 0:T.getBoundingClientRect().height)||0),pe=I.useRef(((D=V.current)==null?void 0:D.getBoundingClientRect().width)||0),we=I.useRef(0),_e=I.useCallback(Pe=>{i&&Pe===Fe.length-1&&(J.current=new Date)},[]),{activeSnapPoint:H,activeSnapPointIndex:ve,setActiveSnapPoint:De,onRelease:He,snapPointsOffset:Fe,onDrag:Qe,shouldFade:gt,getPercentageDragged:Ge}=M5({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:V,fadeFromIndex:m,overlayRef:G,onSnapPointChange:_e,direction:j,container:M,snapToSequentialPoint:C});y5({isDisabled:!B||K||!v||te||!z||!_||!b});const{restorePositionSetting:Ze}=D5({isOpen:B,modal:v,nested:w??!1,hasBeenOpened:z,preventScrollRestoration:S,noBodyStyles:N});function pr(){return(window.innerWidth-ph)/window.innerWidth}function mn(Pe){var me,ye;!u&&!i||V.current&&!V.current.contains(Pe.target)||(oe.current=((me=V.current)==null?void 0:me.getBoundingClientRect().height)||0,pe.current=((ye=V.current)==null?void 0:ye.getBoundingClientRect().width)||0,se(!0),X.current=new Date,X1()&&window.addEventListener("touchend",()=>ae.current=!1,{once:!0}),Pe.target.setPointerCapture(Pe.pointerId),q.current=At(j)?Pe.pageY:Pe.pageX)}function Pr(Pe,me){var ye;let fe=Pe;const ge=(ye=window.getSelection())==null?void 0:ye.toString(),Ve=V.current?_c(V.current,j):null,ie=new Date;if(fe.tagName==="SELECT"||fe.hasAttribute("data-vaul-no-drag")||fe.closest("[data-vaul-no-drag]"))return!1;if(j==="right"||j==="left")return!0;if(J.current&&ie.getTime()-J.current.getTime()<500)return!1;if(Ve!==null&&(j==="bottom"?Ve>0:Ve<0))return!0;if(ge&&ge.length>0)return!1;if(F.current&&ie.getTime()-F.current.getTime()<d&&Ve===0||me)return F.current=ie,!1;for(;fe;){if(fe.scrollHeight>fe.clientHeight){if(fe.scrollTop!==0)return F.current=new Date,!1;if(fe.getAttribute("role")==="dialog")return!0}fe=fe.parentNode}return!0}function hn(Pe){if(V.current&&K){const me=j==="bottom"||j==="right"?1:-1,ye=(q.current-(At(j)?Pe.pageY:Pe.pageX))*me,fe=ye>0,ge=i&&!u&&!fe;if(ge&&ve===0)return;const Ve=Math.abs(ye),ie=document.querySelector("[data-vaul-drawer-wrapper]"),Ce=j==="bottom"||j==="top"?oe.current:pe.current;let Te=Ve/Ce;const xt=Ge(Ve,fe);if(xt!==null&&(Te=xt),ge&&Te>=1||!ae.current&&!Pr(Pe.target,fe))return;if(V.current.classList.add(hm),ae.current=!0,$t(V.current,{transition:"none"}),$t(G.current,{transition:"none"}),i&&Qe({draggedDistance:ye}),fe&&!i){const rt=S5(ye),xr=Math.min(rt*-1,0)*me;$t(V.current,{transform:At(j)?`translate3d(0, ${xr}px, 0)`:`translate3d(${xr}px, 0, 0)`});return}const tt=1-Te;if((gt||m&&ve===m-1)&&(n==null||n(Pe,Te),$t(G.current,{opacity:`${tt}`,transition:"none"},!0)),ie&&G.current&&o){const rt=Math.min(pr()+Te*(1-pr()),1),xr=8-Te*8,tr=Math.max(0,14-Te*14);$t(ie,{borderRadius:`${xr}px`,transform:At(j)?`scale(${rt}) translate3d(0, ${tr}px, 0)`:`scale(${rt}) translate3d(${tr}px, 0, 0)`,transition:"none"},!0)}if(!i){const rt=Ve*me;$t(V.current,{transform:At(j)?`translate3d(0, ${rt}px, 0)`:`translate3d(${rt}px, 0, 0)`})}}}I.useEffect(()=>{window.requestAnimationFrame(()=>{Z.current=!0})},[]),I.useEffect(()=>{var Pe;function me(){if(!V.current||!_)return;const ye=document.activeElement;if(hh(ye)||le.current){var fe;const ge=((fe=window.visualViewport)==null?void 0:fe.height)||0,Ve=window.innerHeight;let ie=Ve-ge;const Ce=V.current.getBoundingClientRect().height||0,Te=Ce>Ve*.8;we.current||(we.current=Ce);const xt=V.current.getBoundingClientRect().top;if(Math.abs(de.current-ie)>60&&(le.current=!le.current),i&&i.length>0&&Fe&&ve){const tt=Fe[ve]||0;ie+=tt}if(de.current=ie,Ce>ge||le.current){const tt=V.current.getBoundingClientRect().height;let rt=tt;tt>ge&&(rt=ge-(Te?xt:ph)),x?V.current.style.height=`${tt-Math.max(ie,0)}px`:V.current.style.height=`${Math.max(rt,ge-xt)}px`}else f5()||(V.current.style.height=`${we.current}px`);i&&i.length>0&&!le.current?V.current.style.bottom="0px":V.current.style.bottom=`${Math.max(ie,0)}px`}}return(Pe=window.visualViewport)==null||Pe.addEventListener("resize",me),()=>{var ye;return(ye=window.visualViewport)==null?void 0:ye.removeEventListener("resize",me)}},[ve,i,Fe]);function gr(Pe){Rt(),y==null||y(),Pe||E(!1),setTimeout(()=>{i&&De(i[0])},vt.DURATION*1e3)}function Ct(){if(!V.current)return;const Pe=document.querySelector("[data-vaul-drawer-wrapper]"),me=_c(V.current,j);$t(V.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`}),$t(G.current,{transition:`opacity ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,opacity:"1"}),o&&me&&me>0&&B&&$t(Pe,{borderRadius:`${tN}px`,overflow:"hidden",...At(j)?{transform:`scale(${pr()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${pr()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${vt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${vt.EASE.join(",")})`},!0)}function Rt(){!K||!V.current||(V.current.classList.remove(hm),ae.current=!1,se(!1),O.current=new Date)}function qt(Pe){if(!K||!V.current)return;V.current.classList.remove(hm),ae.current=!1,se(!1),O.current=new Date;const me=_c(V.current,j);if(!Pe||!Pr(Pe.target,!1)||!me||Number.isNaN(me)||X.current===null)return;const ye=O.current.getTime()-X.current.getTime(),fe=q.current-(At(j)?Pe.pageY:Pe.pageX),ge=Math.abs(fe)/ye;if(ge>.05&&(U(!0),setTimeout(()=>{U(!1)},200)),i){He({draggedDistance:fe*(j==="bottom"||j==="right"?1:-1),closeDrawer:gr,velocity:ge,dismissible:u}),s==null||s(Pe,!0);return}if(j==="bottom"||j==="right"?fe>0:fe<0){Ct(),s==null||s(Pe,!0);return}if(ge>eN){gr(),s==null||s(Pe,!1);return}var Ve;const ie=Math.min((Ve=V.current.getBoundingClientRect().height)!=null?Ve:0,window.innerHeight);var Ce;const Te=Math.min((Ce=V.current.getBoundingClientRect().width)!=null?Ce:0,window.innerWidth),xt=j==="left"||j==="right";if(Math.abs(me)>=(xt?Te:ie)*c){gr(),s==null||s(Pe,!1);return}s==null||s(Pe,!0),Ct()}I.useEffect(()=>(B&&($t(document.documentElement,{scrollBehavior:"auto"}),J.current=new Date),()=>{k5(document.documentElement,"scrollBehavior")}),[B]);function er(Pe){const me=Pe?(window.innerWidth-gs)/window.innerWidth:1,ye=Pe?-gs:0;W.current&&window.clearTimeout(W.current),$t(V.current,{transition:`transform ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,transform:At(j)?`scale(${me}) translate3d(0, ${ye}px, 0)`:`scale(${me}) translate3d(${ye}px, 0, 0)`}),!Pe&&V.current&&(W.current=setTimeout(()=>{const fe=_c(V.current,j);$t(V.current,{transition:"none",transform:At(j)?`translate3d(0, ${fe}px, 0)`:`translate3d(${fe}px, 0, 0)`})},500))}function Mn(Pe,me){if(me<0)return;const ye=(window.innerWidth-gs)/window.innerWidth,fe=ye+me*(1-ye),ge=-gs+me*gs;$t(V.current,{transform:At(j)?`scale(${fe}) translate3d(0, ${ge}px, 0)`:`scale(${fe}) translate3d(${ge}px, 0, 0)`,transition:"none"})}function ta(Pe,me){const ye=At(j)?window.innerHeight:window.innerWidth,fe=me?(ye-gs)/ye:1,ge=me?-gs:0;me&&$t(V.current,{transition:`transform ${vt.DURATION}s cubic-bezier(${vt.EASE.join(",")})`,transform:At(j)?`scale(${fe}) translate3d(0, ${ge}px, 0)`:`scale(${fe}) translate3d(${ge}px, 0, 0)`})}return I.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),I.createElement(Il,{defaultOpen:k,onOpenChange:Pe=>{!u&&!Pe||(Pe?Q(!0):gr(!0),E(Pe))},open:B},I.createElement(V1.Provider,{value:{activeSnapPoint:H,snapPoints:i,setActiveSnapPoint:De,drawerRef:V,overlayRef:G,onOpenChange:t,onPress:mn,onRelease:qt,onDrag:hn,dismissible:u,shouldAnimate:Z,handleOnly:f,isOpen:B,isDragging:K,shouldFade:gt,closeDrawer:gr,onNestedDrag:Mn,onNestedOpenChange:er,onNestedRelease:ta,keyboardIsOpen:le,modal:v,snapPointsOffset:Fe,activeSnapPointIndex:ve,direction:j,shouldScaleBackground:o,setBackgroundColorOnScale:l,noBodyStyles:N,container:M,autoFocus:P}},r))}const aN=I.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:s,shouldFade:i,isOpen:o,modal:l,shouldAnimate:c}=Gl(),d=Z1(t,r),u=n&&n.length>0;if(!l)return null;const f=I.useCallback(m=>s(m),[s]);return I.createElement(ai,{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})});aN.displayName="Drawer.Overlay";const sN=I.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:g,snapPoints:x,container:v,handleOnly:y,shouldAnimate:w,autoFocus:N}=Gl(),[j,k]=I.useState(!1),b=Z1(s,i),C=I.useRef(null),S=I.useRef(null),_=I.useRef(!1),A=x&&x.length>0;A5();const M=(T,D,B=0)=>{if(_.current)return!0;const E=Math.abs(T.y),z=Math.abs(T.x),Q=z>E,K=["bottom","right"].includes(D)?1:-1;if(D==="left"||D==="right"){if(!(T.x*K<0)&&z>=0&&z<=B)return Q}else if(!(T.y*K<0)&&E>=0&&E<=B)return!Q;return _.current=!0,!0};I.useEffect(()=>{A&&window.requestAnimationFrame(()=>{k(!0)})},[]);function P(T){C.current=null,_.current=!1,l(T)}return I.createElement(si,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":j?"true":"false","data-vaul-snap-points":p&&A?"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:T=>{y||(n.onPointerDown==null||n.onPointerDown.call(n,T),C.current={x:T.pageX,y:T.pageY},o(T))},onOpenAutoFocus:T=>{r==null||r(T),N||T.preventDefault()},onPointerDownOutside:T=>{if(e==null||e(T),!m||T.defaultPrevented){T.preventDefault();return}d.current&&(d.current=!1)},onFocusOutside:T=>{if(!m){T.preventDefault();return}},onPointerMove:T=>{if(S.current=T,y||(n.onPointerMove==null||n.onPointerMove.call(n,T),!C.current))return;const D=T.pageY-C.current.y,B=T.pageX-C.current.x,E=T.pointerType==="touch"?10:2;M({x:B,y:D},g,E)?c(T):(Math.abs(B)>E||Math.abs(D)>E)&&(C.current=null)},onPointerUp:T=>{n.onPointerUp==null||n.onPointerUp.call(n,T),C.current=null,_.current=!1,l(T)},onPointerOut:T=>{n.onPointerOut==null||n.onPointerOut.call(n,T),P(S.current)},onContextMenu:T=>{n.onContextMenu==null||n.onContextMenu.call(n,T),S.current&&P(S.current)}})});sN.displayName="Drawer.Content";const I5=250,R5=120,$5=I.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}=Gl(),g=I.useRef(null),x=I.useRef(!1);function v(){if(x.current){N();return}window.setTimeout(()=>{y()},R5)}function y(){if(i||e||x.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(C=>C===l);if(k===-1)return;const b=o[k+1];c(b)}function w(){g.current=window.setTimeout(()=>{x.current=!0},I5)}function N(){g.current&&window.clearTimeout(g.current),x.current=!1}return I.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},I.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});$5.displayName="Drawer.Handle";function z5(e){const t=Gl(),{container:r=t.container,...n}=e;return I.createElement(Tl,{container:r,...n})}const Da={Root:T5,Content:sN,Overlay:aN,Portal:z5,Title:Qi,Description:Zi},li=({shouldScaleBackground:e=!1,direction:t="right",...r})=>a.jsx(Da.Root,{shouldScaleBackground:e,direction:t,...r});li.displayName="Drawer";const L5=Da.Portal,iN=h.forwardRef(({className:e,...t},r)=>a.jsx(Da.Overlay,{ref:r,className:R("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}));iN.displayName=Da.Overlay.displayName;const ci=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(L5,{children:[a.jsx(iN,{}),a.jsx(Da.Content,{ref:n,className:R("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 oo=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col space-y-1.5 px-6 pt-6 pb-4 border-b border-border shrink-0",e),...t});oo.displayName="DrawerHeader";const lo=({className:e,...t})=>a.jsx("div",{className:R("flex-1 overflow-y-auto px-6 py-4",e),...t});lo.displayName="DrawerBody";const Vl=({className:e,...t})=>a.jsx("div",{className:R("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});Vl.displayName="DrawerFooter";const co=h.forwardRef(({className:e,...t},r)=>a.jsx(Da.Title,{ref:r,className:R("text-base font-semibold text-foreground",e),...t}));co.displayName=Da.Title.displayName;const F5=h.forwardRef(({className:e,...t},r)=>a.jsx(Da.Description,{ref:r,className:R("text-sm text-muted-foreground",e),...t}));F5.displayName=Da.Description.displayName;const B5=$l("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ut=h.forwardRef(({className:e,...t},r)=>a.jsx(_j,{ref:r,className:R(B5(),e),...t}));ut.displayName=_j.displayName;const Wu=h.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:R("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}));Wu.displayName="Textarea";const qv=[{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}],pm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"];function W5(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function U5({chip:e,onRemove:t}){const{attributes:r,listeners:n,setNodeRef:s,transform:i,transition:o,isDragging:l}=Ap({id:e.key});return a.jsxs("div",{ref:s,style:{transform:Dp.Transform.toString(i),transition:o},className:R("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(w1,{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(at,{className:"h-3 w-3"})})]})}const q5=3;function H5({open:e,onClose:t}){var B;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(qv),[g,x]=h.useState(""),[v,y]=h.useState(pm[2]),{workspace:w}=Ie(),N=aT(),j=rT(r,{enabled:e}),k=nT(s,{enabled:e});h.useEffect(()=>{e&&j.data&&!c&&i(j.data)},[e,j.data,c]);const b=k.available===!1||N.isError&&((B=N.error)==null?void 0:B.status)===409,C=s.trim().length>=q5&&/^[A-Z0-9]+$/i.test(s.trim()),S=Bj(Mp(Wj,{activationConstraint:{distance:5}})),_=E=>{n(E)},A=()=>{r.trim()&&!c&&j.flush()},M=()=>{n(""),i(""),l(""),d(!1),f(!1),p(qv),x(""),y(pm[2]),N.reset(),t()},P=()=>{if(!g.trim())return;const E=W5(g.trim());if(m.some(z=>z.key===E)){L.error("A status with this name already exists");return}p(z=>[...z,{name:g.trim(),key:E,color:v,category:"started",position:z.length}]),x("")},T=E=>{const{active:z,over:Q}=E;!Q||z.id===Q.id||p(K=>{const se=K.findIndex(U=>U.key===z.id),te=K.findIndex(U=>U.key===Q.id);return td(K,se,te).map((U,G)=>({...U,position:G}))})},D=E=>{E.preventDefault(),!(!r.trim()||!s.trim()||!C||b)&&N.mutate({name:r.trim(),identifier:s.trim().toUpperCase(),description:o.trim()||void 0,workspace_id:w.id,initial_statuses:m},{onSuccess:()=>{L.success("Project created"),M()},onError:z=>{(z==null?void 0:z.status)===409?L.error("This project key is already in use."):L.error(z.message??"Failed to create project")}})};return a.jsx(li,{open:e,onOpenChange:E=>!E&&M(),dismissible:!1,children:a.jsxs(ci,{className:"max-w-md",children:[a.jsx(oo,{children:a.jsx(co,{children:"New project"})}),a.jsxs("form",{onSubmit:D,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(lo,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ut,{htmlFor:"project-name",children:"Name"}),a.jsx(Ae,{id:"project-name",placeholder:"My Project",value:r,onChange:E=>_(E.target.value),onBlur:A,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(ut,{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(Ae,{id:"project-id",placeholder:"PROJ",value:s,onChange:E=>{i(E.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"")),d(!0)},maxLength:5,className:R("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(ut,{htmlFor:"project-desc",children:["Description",a.jsx("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Wu,{id:"project-desc",placeholder:"What is this project about?",value:o,onChange:E=>l(E.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(Vn,{className:"h-3.5 w-3.5"}):a.jsx(_n,{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(al,{sensors:S,onDragEnd:T,children:a.jsx(Ep,{items:m.map(E=>E.key),strategy:Uj,children:a.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(E=>a.jsx(U5,{chip:E,onRemove:()=>p(z=>z.filter(Q=>Q.key!==E.key).map((Q,K)=>({...Q,position:K})))},E.key))})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:pm.map(E=>a.jsx("button",{type:"button",onClick:()=>y(E),className:R("h-4 w-4 rounded-full border-2 transition-transform hover:scale-110",v===E?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:E}},E))}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-1",children:[a.jsx(Ae,{placeholder:"Status name…",value:g,onChange:E=>x(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),P())},className:"h-7 text-xs flex-1"}),a.jsx(ee,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 shrink-0",onClick:P,disabled:!g.trim(),children:a.jsx(ct,{className:"h-3.5 w-3.5"})})]})]})]})]})]}),a.jsxs(Vl,{children:[a.jsx(ee,{type:"button",variant:"ghost",onClick:M,children:"Cancel"}),a.jsx(ee,{type:"submit",disabled:!r.trim()||!s.trim()||!C||b||N.isPending,children:N.isPending?"Creating...":"Create project"})]})]})]})})}const Be=pM,Ye=gM,ze=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Oj,{ref:n,className:R("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(dM,{asChild:!0,children:a.jsx(Vn,{className:"h-4 w-4 opacity-50"})})]}));ze.displayName=Oj.displayName;const oN=h.forwardRef(({className:e,...t},r)=>a.jsx(Pj,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(zp,{className:"h-4 w-4"})}));oN.displayName=Pj.displayName;const lN=h.forwardRef(({className:e,...t},r)=>a.jsx(Mj,{ref:r,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Vn,{className:"h-4 w-4"})}));lN.displayName=Mj.displayName;const Le=h.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>a.jsx(uM,{children:a.jsxs(Ej,{ref:s,className:R("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(oN,{}),a.jsx(fM,{className:R("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(lN,{})]})}));Le.displayName=Ej.displayName;const K5=h.forwardRef(({className:e,...t},r)=>a.jsx(Aj,{ref:r,className:R("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t}));K5.displayName=Aj.displayName;const Ne=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(Dj,{ref:n,className:R("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(mM,{children:a.jsx(ir,{className:"h-4 w-4"})})}),a.jsx(hM,{children:t})]}));Ne.displayName=Dj.displayName;const Y5=h.forwardRef(({className:e,...t},r)=>a.jsx(Tj,{ref:r,className:R("-mx-1 my-1 h-px bg-border",e),...t}));Y5.displayName=Tj.displayName;function G5({open:e,onClose:t,projectId:r,projectName:n}){const{workspace:s}=Ie(),i=(s==null?void 0:s.id)??"",{data:o,isLoading:l}=Qn(r),{data:c}=ql(i),{data:d}=Pu(i),u=R1(r),f=$1(r),m=z1(r),p=L1(r),[g,x]=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(Ma,{open:e,onOpenChange:b=>!b&&t(),children:a.jsxs(Zn,{className:"sm:max-w-[480px]",children:[a.jsx(Ea,{children:a.jsxs(Aa,{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(ue,{className:"h-7 w-7 rounded-full"}),a.jsx(ue,{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 P;const C=b.user,S=(C==null?void 0:C.first_name)??"",_=(C==null?void 0:C.last_name)??"",A=`${S} ${_}`.trim()||(C==null?void 0:C.email)||"Unknown",M=(S[0]??_[0]??((P=C==null?void 0:C.email)==null?void 0:P[0])??"U").toUpperCase();return a.jsxs("div",{className:"flex items-center gap-2.5 py-1 group",children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:M})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:A}),a.jsx("span",{className:R("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:()=>L.success("Access removed"),onError:()=>L.error("Failed to remove")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(at,{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(no,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx(Le,{children:j.map(b=>{const C=b.user,S=(C==null?void 0:C.first_name)??"",_=(C==null?void 0:C.last_name)??"",A=`${S} ${_}`.trim()||(C==null?void 0:C.email)||"Unknown";return a.jsx(Ne,{value:b.user_id,children:A},b.user_id)})})]}),g&&a.jsx(ee,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:u.isPending,onClick:()=>u.mutate({userId:g},{onSuccess:()=>{L.success("Access granted"),x("")},onError:()=>L.error("Failed to grant access")}),children:"Add"})]})]}),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(ue,{className:"h-7 w-7 rounded-lg"}),a.jsx(ue,{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 C=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(Fs,{className:"h-3.5 w-3.5 text-muted-foreground"})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:(C==null?void 0:C.name)??"Unknown team"}),C&&a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[C.member_count," ",C.member_count===1?"member":"members"]}),a.jsx("button",{onClick:()=>p.mutate(b.team_id,{onSuccess:()=>L.success("Team access removed"),onError:()=>L.error("Failed to remove team")}),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",children:a.jsx(at,{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(Fs,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs flex-1",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx(Le,{children:k.map(b=>a.jsx(Ne,{value:b.id,children:b.name},b.id))})]}),v&&a.jsx(ee,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:m.isPending,onClick:()=>m.mutate(v,{onSuccess:()=>{L.success("Team access granted"),y("")},onError:()=>L.error("Failed to add team")}),children:"Add"})]})]}),a.jsx("div",{className:"flex justify-end pt-1",children:a.jsx(ee,{variant:"outline",size:"sm",onClick:t,children:"Close"})})]})]})})}const cN=6048e5,V5=864e5,X5=36e5,Oc=43200,Hv=1440,Kv=Symbol.for("constructDateFrom");function wt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kv in e?e[Kv](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ue(e,t){return wt(t||e,e)}function Ir(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(t)?wt((r==null?void 0:r.in)||e,NaN):(t&&n.setDate(n.getDate()+t),n)}function tg(e,t,r){const n=Ue(e,r==null?void 0:r.in);if(isNaN(t))return wt((r==null?void 0:r.in)||e,NaN);if(!t)return n;const s=n.getDate(),i=wt((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 Q5={};function uo(){return Q5}function Ri(e,t){var l,c,d,u;const r=uo(),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=Ue(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 dl(e,t){return Ri(e,{...t,weekStartsOn:1})}function dN(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=wt(r,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=dl(s),o=wt(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=dl(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=l.getTime()?n:n-1}function fd(e){const t=Ue(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 Jn(e,...t){const r=wt.bind(null,e||t.find(n=>typeof n=="object"));return t.map(r)}function $i(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function Uu(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t),i=$i(n),o=$i(s),l=+i-fd(i),c=+o-fd(o);return Math.round((l-c)/V5)}function Z5(e,t){const r=dN(e,t),n=wt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),dl(n)}function J5(e,t,r){return Ir(e,t*7,r)}function e3(e,t,r){return tg(e,t*12,r)}function t3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=wt.bind(null,s));const i=Ue(s,n);(!r||r<i||isNaN(+i))&&(r=i)}),wt(n,r||NaN)}function r3(e,t){let r,n=t==null?void 0:t.in;return e.forEach(s=>{!n&&typeof s=="object"&&(n=wt.bind(null,s));const i=Ue(s,n);(!r||r>i||isNaN(+i))&&(r=i)}),wt(n,r||NaN)}function rd(e,t){const r=+Ue(e)-+Ue(t);return r<0?-1:r>0?1:r}function rg(e){return wt(e,Date.now())}function zi(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t);return+$i(n)==+$i(s)}function uN(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function n3(e){return!(!uN(e)&&typeof e!="number"||isNaN(+Ue(e)))}function ng(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t),i=n.getFullYear()-s.getFullYear(),o=n.getMonth()-s.getMonth();return i*12+o}function fN(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t),i=Yv(n,s),o=Math.abs(Uu(n,s));n.setDate(n.getDate()-i*o);const l=+(Yv(n,s)===-i),c=i*(o-l);return c===0?0:c}function Yv(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 mN(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function a3(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t),i=(+n-+s)/X5;return mN(r==null?void 0:r.roundingMethod)(i)}function s3(e,t){return+Ue(e)-+Ue(t)}function hN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function ag(e,t){const r=Ue(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 i3(e,t){const r=Ue(e,t==null?void 0:t.in);return+hN(r,t)==+ag(r,t)}function pN(e,t,r){const[n,s,i]=Jn(r==null?void 0:r.in,e,e,t),o=rd(s,i),l=Math.abs(ng(s,i));if(l<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*l);let c=rd(s,i)===-o;i3(n)&&l===1&&rd(n,i)===1&&(c=!1);const d=o*(l-+c);return d===0?0:d}function o3(e,t,r){const n=s3(e,t)/1e3;return mN(r==null?void 0:r.roundingMethod)(n)}function gN(e,t){const[r,n]=Jn(e,t.start,t.end);return{start:r,end:n}}function l3(e,t){const{start:r,end:n}=gN(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(wt(r,o)),o.setMonth(o.getMonth()+l);return s?c.reverse():c}function xN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function c3(e,t){const r=Ue(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 vN(e,t){const r=Ue(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function d3(e,t){const{start:r,end:n}=gN(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(wt(r,o)),o.setFullYear(o.getFullYear()+l);return s?c.reverse():c}function yN(e,t){var l,c,d,u;const r=uo(),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=Ue(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 u3(e,t){return yN(e,{...t,weekStartsOn:1})}const f3={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"}},m3=(e,t,r)=>{let n;const s=f3[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 gm(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const h3={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p3={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g3={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},x3={date:gm({formats:h3,defaultWidth:"full"}),time:gm({formats:p3,defaultWidth:"full"}),dateTime:gm({formats:g3,defaultWidth:"full"})},v3={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},y3=(e,t,r,n)=>v3[e];function Do(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 b3={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w3={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},j3={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"]},N3={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"]},k3={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"}},S3={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"}},C3=(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"},_3={ordinalNumber:C3,era:Do({values:b3,defaultWidth:"wide"}),quarter:Do({values:w3,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Do({values:j3,defaultWidth:"wide"}),day:Do({values:N3,defaultWidth:"wide"}),dayPeriod:Do({values:k3,defaultWidth:"wide",formattingValues:S3,defaultFormattingWidth:"wide"})};function To(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)?P3(l,f=>f.test(o)):O3(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 O3(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function P3(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function M3(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 E3=/^(\d+)(th|st|nd|rd)?/i,A3=/\d+/i,D3={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},T3={any:[/^b/i,/^(a|c)/i]},I3={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},R3={any:[/1/i,/2/i,/3/i,/4/i]},$3={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},z3={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]},L3={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},F3={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]},B3={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},W3={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}},U3={ordinalNumber:M3({matchPattern:E3,parsePattern:A3,valueCallback:e=>parseInt(e,10)}),era:To({matchPatterns:D3,defaultMatchWidth:"wide",parsePatterns:T3,defaultParseWidth:"any"}),quarter:To({matchPatterns:I3,defaultMatchWidth:"wide",parsePatterns:R3,defaultParseWidth:"any",valueCallback:e=>e+1}),month:To({matchPatterns:$3,defaultMatchWidth:"wide",parsePatterns:z3,defaultParseWidth:"any"}),day:To({matchPatterns:L3,defaultMatchWidth:"wide",parsePatterns:F3,defaultParseWidth:"any"}),dayPeriod:To({matchPatterns:B3,defaultMatchWidth:"any",parsePatterns:W3,defaultParseWidth:"any"})},Cs={code:"en-US",formatDistance:m3,formatLong:x3,formatRelative:y3,localize:_3,match:U3,options:{weekStartsOn:0,firstWeekContainsDate:1}};function q3(e,t){const r=Ue(e,t==null?void 0:t.in);return Uu(r,vN(r))+1}function sg(e,t){const r=Ue(e,t==null?void 0:t.in),n=+dl(r)-+Z5(r);return Math.round(n/cN)+1}function bN(e,t){var u,f,m,p;const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=uo(),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=wt((t==null?void 0:t.in)||e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Ri(o,t),c=wt((t==null?void 0:t.in)||e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=Ri(c,t);return+r>=+l?n+1:+r>=+d?n:n-1}function H3(e,t){var l,c,d,u;const r=uo(),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=bN(e,t),i=wt((t==null?void 0:t.in)||e,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Ri(i,t)}function ig(e,t){const r=Ue(e,t==null?void 0:t.in),n=+Ri(r,t)-+H3(r,t);return Math.round(n/cN)+1}function Je(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const Ha={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Je(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Je(r+1,2)},d(e,t){return Je(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 Je(e.getHours()%12||12,t.length)},H(e,t){return Je(e.getHours(),t.length)},m(e,t){return Je(e.getMinutes(),t.length)},s(e,t){return Je(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return Je(s,t.length)}},gi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Gv={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 Ha.y(e,t)},Y:function(e,t,r,n){const s=bN(e,n),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return Je(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Je(i,t.length)},R:function(e,t){const r=dN(e);return Je(r,t.length)},u:function(e,t){const r=e.getFullYear();return Je(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 Je(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 Je(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 Ha.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 Je(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=ig(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):Je(s,t.length)},I:function(e,t,r){const n=sg(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Je(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):Ha.d(e,t)},D:function(e,t,r){const n=q3(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Je(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 Je(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 Je(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 Je(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=gi.noon:n===0?s=gi.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=gi.evening:n>=12?s=gi.afternoon:n>=4?s=gi.morning:s=gi.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 Ha.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):Ha.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Je(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Je(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ha.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Ha.s(e,t)},S:function(e,t){return Ha.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Xv(n);case"XXXX":case"XX":return ys(n);case"XXXXX":case"XXX":default:return ys(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Xv(n);case"xxxx":case"xx":return ys(n);case"xxxxx":case"xxx":default:return ys(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vv(n,":");case"OOOO":default:return"GMT"+ys(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vv(n,":");case"zzzz":default:return"GMT"+ys(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return Je(n,t.length)},T:function(e,t,r){return Je(+e,t.length)}};function Vv(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+Je(i,2)}function Xv(e,t){return e%60===0?(e>0?"-":"+")+Je(Math.abs(e)/60,2):ys(e,t)}function ys(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Je(Math.trunc(n/60),2),i=Je(n%60,2);return r+s+t+i}const Qv=(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"})}},wN=(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"})}},K3=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return Qv(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}}",Qv(n,t)).replace("{{time}}",wN(s,t))},Y3={p:wN,P:K3},G3=/^D+$/,V3=/^Y+$/,X3=["D","DD","YY","YYYY"];function Q3(e){return G3.test(e)}function Z3(e){return V3.test(e)}function J3(e,t,r){const n=eI(e,t,r);if(console.warn(n),X3.includes(e))throw new RangeError(n)}function eI(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 tI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nI=/^'([^]*?)'?$/,aI=/''/g,sI=/[a-zA-Z]/;function he(e,t,r){var u,f,m,p,g,x,v,y;const n=uo(),s=(r==null?void 0:r.locale)??n.locale??Cs,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)??((x=(g=r==null?void 0:r.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??n.weekStartsOn??((y=(v=n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=Ue(e,r==null?void 0:r.in);if(!n3(l))throw new RangeError("Invalid time value");let c=t.match(rI).map(w=>{const N=w[0];if(N==="p"||N==="P"){const j=Y3[N];return j(w,s.formatLong)}return w}).join("").match(tI).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const N=w[0];if(N==="'")return{isToken:!1,value:iI(w)};if(Gv[N])return{isToken:!0,value:w};if(N.match(sI))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)&&Z3(N)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&Q3(N))&&J3(N,t,String(e));const j=Gv[N[0]];return j(l,N,s.localize,d)}).join("")}function iI(e){const t=e.match(nI);return t?t[1].replace(aI,"'"):e}function gh(e,t,r){const n=uo(),s=(r==null?void 0:r.locale)??n.locale??Cs,i=2520,o=rd(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]=Jn(r==null?void 0:r.in,...o>0?[t,e]:[e,t]),u=o3(d,c),f=(fd(d)-fd(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<Hv){const g=Math.round(m/60);return s.formatDistance("aboutXHours",g,l)}else{if(m<i)return s.formatDistance("xDays",1,l);if(m<Oc){const g=Math.round(m/Hv);return s.formatDistance("xDays",g,l)}else if(m<Oc*2)return p=Math.round(m/Oc),s.formatDistance("aboutXMonths",p,l)}if(p=pN(d,c),p<12){const g=Math.round(m/Oc);return s.formatDistance("xMonths",g,l)}else{const g=p%12,x=Math.trunc(p/12);return g<3?s.formatDistance("aboutXYears",x,l):g<9?s.formatDistance("overXYears",x,l):s.formatDistance("almostXYears",x+1,l)}}function oI(e,t){return gh(e,rg(e),t)}function sl(e,t){return Ue(e,t==null?void 0:t.in).getDate()}function lI(e,t){return Ue(e,t==null?void 0:t.in).getDay()}function as(e,t){const r=Ue(e,t==null?void 0:t.in),n=r.getFullYear(),s=r.getMonth(),i=wt(r,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function nd(e,t){return Ue(e,t==null?void 0:t.in).getMonth()}function cI(e,t){return Ue(e,t==null?void 0:t.in).getFullYear()}function dI(e,t){return+Ue(e)>+Ue(t)}function uI(e,t){return+Ue(e)<+Ue(t)}function fI(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function mI(e,t,r){const[n,s]=Jn(r==null?void 0:r.in,e,t);return n.getFullYear()===s.getFullYear()}function hI(e,t){return zi(wt(e,e),rg(e))}function jN(e,t,r){return Ir(e,-1,r)}function pI(e,t){return zi(wt(e,e),jN(rg(e)))}function gI(e,t,r){const n=Ue(e,r==null?void 0:r.in),s=n.getFullYear(),i=n.getDate(),o=wt(e,0);o.setFullYear(s,t,15),o.setHours(0,0,0,0);const l=as(o);return n.setMonth(t,Math.min(i,l)),n}function xI(e,t,r){const n=Ue(e,r==null?void 0:r.in);return isNaN(+n)?wt(e,NaN):(n.setFullYear(t),n)}function vI(){const[e,t]=h.useState(!1),[r,n]=h.useState(null),[s,i]=h.useState(""),[o,l]=h.useState("all"),{workspace:c}=Vt(),{data:d,isLoading:u}=so(),f=sT(),m=St(),p=(d??[]).filter(g=>(o==="all"||g.status===o)&&(!s||g.name.toLowerCase().includes(s.toLowerCase())||g.identifier.toLowerCase().includes(s.toLowerCase())));return a.jsxs("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-4 border-b border-border",children:[a.jsx("h1",{className:"text-base font-semibold",children:"Projects"}),a.jsxs(ee,{size:"sm",onClick:()=>t(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"Create"]})]}),a.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("div",{className:"flex items-center gap-1",children:["all","active","paused","archived"].map(g=>a.jsx("button",{onClick:()=>l(g),className:R("px-3 h-7 rounded-md text-xs font-medium transition-colors",o===g?"bg-foreground text-background":"text-muted-foreground hover:text-foreground hover:bg-muted"),children:g==="all"?"All":g.charAt(0).toUpperCase()+g.slice(1)},g))}),a.jsxs("div",{className:"relative",children:[a.jsx(Ul,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:s,onChange:g=>i(g.target.value),className:"pl-8 h-8 w-[200px] text-xs bg-transparent"})]})]}),a.jsxs("div",{className:"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(g=>a.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_40px] items-center px-6 py-3",children:[a.jsx(ue,{className:"h-4 w-48"}),a.jsx(ue,{className:"h-4 w-12"}),a.jsx(ue,{className:"h-5 w-16 rounded-full"}),a.jsx(ue,{className:"h-4 w-24"}),a.jsx("div",{})]},g))}):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(Rr,{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(ee,{size:"sm",onClick:()=>t(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"Create project"]})]}):a.jsx("div",{className:"divide-y divide-border",children:p.map(g=>a.jsxs("div",{className:"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/${g.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:g.name}),g.description&&a.jsx("span",{className:"text-xs text-muted-foreground truncate hidden xl:block",children:g.description})]}),a.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:g.identifier}),a.jsx("div",{children:a.jsxs("span",{className:R("inline-flex items-center gap-1.5 text-xs",g.status==="active"&&"text-emerald-600",g.status==="paused"&&"text-amber-600",g.status==="archived"&&"text-muted-foreground"),children:[a.jsx("span",{className:R("h-1.5 w-1.5 rounded-full shrink-0",g.status==="active"&&"bg-emerald-500",g.status==="paused"&&"bg-amber-500",g.status==="archived"&&"bg-zinc-400")}),g.status.charAt(0).toUpperCase()+g.status.slice(1)]})}),a.jsx("span",{className:"text-sm text-muted-foreground",children:he(new Date(g.created_at),"MMM d, yyyy")}),a.jsx("div",{className:"flex justify-end",onClick:x=>x.stopPropagation(),children:a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsx(ee,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx(cs,{className:"h-4 w-4"})})}),a.jsxs(zr,{align:"end",children:[a.jsxs(bt,{onClick:()=>m(`/${c}/projects/${g.identifier}/board`),children:[a.jsx(Rr,{className:"h-4 w-4"}),"Open board"]}),a.jsxs(bt,{onClick:()=>m(`/${c}/projects/${g.identifier}/issues`),children:[a.jsx(ga,{className:"h-4 w-4"}),"View issues"]}),a.jsxs(bt,{onClick:()=>n({id:g.id,name:g.name}),children:[a.jsx(ro,{className:"h-4 w-4"}),"Manage access"]}),a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:()=>{confirm(`Delete "${g.name}"? This cannot be undone.`)&&f.mutate(g.id,{onSuccess:()=>L.success("Project deleted"),onError:()=>L.error("Failed to delete project")})},children:[a.jsx($r,{className:"h-4 w-4"}),"Delete"]})]})]})})]},g.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(ee,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Prev"}),a.jsx(ee,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:!0,children:"Next"})]})]})]}),a.jsx(H5,{open:e,onClose:()=>t(!1)}),r&&a.jsx(G5,{open:!!r,onClose:()=>n(null),projectId:r.id,projectName:r.name})]})}const Xl={byProject:e=>["projects",e,"statuses"]};function fo(e){return We({queryKey:Xl.byProject(e??""),queryFn:()=>re.get(`/admin/projects/${e}/statuses`),select:t=>t.statuses,enabled:!!e})}function yI(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/projects/${e}/statuses`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Xl.byProject(e)})}})}function bI(e,t){const r=Se();return be({mutationFn:n=>re.put(`/admin/projects/${e}/statuses/${t}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Xl.byProject(e)})}})}function wI(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/projects/${e}/statuses/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Xl.byProject(e)})}})}function jI(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/projects/${e}/statuses/reorder`,{orderedIds:r}),onSuccess:()=>{t.invalidateQueries({queryKey:Xl.byProject(e)})}})}const Ql={all:["users"],list:()=>[...Ql.all,"list"]};function Zl(){return We({queryKey:Ql.list(),queryFn:()=>re.get("/admin/users"),select:e=>e.users,staleTime:1e3*60*5})}const qu={all:["org-invitations"],list:()=>[...qu.all,"list"]};function NI(){return We({queryKey:qu.list(),queryFn:()=>re.get("/admin/users/invitations"),select:e=>e.invitations,staleTime:1e3*30})}function kI(){const e=Se();return be({mutationFn:t=>re.delete(`/admin/users/invitations/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:qu.list()})})}function SI(){const e=Se();return be({mutationFn:({email:t,role:r})=>re.post("/admin/users/invite",{email:t,role:r}),onSuccess:()=>e.invalidateQueries({queryKey:qu.list()})})}function CI(){const e=Se();return be({mutationFn:({userId:t,role:r})=>re.patch(`/admin/users/${t}`,{role:r}),onSuccess:()=>e.invalidateQueries({queryKey:Ql.list()})})}function _I(){const e=Se();return be({mutationFn:t=>re.delete(`/admin/users/${t}`),onSuccess:()=>e.invalidateQueries({queryKey:Ql.list()})})}function di(){return We({queryKey:[...Ql.list(),"map"],queryFn:()=>re.get("/admin/users"),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 Us={backlog:"Backlog",todo:"Todo",in_progress:"In Progress",in_review:"In Review",done:"Done",cancelled:"Cancelled"},kn={urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None"},og={urgent:"text-red-500",high:"text-orange-500",medium:"text-yellow-500",low:"text-blue-400",none:"text-zinc-400"},ss={task:"Task",bug:"Bug",feature:"Feature",improvement:"Improvement",epic:"Epic"},OI=({priority:e})=>{const t=R("h-3 w-3 shrink-0",og[e]);switch(e){case"urgent":return a.jsx(ds,{className:t});case"high":return a.jsx(Fl,{className:t});case"medium":return a.jsx(oi,{className:t});case"low":return a.jsx(zl,{className:t});default:return a.jsx(sn,{className:"h-3 w-3 shrink-0 text-zinc-300"})}};function NN({issue:e,childCount:t=0,onClick:r}){var f,m;const{data:n}=di(),{attributes:s,listeners:i,setNodeRef:o,transform:l,transition:c,isDragging:d}=Ap({id:e.id}),u={transform:Dp.Transform.toString(l),transition:c};return a.jsxs("div",{ref:o,style:u,...s,...i,onClick:r,className:R("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 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(jn,{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(jn,{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 g=n==null?void 0:n.get(p);return a.jsx(Ft,{className:"h-4 w-4 border border-background",children:a.jsx(Bt,{className:"text-[8px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:(g==null?void 0:g.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(OI,{priority:e.priority})]})]})]})}function Pc(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 PI=({category:e,color:t})=>{const r="h-3.5 w-3.5 shrink-0",n={color:t};switch(e){case"completed":return a.jsx(ls,{className:r,style:n});case"started":return a.jsx(Xn,{className:r,style:n});default:return a.jsx(sn,{className:r,style:n})}};function MI({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:g}){const{setNodeRef:x,isOver:v}=qM({id:e}),{attributes:y,listeners:w,setNodeRef:N,transform:j,transition:k,isDragging:b}=Ap({id:e,disabled:!o}),C=h.useRef(null),S=h.useRef(!1);h.useEffect(()=>{u&&(S.current=!1,setTimeout(()=>{var D;return(D=C.current)==null?void 0:D.focus()},0))},[u]);const _=o?{transform:Dp.Transform.toString(j),transition:k}:void 0,A=Pc(r,.08),M=Pc(r,.16),P=Pc(r,.35),T=!!(c||d);return a.jsxs("div",{ref:N,style:_,className:R("flex flex-col min-w-[260px] max-w-[280px] w-full group/col",b&&"opacity-50"),children:[a.jsxs("div",{className:R("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(w1,{className:"h-3.5 w-3.5"})}),a.jsx(PI,{category:n,color:r}),u?a.jsx("input",{ref:C,value:f??"",onChange:D=>m==null?void 0:m(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),p==null||p()),D.key==="Escape"&&(D.preventDefault(),S.current=!0,g==null||g())},onBlur:()=>{S.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:Pc(r,.12),color:r},children:s.length}),T&&!u&&a.jsxs(Xr,{children:[a.jsx(Qr,{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:D=>D.stopPropagation(),children:a.jsx(cs,{className:"h-3.5 w-3.5"})})}),a.jsxs(zr,{align:"end",className:"w-40",children:[c&&a.jsx(bt,{onClick:c,children:"Rename"}),c&&d&&a.jsx(qn,{}),d&&a.jsx(bt,{className:"text-destructive focus:text-destructive",onClick:d,children:"Delete status"})]})]})]}),a.jsxs("div",{ref:x,className:R("flex-1 flex flex-col gap-2 min-h-[200px] p-2 rounded-xl transition-colors"),style:{backgroundColor:v?M:A,boxShadow:v?`inset 0 0 0 1px ${P}`:void 0},children:[a.jsx(Ep,{items:s.map(D=>D.id),strategy:HM,children:s.map(D=>a.jsx(NN,{issue:D,childCount:(i==null?void 0:i.get(D.id))??0,onClick:()=>l==null?void 0:l(D)},D.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 xm=["#94a3b8","#64748b","#6366f1","#f59e0b","#10b981","#ef4444","#3b82f6","#8b5cf6"],EI=[{value:"backlog",label:"Backlog"},{value:"unstarted",label:"Not Started"},{value:"started",label:"In Progress"},{value:"completed",label:"Done"},{value:"cancelled",label:"Cancelled"}];function AI({open:e,onClose:t,projectId:r}){const[n,s]=h.useState(""),[i,o]=h.useState(xm[0]),[l,c]=h.useState(""),[d,u]=h.useState("started"),f=yI(r),m=l||i,p=()=>{n.trim()&&f.mutate({name:n.trim(),color:m,category:d},{onSuccess:()=>{L.success("Status created"),s(""),o(xm[0]),c(""),u("started"),t()},onError:()=>L.error("Failed to create status")})};return a.jsx(li,{open:e,onOpenChange:g=>!g&&t(),children:a.jsxs(ci,{className:"sm:max-w-sm",children:[a.jsx(oo,{children:a.jsx(co,{className:"text-sm font-medium",children:"New Status"})}),a.jsx(lo,{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(Ae,{placeholder:"e.g. In Review",value:n,onChange:g=>s(g.target.value),onKeyDown:g=>g.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:[xm.map(g=>a.jsx("button",{onClick:()=>{o(g),c("")},className:R("h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",i===g&&!l?"border-foreground scale-110":"border-transparent"),style:{backgroundColor:g}},g)),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(Ae,{placeholder:"#hex",value:l,onChange:g=>c(g.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(Be,{value:d,onValueChange:g=>u(g),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:EI.map(g=>a.jsx(Ne,{value:g.value,className:"text-xs",children:g.label},g.value))})]})]})]})}),a.jsxs(Vl,{className:"mt-2",children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:t,className:"text-xs",children:"Cancel"}),a.jsx(ee,{size:"sm",onClick:p,disabled:!n.trim()||f.isPending,className:"text-xs",children:"Create"})]})]})})}function DI({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(ct,{className:"h-3.5 w-3.5"}),"Add status"]})}),a.jsx(AI,{open:t,onClose:()=>r(!1),projectId:e})]})}function TI({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(Ma,{open:e,onOpenChange:u=>{u||i()},children:a.jsxs(Zn,{className:"sm:max-w-md",children:[a.jsxs(Ea,{children:[a.jsx(Aa,{children:"Delete status"}),a.jsx(io,{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(Be,{value:l,onValueChange:c,children:[a.jsx(ze,{children:a.jsx(Ye,{placeholder:"Select a status..."})}),a.jsx(Le,{children:n.map(u=>a.jsx(Ne,{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(Xp,{children:[a.jsx(ee,{variant:"outline",onClick:i,disabled:o,children:"Cancel"}),a.jsx(ee,{variant:"destructive",onClick:d,disabled:r>0&&!l||o,children:o?"Deleting…":"Delete status"})]})]})})}function vm(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 II(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 kN({issues:e,projectId:t,statuses:r,onIssueClick:n,onColumnsReorder:s,readOnly:i=!1,filters:o}){var X;const[l,c]=h.useState(()=>r.map(O=>O.id)),[d,u]=h.useState(()=>vm(e,r)),[f,m]=h.useState(null),[p,g]=h.useState(null),[x,v]=h.useState(null),[y,w]=h.useState(null),[N,j]=h.useState(""),k=h.useRef(null),b=h.useRef(!1),C=Se(),S=Tt.byProject(t,o),_=wI(t),A=bI(t,y??""),M=h.useMemo(()=>{const O=new Map;for(const F of e)F.parent_id&&O.set(F.parent_id,(O.get(F.parent_id)??0)+1);return O},[e]);h.useEffect(()=>{c(O=>{const F=new Set(r.map(q=>q.id)),ae=O.filter(q=>F.has(q)),W=r.map(q=>q.id).filter(q=>!O.includes(q));return ae.length===O.length&&W.length===0?O:[...ae,...W]})},[r]),h.useEffect(()=>{b.current||u(O=>II(O,e,r))},[e,r]);const P=[...r].sort((O,F)=>{const ae=l.indexOf(O.id),W=l.indexOf(F.id);return ae===-1&&W===-1?O.position-F.position:ae===-1?1:W===-1?-1:ae-W}),T=Bj(Mp(Wj,i?{activationConstraint:{distance:1/0}}:{activationConstraint:{distance:5}})),D=h.useCallback(O=>{if(p){const F=O.droppableContainers.filter(ae=>l.includes(ae.id));return KM({...O,droppableContainers:F})}return YM(O)},[p,l]),B=h.useCallback(O=>{for(const[F,ae]of Object.entries(d))if(ae.some(W=>W.id===O))return F;return null},[d]),E=h.useCallback(O=>r.some(F=>F.id===O),[r]),z=O=>{const F=O.active.id;if(b.current=!0,E(F)){g(F);return}for(const[ae,W]of Object.entries(d)){const q=W.find(le=>le.id===F);if(q){m(q),k.current=ae;return}}},Q=O=>{const{active:F,over:ae}=O;if(!ae||p)return;const W=F.id,q=ae.id;if(E(W))return;const le=B(W),Z=r.find(V=>V.key===q||V.id===q),de=(Z==null?void 0:Z.key)??B(q);!le||!de||le===de||u(V=>{const oe=[...V[le]??[]],pe=[...V[de]??[]],we=oe.findIndex(ve=>ve.id===W);if(we===-1)return V;const[_e]=oe.splice(we,1),H={..._e,status:de};if(Z)pe.push(H);else{const ve=pe.findIndex(De=>De.id===q);if(ve===-1)pe.push(H);else{const De=F.rect.current.translated!=null&&F.rect.current.translated.top>ae.rect.top+ae.rect.height/2;pe.splice(De?ve+1:ve,0,H)}}return{...V,[le]:oe,[de]:pe}})},K=O=>{var V;const{active:F,over:ae}=O;if(m(null),b.current=!1,p){if(g(null),!ae||F.id===ae.id)return;const oe=l.indexOf(F.id),pe=l.indexOf(ae.id);if(oe===-1||pe===-1||oe===pe)return;const we=td(l,oe,pe);c(we),s==null||s(we);return}if(!ae){const oe=k.current;k.current=null,oe&&u(vm(e,r));return}const W=F.id,q=ae.id,le=k.current;k.current=null;const Z=r.find(oe=>oe.key===q||oe.id===q),de=(Z==null?void 0:Z.key)??B(q);if(!(!le||!de))if(le===de)u(oe=>{const pe=oe[le]??[],we=pe.findIndex(H=>H.id===W),_e=pe.findIndex(H=>H.id===q);return we===-1||_e===-1||we===_e?oe:{...oe,[le]:td(pe,we,_e)}});else{if(!r.find(we=>we.key===q||we.id===q))u(we=>{const _e=[...we[de]??[]],H=_e.findIndex(Qe=>Qe.id===W);if(H===-1)return we;const ve=O.active.rect.current.translated!=null&&O.active.rect.current.translated.top>O.over.rect.top+O.over.rect.height/2,[De]=_e.splice(H,1),He=_e.findIndex(Qe=>Qe.id===q);if(He===-1)return _e.splice(H,0,De),we;const Fe=ve?He+1:He;return _e.splice(Fe,0,De),{...we,[de]:_e}});else{const we=((V=O.active.rect.current.translated)==null?void 0:V.top)??1/0,_e=O.over.rect.top+O.over.rect.height/2;we<_e&&u(H=>{const ve=H[de]??[],De=ve.findIndex(He=>He.id===W);return De<=0?H:{...H,[de]:td(ve,De,0)}})}const pe=C.getQueryData(S);C.setQueryData(S,we=>we&&{...we,issues:we.issues.map(_e=>_e.id===W?{..._e,status:de}:_e)}),re.put(`/admin/issues/${W}`,{status:de}).then(()=>{C.invalidateQueries({queryKey:S})}).catch(()=>{pe&&C.setQueryData(S,pe),u(vm((pe==null?void 0:pe.issues)??e,r)),L.error("Failed to update issue status")})}},se=O=>{v(O)},te=async O=>{if(!x)return;const F=d[x.key]??[];if(F.length>0){const ae=r.find(W=>W.id===O);if(!ae)return;try{await Promise.all(F.map(W=>re.put(`/admin/issues/${W.id}`,{status:ae.key}))),C.invalidateQueries({queryKey:Tt.byProject(t)})}catch{L.error("Failed to move issues");return}}_.mutate(x.id,{onSuccess:()=>{L.success(`Status "${x.name}" deleted`),v(null)},onError:()=>L.error("Failed to delete status")})},U=()=>{const O=N.trim();!O||!y||A.mutate({name:O},{onSuccess:()=>{L.success("Status renamed"),w(null)},onError:()=>L.error("Failed to rename status")})},G=()=>{w(null)},J=p?r.find(O=>O.id===p):null;return a.jsxs(al,{sensors:T,collisionDetection:D,onDragStart:z,onDragOver:Q,onDragEnd:K,children:[a.jsxs("div",{className:"flex gap-4 min-h-full overflow-x-auto px-6 py-4 pb-6",children:[a.jsx(Ep,{items:l,strategy:Uj,children:P.map(O=>a.jsx(MI,{id:O.id,label:O.name,color:O.color,category:O.category,issues:d[O.key]??[],childCounts:M,sortable:!0,onIssueClick:n,onRename:i?void 0:()=>{w(O.id),j(O.name)},onDelete:i?void 0:()=>se(O),isRenaming:y===O.id,renameValue:y===O.id?N:"",onRenameChange:j,onRenameSubmit:U,onRenameCancel:G},O.id))}),!i&&a.jsx(DI,{projectId:t})]}),a.jsxs(GM,{children:[f&&a.jsx(NN,{issue:f}),J&&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:J.color}}),J.name]})})]}),x&&a.jsx(TI,{open:!!x,statusName:x.name,issueCount:((X=d[x.key])==null?void 0:X.length)??0,otherStatuses:r.filter(O=>O.id!==x.id),onConfirm:te,onCancel:()=>v(null),isLoading:_.isPending})]})}const Ot=vM,Pt=yM,kt=h.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>a.jsx(xM,{children:a.jsx(Ij,{ref:s,align:t,sideOffset:r,className:R("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})}));kt.displayName=Ij.displayName;const RI=[{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"},{value:"none",label:"None"}],$I=[{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"task",label:"Task"},{value:"epic",label:"Epic"},{value:"story",label:"Story"}];function Mc({label:e,activeCount:t,children:r}){const[n,s]=h.useState(!1);return a.jsxs(Ot,{open:n,onOpenChange:s,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs("button",{className:R("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(Vn,{className:"h-3 w-3 opacity-60"})]})}),a.jsx(kt,{className:"w-48 p-1",align:"start",children:r})]})}function ym({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:R("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(ir,{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 zI({statuses:e,members:t,filters:r,onChange:n}){var c,d,u,f,m,p,g;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=(x,v)=>{const y=r[x]??[],w=y.includes(v)?y.filter(N=>N!==v):[...y,v];n({...r,[x]:w.length?w:void 0})},o=x=>{n({...r,assignee_id:r.assignee_id===x?void 0:x})},l=r.assignee_id?((f=t.find(x=>x.userId===r.assignee_id))==null?void 0:f.name)??"Assignee":"Assignee";return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Mc,{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(x=>{const v=r.assignee_id===x.userId;return a.jsxs("button",{onClick:()=>o(x.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:R("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(ir,{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:x.initials}),a.jsx("span",{className:"truncate",children:x.name})]},x.userId)})]})}),a.jsx(Mc,{label:"Priority",activeCount:((m=r.priority)==null?void 0:m.length)??0,children:a.jsx(ym,{options:RI,selected:r.priority??[],onToggle:x=>i("priority",x)})}),a.jsx(Mc,{label:"Type",activeCount:((p=r.type)==null?void 0:p.length)??0,children:a.jsx(ym,{options:$I,selected:r.type??[],onToggle:x=>i("type",x)})}),a.jsx(Mc,{label:"Status",activeCount:((g=r.status)==null?void 0:g.length)??0,children:a.jsx(ym,{options:e.map(x=>({value:x.key,label:x.name,color:x.color})),selected:r.status??[],onToggle:x=>i("status",x)})}),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(at,{className:"h-3 w-3"}),"Clear"]})]})}const LI={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function lg(){return We({queryKey:["org","calendar"],queryFn:()=>re.get("/admin/org/calendar"),select:e=>({working_days:e.working_days??LI,timezone:e.timezone})})}function FI(){const e=Se();return be({mutationFn:t=>re.put("/admin/org/calendar",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","calendar"]})}})}function cg(e){const t=e??new Date().getFullYear();return We({queryKey:["org","holidays",t],queryFn:()=>re.get(`/admin/org/holidays?year=${t}`),select:r=>r.holidays})}function BI(){const e=Se();return be({mutationFn:t=>re.post("/admin/org/holidays",t),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function WI(){const e=Se();return be({mutationFn:({id:t,...r})=>re.put(`/admin/org/holidays/${t}`,r),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function UI(){const e=Se();return be({mutationFn:t=>re.delete(`/admin/org/holidays/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["org","holidays"]})}})}function qI(){return We({queryKey:["app-config"],queryFn:()=>re.get("/admin/config"),staleTime:1/0})}const HI=["sun","mon","tue","wed","thu","fri","sat"];function KI(e,t,r){const n=HI[lI(e)];if(!t[n])return!1;const s=nd(e),i=sl(e);for(const o of r){const l=new Date(o.date);if(o.recurring){if(nd(l)===s&&sl(l)===i)return!1}else if(l.getFullYear()===e.getFullYear()&&nd(l)===s&&sl(l)===i)return!1}return!0}function SN(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;)KI(i,r,n)&&s++,i=Ir(i,1);return s}const Li={all:["sprints"],byProject:e=>["sprints","project",e],detail:e=>["sprints",e]};function mo(e){return We({queryKey:e?Li.byProject(e):Li.all,queryFn:()=>{const t=e?`/admin/sprints?project_id=${e}`:"/admin/sprints";return re.get(t)},select:t=>t.sprints,enabled:!!e})}function YI(e){const t=Se();return be({mutationFn:r=>re.post("/admin/sprints",{...r,project_id:e}),onSuccess:()=>{t.invalidateQueries({queryKey:Li.byProject(e)})}})}function GI(e,t){const r=Se();return be({mutationFn:n=>re.put(`/admin/sprints/${e}`,n),onSuccess:()=>{r.invalidateQueries({queryKey:Li.byProject(t)}),r.invalidateQueries({queryKey:Li.detail(e)})}})}function VI(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/sprints/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Li.byProject(e)})}})}const Hu={byProject:e=>["task-lists","project",e]};function Jl(e){return We({queryKey:e?Hu.byProject(e):["task-lists"],queryFn:()=>re.get(`/admin/projects/${e}/task-lists`),select:t=>t.task_lists,enabled:!!e})}function XI(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/projects/${e}/task-lists`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Hu.byProject(e)})}})}function QI(e){const t=Se();return be({mutationFn:({id:r,...n})=>re.put(`/admin/task-lists/${r}`,n),onSuccess:()=>{t.invalidateQueries({queryKey:Hu.byProject(e)})}})}function ZI(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/task-lists/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:Hu.byProject(e)}),t.invalidateQueries({queryKey:Tt.byProject(e)})}})}function Zv(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 Jv(e,t,r){return`${e??""} ${t??""}`.trim()||r}function ec({value:e,onChange:t,disabled:r,users:n}){const[s,i]=h.useState(!1),[o,l]=h.useState(e),{data:c}=Zl(),d=n??c??[],u=e.slice().sort().join(",");h.useEffect(()=>{l(e)},[u]);const f=p=>{const g=o.includes(p)?o.filter(x=>x!==p):[...o,p];l(g),t(g)},m=d.filter(p=>o.includes(p.id));return a.jsxs(Ot,{open:s,onOpenChange:i,children:[a.jsx(Pt,{asChild:!0,disabled:r,children:a.jsx("button",{type:"button",className:R("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(no,{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(Ft,{className:"h-5 w-5 border border-background ring-0",children:a.jsx(Bt,{className:"text-[9px] bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",children:Zv(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?Jv(m[0].first_name,m[0].last_name,m[0].email):`${m.length} assignees`})]})})}),a.jsx(kt,{className:"w-60 p-0",align:"start",children:a.jsxs(Ts,{children:[a.jsx(Fu,{placeholder:"Search users...",className:"h-8 text-xs"}),a.jsxs(Is,{children:[a.jsx(Bu,{className:"text-xs py-4",children:"No users found."}),a.jsx(Ja,{children:d.map(p=>{const g=o.includes(p.id),x=Jv(p.first_name,p.last_name,p.email),v=Zv(p.first_name,p.last_name,p.email);return a.jsxs(nn,{value:x,onSelect:()=>f(p.id),className:"gap-2 py-1.5",children:[a.jsx(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{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:x}),a.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:p.email})]}),a.jsx(ir,{className:R("h-3.5 w-3.5 shrink-0",g?"opacity-100 text-indigo-500":"opacity-0")})]},p.id)})})]})]})})]})}function JI(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 bm={},Zo={};function Ps(e,t){try{const n=(bm[e]||(bm[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return n in Zo?Zo[n]:ey(n,n.split(":"))}catch{if(e in Zo)return Zo[e];const r=e==null?void 0:e.match(eR);return r?ey(e,r.slice(1)):NaN}}const eR=/([+-]\d\d):?(\d\d)?/;function ey(e,t){const r=+(t[0]||0),n=+(t[1]||0),s=+(t[2]||0)/60;return Zo[e]=r*60+n>0?r*60+n+s:r*60-n-s}class Fn extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ps(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)),CN(this),xh(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new Fn(...r,t):new Fn(Date.now(),t)}withTimeZone(t){return new Fn(+this,t)}getTimezoneOffset(){const t=-Ps(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),xh(this),+this}[Symbol.for("constructDateFrom")](t){return new Fn(+new Date(t),this.timeZone)}}const ty=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ty.test(e))return;const t=e.replace(ty,"$1UTC");Fn.prototype[t]&&(e.startsWith("get")?Fn.prototype[e]=function(){return this.internal[t]()}:(Fn.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),tR(this),+this},Fn.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),xh(this),+this}))});function xh(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ps(e.timeZone,e)*60))}function tR(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()),CN(e)}function CN(e){const t=Ps(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(-(Ps(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=Ps(e.timeZone,e),p=m>0?Math.floor(m):Math.ceil(m),x=-new Date(+e).getTimezoneOffset()-p,v=p!==r,y=x-c;if(v&&y){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+y);const w=Ps(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 ur extends Fn{static tz(t,...r){return r.length?new ur(...r,t):new ur(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} (${JI(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 ur(+this,t)}[Symbol.for("constructDateFrom")](t){return new ur(+new Date(t),this.timeZone)}}const ry=5,rR=4;function nR(e,t){const r=t.startOfMonth(e),n=r.getDay()>0?r.getDay():7,s=t.addDays(e,-n+1),i=t.addDays(s,ry*7-1);return t.getMonth(e)===t.getMonth(i)?ry:rR}function _N(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 aR(e,t){const r=_N(e,t),n=nR(e,t);return t.addDays(r,n*7-1)}const ON={...Cs,labels:{labelDayButton:(e,t,r,n)=>{let s;n&&typeof n.format=="function"?s=n.format.bind(n):s=(o,l)=>he(o,l,{locale:Cs,...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)=>he(s,i,{locale:Cs,...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)=>he(o,l,{locale:Cs,...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)=>he(s,i,{locale:Cs,...t}),n(e,"cccc")}}};class Gr{constructor(t,r){this.Date=Date,this.today=()=>{var n;return(n=this.overrides)!=null&&n.today?this.overrides.today():this.options.timeZone?ur.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 ur(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):Ir(n,s)},this.addMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addMonths?this.overrides.addMonths(n,s):tg(n,s)},this.addWeeks=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addWeeks?this.overrides.addWeeks(n,s):J5(n,s)},this.addYears=(n,s)=>{var i;return(i=this.overrides)!=null&&i.addYears?this.overrides.addYears(n,s):e3(n,s)},this.differenceInCalendarDays=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,s):Uu(n,s)},this.differenceInCalendarMonths=(n,s)=>{var i;return(i=this.overrides)!=null&&i.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,s):ng(n,s)},this.eachMonthOfInterval=n=>{var s;return(s=this.overrides)!=null&&s.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):l3(n)},this.eachYearOfInterval=n=>{var l;const s=(l=this.overrides)!=null&&l.eachYearOfInterval?this.overrides.eachYearOfInterval(n):d3(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):aR(n,this)},this.endOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.endOfISOWeek?this.overrides.endOfISOWeek(n):u3(n)},this.endOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.endOfMonth?this.overrides.endOfMonth(n):ag(n)},this.endOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.endOfWeek?this.overrides.endOfWeek(n,s):yN(n,this.options)},this.endOfYear=n=>{var s;return(s=this.overrides)!=null&&s.endOfYear?this.overrides.endOfYear(n):c3(n)},this.format=(n,s,i)=>{var l;const o=(l=this.overrides)!=null&&l.format?this.overrides.format(n,s,this.options):he(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):sg(n)},this.getMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getMonth?this.overrides.getMonth(n,this.options):nd(n,this.options)},this.getYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getYear?this.overrides.getYear(n,this.options):cI(n,this.options)},this.getWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.getWeek?this.overrides.getWeek(n,this.options):ig(n,this.options)},this.isAfter=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isAfter?this.overrides.isAfter(n,s):dI(n,s)},this.isBefore=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isBefore?this.overrides.isBefore(n,s):uI(n,s)},this.isDate=n=>{var s;return(s=this.overrides)!=null&&s.isDate?this.overrides.isDate(n):uN(n)},this.isSameDay=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameDay?this.overrides.isSameDay(n,s):zi(n,s)},this.isSameMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameMonth?this.overrides.isSameMonth(n,s):fI(n,s)},this.isSameYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.isSameYear?this.overrides.isSameYear(n,s):mI(n,s)},this.max=n=>{var s;return(s=this.overrides)!=null&&s.max?this.overrides.max(n):t3(n)},this.min=n=>{var s;return(s=this.overrides)!=null&&s.min?this.overrides.min(n):r3(n)},this.setMonth=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setMonth?this.overrides.setMonth(n,s):gI(n,s)},this.setYear=(n,s)=>{var i;return(i=this.overrides)!=null&&i.setYear?this.overrides.setYear(n,s):xI(n,s)},this.startOfBroadcastWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):_N(n,this)},this.startOfDay=n=>{var s;return(s=this.overrides)!=null&&s.startOfDay?this.overrides.startOfDay(n):$i(n)},this.startOfISOWeek=n=>{var s;return(s=this.overrides)!=null&&s.startOfISOWeek?this.overrides.startOfISOWeek(n):dl(n)},this.startOfMonth=n=>{var s;return(s=this.overrides)!=null&&s.startOfMonth?this.overrides.startOfMonth(n):xN(n)},this.startOfWeek=(n,s)=>{var i;return(i=this.overrides)!=null&&i.startOfWeek?this.overrides.startOfWeek(n,this.options):Ri(n,this.options)},this.startOfYear=n=>{var s;return(s=this.overrides)!=null&&s.startOfYear?this.overrides.startOfYear(n):vN(n)},this.options={locale:ON,...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&&Gr.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&&Gr.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)}}Gr.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 ea=new Gr;class PN{constructor(t,r,n=ea){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 sR{constructor(t,r){this.date=t,this.weeks=r}}class iR{constructor(t,r){this.days=r,this.weekNumber=t}}function oR(e){return I.createElement("button",{...e})}function lR(e){return I.createElement("span",{...e})}function cR(e){const{size:t=24,orientation:r="left",className:n}=e;return I.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},r==="up"&&I.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&I.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&I.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&I.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function dR(e){const{day:t,modifiers:r,...n}=e;return I.createElement("td",{...n})}function uR(e){const{day:t,modifiers:r,...n}=e,s=I.useRef(null);return I.useEffect(()=>{var i;r.focused&&((i=s.current)==null||i.focus())},[r.focused]),I.createElement("button",{ref:s,...n})}var Oe;(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"})(Oe||(Oe={}));var yt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(yt||(yt={}));var wn;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(wn||(wn={}));var Wr;(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"})(Wr||(Wr={}));function fR(e){const{options:t,className:r,components:n,classNames:s,...i}=e,o=[s[Oe.Dropdown],r].join(" "),l=t==null?void 0:t.find(({value:c})=>c===i.value);return I.createElement("span",{"data-disabled":i.disabled,className:s[Oe.DropdownRoot]},I.createElement(n.Select,{className:o,...i},t==null?void 0:t.map(({value:c,label:d,disabled:u})=>I.createElement(n.Option,{key:c,value:c,disabled:u},d))),I.createElement("span",{className:s[Oe.CaptionLabel],"aria-hidden":!0},l==null?void 0:l.label,I.createElement(n.Chevron,{orientation:"down",size:18,className:s[Oe.Chevron]})))}function mR(e){return I.createElement("div",{...e})}function hR(e){return I.createElement("div",{...e})}function pR(e){const{calendarMonth:t,displayIndex:r,...n}=e;return I.createElement("div",{...n},e.children)}function gR(e){const{calendarMonth:t,displayIndex:r,...n}=e;return I.createElement("div",{...n})}function xR(e){return I.createElement("table",{...e})}function vR(e){return I.createElement("div",{...e})}const MN=h.createContext(void 0);function tc(){const e=h.useContext(MN);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function yR(e){const{components:t}=tc();return I.createElement(t.Dropdown,{...e})}function bR(e){const{onPreviousClick:t,onNextClick:r,previousMonth:n,nextMonth:s,...i}=e,{components:o,classNames:l,labels:{labelPrevious:c,labelNext:d}}=tc(),u=h.useCallback(m=>{s&&(r==null||r(m))},[s,r]),f=h.useCallback(m=>{n&&(t==null||t(m))},[n,t]);return I.createElement("nav",{...i},I.createElement(o.PreviousMonthButton,{type:"button",className:l[Oe.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},I.createElement(o.Chevron,{disabled:n?void 0:!0,className:l[Oe.Chevron],orientation:"left"})),I.createElement(o.NextMonthButton,{type:"button",className:l[Oe.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":d(s),onClick:u},I.createElement(o.Chevron,{disabled:s?void 0:!0,orientation:"right",className:l[Oe.Chevron]})))}function wR(e){const{components:t}=tc();return I.createElement(t.Button,{...e})}function jR(e){return I.createElement("option",{...e})}function NR(e){const{components:t}=tc();return I.createElement(t.Button,{...e})}function kR(e){const{rootRef:t,...r}=e;return I.createElement("div",{...r,ref:t})}function SR(e){return I.createElement("select",{...e})}function CR(e){const{week:t,...r}=e;return I.createElement("tr",{...r})}function _R(e){return I.createElement("th",{...e})}function OR(e){return I.createElement("thead",{"aria-hidden":!0},I.createElement("tr",{...e}))}function PR(e){const{week:t,...r}=e;return I.createElement("th",{...r})}function MR(e){return I.createElement("th",{...e})}function ER(e){return I.createElement("tbody",{...e})}function AR(e){const{components:t}=tc();return I.createElement(t.Dropdown,{...e})}const DR=Object.freeze(Object.defineProperty({__proto__:null,Button:oR,CaptionLabel:lR,Chevron:cR,Day:dR,DayButton:uR,Dropdown:fR,DropdownNav:mR,Footer:hR,Month:pR,MonthCaption:gR,MonthGrid:xR,Months:vR,MonthsDropdown:yR,Nav:bR,NextMonthButton:wR,Option:jR,PreviousMonthButton:NR,Root:kR,Select:SR,Week:CR,WeekNumber:PR,WeekNumberHeader:MR,Weekday:_R,Weekdays:OR,Weeks:ER,YearsDropdown:AR},Symbol.toStringTag,{value:"Module"}));function ua(e,t,r=!1,n=ea){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 dg(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Ku(e){return!!(e&&typeof e=="object"&&"from"in e)}function ug(e){return!!(e&&typeof e=="object"&&"after"in e)}function fg(e){return!!(e&&typeof e=="object"&&"before"in e)}function EN(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function AN(e,t){return Array.isArray(e)&&e.every(t.isDate)}function fa(e,t,r=ea){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(AN(l,r))return l.some(c=>s(e,c));if(Ku(l))return ua(l,e,!1,r);if(EN(l))return Array.isArray(l.dayOfWeek)?l.dayOfWeek.includes(e.getDay()):l.dayOfWeek===e.getDay();if(dg(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 ug(l)?i(e,l.after)>0:fg(l)?i(l.before,e)>0:typeof l=="function"?l(e):!1})}function TR(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:g,endOfMonth:x,isAfter:v}=s,y=r&&p(r),w=n&&x(n),N={[yt.focused]:[],[yt.outside]:[],[yt.disabled]:[],[yt.hidden]:[],[yt.today]:[]},j={};for(const k of e){const{date:b,displayMonth:C}=k,S=!!(C&&!m(b,C)),_=!!(y&&g(b,y)),A=!!(w&&v(b,w)),M=!!(i&&fa(b,i,s)),P=!!(o&&fa(b,o,s))||_||A||!d&&!c&&S||d&&c===!1&&S,T=f(b,u);S&&N.outside.push(k),M&&N.disabled.push(k),P&&N.hidden.push(k),T&&N.today.push(k),l&&Object.keys(l).forEach(D=>{const B=l==null?void 0:l[D];B&&fa(b,B,s)&&(j[D]?j[D].push(k):j[D]=[k])})}return k=>{const b={[yt.focused]:!1,[yt.disabled]:!1,[yt.hidden]:!1,[yt.outside]:!1,[yt.today]:!1},C={};for(const S in N){const _=N[S];b[S]=_.some(A=>A===k)}for(const S in j)C[S]=j[S].some(_=>_===k);return{...b,...C}}}function IR(e,t,r={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[i])=>(r[i]?s.push(r[i]):t[yt[i]]?s.push(t[yt[i]]):t[wn[i]]&&s.push(t[wn[i]]),s),[t[Oe.Day]])}function RR(e){return{...DR,...e}}function $R(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 zR(){const e={};for(const t in Oe)e[Oe[t]]=`rdp-${Oe[t]}`;for(const t in yt)e[yt[t]]=`rdp-${yt[t]}`;for(const t in wn)e[wn[t]]=`rdp-${wn[t]}`;for(const t in Wr)e[Wr[t]]=`rdp-${Wr[t]}`;return e}function DN(e,t,r){return(r??new Gr(t)).formatMonthYear(e)}const LR=DN;function FR(e,t,r){return(r??new Gr(t)).format(e,"d")}function BR(e,t=ea){return t.format(e,"LLLL")}function WR(e,t,r){return(r??new Gr(t)).format(e,"cccccc")}function UR(e,t=ea){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function qR(){return""}function TN(e,t=ea){return t.format(e,"yyyy")}const HR=TN,KR=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:DN,formatDay:FR,formatMonthCaption:LR,formatMonthDropdown:BR,formatWeekNumber:UR,formatWeekNumberHeader:qR,formatWeekdayName:WR,formatYearCaption:HR,formatYearDropdown:TN},Symbol.toStringTag,{value:"Module"}));function YR(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...KR,...e}}function mg(e,t,r,n){let s=(n??new Gr(r)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const GR=mg;function hg(e,t,r){return(r??new Gr(t)).formatMonthYear(e)}const VR=hg;function IN(e,t,r,n){let s=(n??new Gr(r)).format(e,"PPPP");return t!=null&&t.today&&(s=`Today, ${s}`),s}function RN(e){return"Choose the Month"}function $N(){return""}const XR="Go to the Next Month";function zN(e,t){return XR}function LN(e){return"Go to the Previous Month"}function FN(e,t,r){return(r??new Gr(t)).format(e,"cccc")}function BN(e,t){return`Week ${e}`}function WN(e){return"Week Number"}function UN(e){return"Choose the Year"}const QR=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:VR,labelDay:GR,labelDayButton:mg,labelGrid:hg,labelGridcell:IN,labelMonthDropdown:RN,labelNav:$N,labelNext:zN,labelPrevious:LN,labelWeekNumber:BN,labelWeekNumberHeader:WN,labelWeekday:FN,labelYearDropdown:UN},Symbol.toStringTag,{value:"Module"})),gn=(e,t,r)=>t||(r?typeof r=="function"?r:(...n)=>r:e);function ZR(e,t){var n;const r=((n=t.locale)==null?void 0:n.labels)??{};return{...QR,...e??{},labelDayButton:gn(mg,e==null?void 0:e.labelDayButton,r.labelDayButton),labelMonthDropdown:gn(RN,e==null?void 0:e.labelMonthDropdown,r.labelMonthDropdown),labelNext:gn(zN,e==null?void 0:e.labelNext,r.labelNext),labelPrevious:gn(LN,e==null?void 0:e.labelPrevious,r.labelPrevious),labelWeekNumber:gn(BN,e==null?void 0:e.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:gn(UN,e==null?void 0:e.labelYearDropdown,r.labelYearDropdown),labelGrid:gn(hg,e==null?void 0:e.labelGrid,r.labelGrid),labelGridcell:gn(IN,e==null?void 0:e.labelGridcell,r.labelGridcell),labelNav:gn($N,e==null?void 0:e.labelNav,r.labelNav),labelWeekNumberHeader:gn(WN,e==null?void 0:e.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:gn(FN,e==null?void 0:e.labelWeekday,r.labelWeekday)}}function JR(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),g=d(m),x=t&&m<i(t)||r&&m>i(r)||!1;return{value:g,label:p,disabled:x}})}function e4(e,t={},r={}){let n={...t==null?void 0:t[Oe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{n={...n,...r==null?void 0:r[s]}}),n}function t4(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 r4(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 n4(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 ur(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(ur.tz(e)),newDate:(c,d,u)=>new ur(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 ur(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 ur(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 ur(d.getFullYear(),0,1,12,0,0,e);for(;m.getFullYear()<=u.getFullYear();)f.push(new ur(m,e)),m.setFullYear(m.getFullYear()+1,0,1);return f},getWeek:(c,d)=>{var f;const u=o(c);return ig(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 sg(d)},differenceInCalendarDays:(c,d)=>{const u=o(c),f=o(d);return Uu(u,f)},differenceInCalendarMonths:(c,d)=>{const u=o(c),f=o(d);return ng(u,f)}}}const rc=e=>e instanceof HTMLElement?e:null,wm=e=>[...e.querySelectorAll("[data-animated-month]")??[]],a4=e=>rc(e.querySelector("[data-animated-month]")),jm=e=>rc(e.querySelector("[data-animated-caption]")),Nm=e=>rc(e.querySelector("[data-animated-weeks]")),s4=e=>rc(e.querySelector("[data-animated-nav]")),i4=e=>rc(e.querySelector("[data-animated-weekdays]"));function o4(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[Wr.caption_after_enter]:r[Wr.caption_before_enter],p=f?r[Wr.weeks_after_enter]:r[Wr.weeks_before_enter],g=o.current,x=e.current.cloneNode(!0);if(x instanceof HTMLElement?(wm(x).forEach(N=>{if(!(N instanceof HTMLElement))return;const j=a4(N);j&&N.contains(j)&&N.removeChild(j);const k=jm(N);k&&k.classList.remove(m);const b=Nm(N);b&&b.classList.remove(p)}),o.current=x):o.current=null,c.current||u||s)return;const v=g instanceof HTMLElement?wm(g):[],y=wm(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=s4(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=jm(N);b&&b.classList.add(m);const C=Nm(N);C&&C.classList.add(p);const S=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),w&&(w.style.zIndex=""),b&&b.classList.remove(m),C&&C.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 _=i4(k);_&&(_.style.opacity="0");const A=jm(k);A&&(A.classList.add(f?r[Wr.caption_before_exit]:r[Wr.caption_after_exit]),A.addEventListener("animationend",S));const M=Nm(k);M&&M.classList.add(f?r[Wr.weeks_before_exit]:r[Wr.weeks_after_exit]),N.insertBefore(k,N.firstChild)})}})}function l4(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:g,endOfWeek:x,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(g(i)):x(g(i)),b=t&&(c?m(t):o?p(t):x(t)),C=b&&v(k,b)?b:k,S=u(C,j),_=f(i,s)+1,A=[];for(let T=0;T<=S;T++){const D=d(j,T);A.push(D)}const P=(c?35:42)*_;if(l&&A.length<P){const T=P-A.length;for(let D=0;D<T;D++){const B=d(A[A.length-1],1);A.push(B)}}return A}function c4(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 d4(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 ny(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 u4(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,g=e.reduce((x,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(C=>C>=y&&C<=w),j=r.broadcastCalendar?35:42;if(r.fixedWeeks&&N.length<j){const C=t.filter(S=>{const _=j-N.length;return S>w&&S<=s(w,_)});N.push(...C)}const k=N.reduce((C,S)=>{const _=r.ISOWeek?d(S):u(S),A=C.find(P=>P.weekNumber===_),M=new PN(S,v,n);return A?A.days.push(M):C.push(new iR(_,[M])),C},[]),b=new sR(v,k);return x.push(b),x},[]);return r.reverseMonths?g.reverse():g}function f4(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:g,toMonth:x}=e;!r&&g&&(r=g),!r&&m&&(r=t.newDate(m,0,1)),!n&&x&&(n=x),!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 m4(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 h4(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 p4(e){const t=[];return e.reduce((r,n)=>r.concat(n.weeks.slice()),t.slice())}function Yu(e,t){const[r,n]=h.useState(e);return[t===void 0?r:t,n]}function g4(e,t){var j;const[r,n]=f4(e,t),{startOfMonth:s,endOfMonth:i}=t,o=ny(e,r,n,t),[l,c]=Yu(o,e.month?o:void 0);h.useEffect(()=>{const k=ny(e,r,n,t);c(k)},[e.timeZone]);const{months:d,weeks:u,days:f,previousMonth:m,nextMonth:p}=h.useMemo(()=>{const k=d4(l,n,{numberOfMonths:e.numberOfMonths},t),b=l4(k,e.endMonth?i(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),C=u4(k,b,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),S=p4(C),_=c4(C),A=h4(l,r,e,t),M=m4(l,n,e,t);return{months:C,weeks:S,days:_,previousMonth:A,nextMonth:M}},[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:g,onMonthChange:x}=e,v=k=>u.some(b=>b.days.some(C=>C.isEqualTo(k))),y=k=>{if(g)return;let b=s(k);r&&b<s(r)&&(b=s(r)),n&&b>s(n)&&(b=s(n)),c(b),x==null||x(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 zn;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(zn||(zn={}));function ay(e){return!e[yt.disabled]&&!e[yt.hidden]&&!e[yt.outside]}function x4(e,t,r,n){let s,i=-1;for(const o of e){const l=t(o);ay(l)&&(l[yt.focused]&&i<zn.FocusedModifier?(s=o,i=zn.FocusedModifier):n!=null&&n.isEqualTo(o)&&i<zn.LastFocused?(s=o,i=zn.LastFocused):r(o.date)&&i<zn.Selected?(s=o,i=zn.Selected):l[yt.today]&&i<zn.Today&&(s=o,i=zn.Today))}return s||(s=e.find(o=>ay(t(o)))),s}function v4(e,t,r,n,s,i,o){const{ISOWeek:l,broadcastCalendar:c}=i,{addDays:d,addMonths:u,addWeeks:f,addYears:m,endOfBroadcastWeek:p,endOfISOWeek:g,endOfWeek:x,max:v,min:y,startOfBroadcastWeek:w,startOfISOWeek:N,startOfWeek:j}=o;let b={day:d,week:f,month:u,year:m,startOfWeek:C=>c?w(C,o):l?N(C):j(C),endOfWeek:C=>c?p(C):l?g(C):x(C)}[e](r,t==="after"?1:-1);return t==="before"&&n?b=v([n,b]):t==="after"&&s&&(b=y([s,b])),b}function qN(e,t,r,n,s,i,o,l=0){if(l>365)return;const c=v4(e,t,r.date,n,s,i,o),d=!!(i.disabled&&fa(c,i.disabled,o)),u=!!(i.hidden&&fa(c,i.hidden,o)),f=c,m=new PN(c,f,o);return!d&&!u?m:qN(e,t,m,n,s,i,o,l+1)}function y4(e,t,r,n,s){const{autoFocus:i}=e,[o,l]=h.useState(),c=x4(t.days,r,n||(()=>!1),o),[d,u]=h.useState(i?c:void 0);return{isFocusTarget:x=>!!(c!=null&&c.isEqualTo(x)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(x,v)=>{if(!d)return;const y=qN(x,v,d,t.navStart,t.navEnd,e,s);y&&(e.disableNavigation&&!t.days.some(N=>N.isEqualTo(y))||(t.goToDay(y),u(y)))}}}function b4(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Yu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t,d=p=>(l==null?void 0:l.some(g=>c(g,p)))??!1,{min:u,max:f}=e;return{selected:l,select:(p,g,x)=>{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,g,x),v},isSelected:d}}function w4(e,t,r=0,n=0,s=!1,i=ea){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 j4(e,t,r=ea){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 sy(e,t,r=ea){return ua(e,t.from,!1,r)||ua(e,t.to,!1,r)||ua(t,e.from,!1,r)||ua(t,e.to,!1,r)}function N4(e,t,r=ea){const n=Array.isArray(t)?t:[t];if(n.filter(l=>typeof l!="function").some(l=>typeof l=="boolean"?l:r.isDate(l)?ua(e,l,!1,r):AN(l,r)?l.some(c=>ua(e,c,!1,r)):Ku(l)?l.from&&l.to?sy(e,{from:l.from,to:l.to},r):!1:EN(l)?j4(e,l.dayOfWeek,r):dg(l)?r.isAfter(l.before,l.after)?sy(e,{from:r.addDays(l.after,1),to:r.addDays(l.before,-1)},r):fa(e.from,l,r)||fa(e.to,l,r):ug(l)||fg(l)?fa(e.from,l,r)||fa(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 k4(e,t){const{disabled:r,excludeDisabled:n,selected:s,required:i,onSelect:o}=e,[l,c]=Yu(s,o?s:void 0),d=o?s:l;return{selected:d,select:(m,p,g)=>{const{min:x,max:v}=e,y=m?w4(m,d,x,v,i,t):void 0;return n&&r&&(y!=null&&y.from)&&y.to&&N4({from:y.from,to:y.to},r,t)&&(y.from=m,y.to=void 0),o||c(y),o==null||o(y,m,p,g),y},isSelected:m=>d&&ua(d,m,!1,t)}}function S4(e,t){const{selected:r,required:n,onSelect:s}=e,[i,o]=Yu(r,s?r:void 0),l=s?r:i,{isSameDay:c}=t;return{selected:l,select:(f,m,p)=>{let g=f;return!n&&l&&l&&c(f,l)&&(g=void 0),s||o(g),s==null||s(g,f,m,p),g},isSelected:f=>l?c(l,f):!1}}function C4(e,t){const r=S4(e,t),n=b4(e,t),s=k4(e,t);switch(e.mode){case"single":return r;case"multiple":return n;case"range":return s;default:return}}function rn(e,t){return e instanceof ur&&e.timeZone===t?e:new ur(e,t)}function xi(e,t,r){return rn(e,t)}function iy(e,t,r){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?xi(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?xi(n,t):n):Ku(e)?{...e,from:e.from?rn(e.from,t):e.from,to:e.to?rn(e.to,t):e.to}:dg(e)?{before:xi(e.before,t),after:xi(e.after,t)}:ug(e)?{after:xi(e.after,t)}:fg(e)?{before:xi(e.before,t)}:e}function km(e,t,r){return e&&(Array.isArray(e)?e.map(n=>iy(n,t)):iy(e,t))}function _4(e){var Pe;let t=e;const r=t.timeZone;if(r&&(t={...e,timeZone:r},t.today&&(t.today=rn(t.today,r)),t.month&&(t.month=rn(t.month,r)),t.defaultMonth&&(t.defaultMonth=rn(t.defaultMonth,r)),t.startMonth&&(t.startMonth=rn(t.startMonth,r)),t.endMonth&&(t.endMonth=rn(t.endMonth,r)),t.mode==="single"&&t.selected?t.selected=rn(t.selected,r):t.mode==="multiple"&&t.selected?t.selected=(Pe=t.selected)==null?void 0:Pe.map(me=>rn(me,r)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?rn(t.selected.from,r):t.selected.from,to:t.selected.to?rn(t.selected.to,r):t.selected.to}),t.disabled!==void 0&&(t.disabled=km(t.disabled,r)),t.hidden!==void 0&&(t.hidden=km(t.hidden,r)),t.modifiers)){const me={};Object.keys(t.modifiers).forEach(ye=>{var fe;me[ye]=km((fe=t.modifiers)==null?void 0:fe[ye],r)}),t.modifiers=me}const{components:n,formatters:s,labels:i,dateLib:o,locale:l,classNames:c}=h.useMemo(()=>{const me={...ON,...t.locale},ye=t.broadcastCalendar?1:t.weekStartsOn,fe=t.noonSafe&&t.timeZone?n4(t.timeZone,{weekStartsOn:ye,locale:me}):void 0,ge=t.dateLib&&fe?{...fe,...t.dateLib}:t.dateLib??fe,Ve=new Gr({locale:me,weekStartsOn:ye,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},ge);return{dateLib:Ve,components:RR(t.components),formatters:YR(t.formatters),labels:ZR(t.labels,Ve.options),locale:me,classNames:{...zR(),...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:g,onDayFocus:x,onDayKeyDown:v,onDayMouseEnter:y,onDayMouseLeave:w,onNextClick:N,onPrevClick:j,showWeekNumber:k,styles:b}=t,{formatCaption:C,formatDay:S,formatMonthDropdown:_,formatWeekNumber:A,formatWeekNumberHeader:M,formatWeekdayName:P,formatYearDropdown:T}=s,D=g4(t,o),{days:B,months:E,navStart:z,navEnd:Q,previousMonth:K,nextMonth:se,goToMonth:te}=D,U=TR(B,t,z,Q,o),{isSelected:G,select:J,selected:X}=C4(t,o)??{},{blur:O,focused:F,isFocusTarget:ae,moveFocus:W,setFocused:q}=y4(t,D,U,G??(()=>!1),o),{labelDayButton:le,labelGridcell:Z,labelGrid:de,labelMonthDropdown:V,labelNav:oe,labelPrevious:pe,labelNext:we,labelWeekday:_e,labelWeekNumber:H,labelWeekNumberHeader:ve,labelYearDropdown:De}=i,He=h.useMemo(()=>t4(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Fe=u!==void 0||g!==void 0,Qe=h.useCallback(()=>{K&&(te(K),j==null||j(K))},[K,te,j]),gt=h.useCallback(()=>{se&&(te(se),N==null||N(se))},[te,se,N]),Ge=h.useCallback((me,ye)=>fe=>{fe.preventDefault(),fe.stopPropagation(),q(me),!ye.disabled&&(J==null||J(me.date,ye,fe),g==null||g(me.date,ye,fe))},[J,g,q]),Ze=h.useCallback((me,ye)=>fe=>{q(me),x==null||x(me.date,ye,fe)},[x,q]),pr=h.useCallback((me,ye)=>fe=>{O(),p==null||p(me.date,ye,fe)},[O,p]),mn=h.useCallback((me,ye)=>fe=>{const ge={ArrowLeft:[fe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[fe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[fe.shiftKey?"year":"week","after"],ArrowUp:[fe.shiftKey?"year":"week","before"],PageUp:[fe.shiftKey?"year":"month","before"],PageDown:[fe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ge[fe.key]){fe.preventDefault(),fe.stopPropagation();const[Ve,ie]=ge[fe.key];W(Ve,ie)}v==null||v(me.date,ye,fe)},[W,v,t.dir]),Pr=h.useCallback((me,ye)=>fe=>{y==null||y(me.date,ye,fe)},[y]),hn=h.useCallback((me,ye)=>fe=>{w==null||w(me.date,ye,fe)},[w]),gr=h.useCallback(me=>ye=>{const fe=Number(ye.target.value),ge=o.setMonth(o.startOfMonth(me),fe);te(ge)},[o,te]),Ct=h.useCallback(me=>ye=>{const fe=Number(ye.target.value),ge=o.setYear(o.startOfMonth(me),fe);te(ge)},[o,te]),{className:Rt,style:qt}=h.useMemo(()=>({className:[c[Oe.Root],t.className].filter(Boolean).join(" "),style:{...b==null?void 0:b[Oe.Root],...t.style}}),[c,t.className,t.style,b]),er=$R(t),Mn=h.useRef(null);o4(Mn,!!t.animate,{classNames:c,months:E,focused:F,dateLib:o});const ta={dayPickerProps:t,selected:X,select:J,isSelected:G,months:E,nextMonth:se,previousMonth:K,goToMonth:te,getModifiers:U,components:n,classNames:c,styles:b,labels:i,formatters:s};return I.createElement(MN.Provider,{value:ta},I.createElement(n.Root,{rootRef:t.animate?Mn:void 0,className:Rt,style:qt,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"],...er},I.createElement(n.Months,{className:c[Oe.Months],style:b==null?void 0:b[Oe.Months]},!t.hideNavigation&&!f&&I.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Oe.Nav],style:b==null?void 0:b[Oe.Nav],"aria-label":oe(),onPreviousClick:Qe,onNextClick:gt,previousMonth:K,nextMonth:se}),E.map((me,ye)=>I.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[Oe.Month],style:b==null?void 0:b[Oe.Month],key:ye,displayIndex:ye,calendarMonth:me},f==="around"&&!t.hideNavigation&&ye===0&&I.createElement(n.PreviousMonthButton,{type:"button",className:c[Oe.PreviousMonthButton],tabIndex:K?void 0:-1,"aria-disabled":K?void 0:!0,"aria-label":pe(K),onClick:Qe,"data-animated-button":t.animate?"true":void 0},I.createElement(n.Chevron,{disabled:K?void 0:!0,className:c[Oe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),I.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[Oe.MonthCaption],style:b==null?void 0:b[Oe.MonthCaption],calendarMonth:me,displayIndex:ye},d!=null&&d.startsWith("dropdown")?I.createElement(n.DropdownNav,{className:c[Oe.Dropdowns],style:b==null?void 0:b[Oe.Dropdowns]},(()=>{const fe=d==="dropdown"||d==="dropdown-months"?I.createElement(n.MonthsDropdown,{key:"month",className:c[Oe.MonthsDropdown],"aria-label":V(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:gr(me.date),options:JR(me.date,z,Q,s,o),style:b==null?void 0:b[Oe.Dropdown],value:o.getMonth(me.date)}):I.createElement("span",{key:"month"},_(me.date,o)),ge=d==="dropdown"||d==="dropdown-years"?I.createElement(n.YearsDropdown,{key:"year",className:c[Oe.YearsDropdown],"aria-label":De(o.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:Ct(me.date),options:r4(z,Q,s,o,!!t.reverseYears),style:b==null?void 0:b[Oe.Dropdown],value:o.getYear(me.date)}):I.createElement("span",{key:"year"},T(me.date,o));return o.getMonthYearOrder()==="year-first"?[ge,fe]:[fe,ge]})(),I.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"}},C(me.date,o.options,o))):I.createElement(n.CaptionLabel,{className:c[Oe.CaptionLabel],role:"status","aria-live":"polite"},C(me.date,o.options,o))),f==="around"&&!t.hideNavigation&&ye===m-1&&I.createElement(n.NextMonthButton,{type:"button",className:c[Oe.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":we(se),onClick:gt,"data-animated-button":t.animate?"true":void 0},I.createElement(n.Chevron,{disabled:se?void 0:!0,className:c[Oe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),ye===m-1&&f==="after"&&!t.hideNavigation&&I.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[Oe.Nav],style:b==null?void 0:b[Oe.Nav],"aria-label":oe(),onPreviousClick:Qe,onNextClick:gt,previousMonth:K,nextMonth:se}),I.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":u==="multiple"||u==="range","aria-label":de(me.date,o.options,o)||void 0,className:c[Oe.MonthGrid],style:b==null?void 0:b[Oe.MonthGrid]},!t.hideWeekdays&&I.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[Oe.Weekdays],style:b==null?void 0:b[Oe.Weekdays]},k&&I.createElement(n.WeekNumberHeader,{"aria-label":ve(o.options),className:c[Oe.WeekNumberHeader],style:b==null?void 0:b[Oe.WeekNumberHeader],scope:"col"},M()),He.map(fe=>I.createElement(n.Weekday,{"aria-label":_e(fe,o.options,o),className:c[Oe.Weekday],key:String(fe),style:b==null?void 0:b[Oe.Weekday],scope:"col"},P(fe,o.options,o)))),I.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[Oe.Weeks],style:b==null?void 0:b[Oe.Weeks]},me.weeks.map(fe=>I.createElement(n.Week,{className:c[Oe.Week],key:fe.weekNumber,style:b==null?void 0:b[Oe.Week],week:fe},k&&I.createElement(n.WeekNumber,{week:fe,style:b==null?void 0:b[Oe.WeekNumber],"aria-label":H(fe.weekNumber,{locale:l}),className:c[Oe.WeekNumber],scope:"row",role:"rowheader"},A(fe.weekNumber,o)),fe.days.map(ge=>{const{date:Ve}=ge,ie=U(ge);if(ie[yt.focused]=!ie.hidden&&!!(F!=null&&F.isEqualTo(ge)),ie[wn.selected]=(G==null?void 0:G(Ve))||ie.selected,Ku(X)){const{from:tt,to:rt}=X;ie[wn.range_start]=!!(tt&&rt&&o.isSameDay(Ve,tt)),ie[wn.range_end]=!!(tt&&rt&&o.isSameDay(Ve,rt)),ie[wn.range_middle]=ua(X,Ve,!0,o)}const Ce=e4(ie,b,t.modifiersStyles),Te=IR(ie,c,t.modifiersClassNames),xt=!Fe&&!ie.hidden?Z(Ve,ie,o.options,o):void 0;return I.createElement(n.Day,{key:`${ge.isoDate}_${ge.displayMonthId}`,day:ge,modifiers:ie,className:Te.join(" "),style:Ce,role:"gridcell","aria-selected":ie.selected||void 0,"aria-label":xt,"data-day":ge.isoDate,"data-month":ge.outside?ge.dateMonthId:void 0,"data-selected":ie.selected||void 0,"data-disabled":ie.disabled||void 0,"data-hidden":ie.hidden||void 0,"data-outside":ge.outside||void 0,"data-focused":ie.focused||void 0,"data-today":ie.today||void 0},!ie.hidden&&Fe?I.createElement(n.DayButton,{className:c[Oe.DayButton],style:b==null?void 0:b[Oe.DayButton],type:"button",day:ge,modifiers:ie,disabled:!ie.focused&&ie.disabled||void 0,"aria-disabled":ie.focused&&ie.disabled||void 0,tabIndex:ae(ge)?0:-1,"aria-label":le(Ve,ie,o.options,o),onClick:Ge(ge,ie),onBlur:pr(ge,ie),onFocus:Ze(ge,ie),onKeyDown:mn(ge,ie),onMouseEnter:Pr(ge,ie),onMouseLeave:hn(ge,ie)},S(Ve,o.options,o)):!ie.hidden&&S(ge.date,o.options,o))})))))))),t.footer&&I.createElement(n.Footer,{className:c[Oe.Footer],style:b==null?void 0:b[Oe.Footer],role:"status","aria-live":"polite"},t.footer)))}function hr({className:e,classNames:t,showOutsideDays:r=!0,...n}){return a.jsx(_4,{showOutsideDays:r,className:R("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:R(Mi({variant:"outline"}),"absolute left-1 top-0 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 z-10"),button_next:R(Mi({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:R(Mi({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(ku,{className:"h-4 w-4"}):a.jsx(_n,{className:"h-4 w-4"})},...n})}hr.displayName="Calendar";function O4(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,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var x;const p=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=h.useContext(p);if(g)return g;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,P4(s,...t)]}function P4(...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 M4(e){const t=E4(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(D4);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 E4(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=I4(s),l=T4(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Rj(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 A4=Symbol("radix.slottable");function D4(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===A4}function T4(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 I4(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 R4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],HN=R4.reduce((e,t)=>{const r=M4(`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}},{}),Gu="Switch",[$4]=O4(Gu),[z4,L4]=$4(Gu),KN=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),g=bu(t,N=>p(N)),x=h.useRef(!1),v=m?u||!!m.closest("form"):!0,[y,w]=bM({prop:s,defaultProp:i??!1,onChange:d,caller:Gu});return a.jsxs(z4,{scope:r,checked:y,disabled:l,children:[a.jsx(HN.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":XN(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:ks(e.onClick,N=>{w(j=>!j),v&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),v&&a.jsx(VN,{control:m,bubbles:!x.current,name:n,value:c,checked:y,required:o,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});KN.displayName=Gu;var YN="SwitchThumb",GN=h.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=L4(YN,r);return a.jsx(HN.span,{"data-state":XN(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});GN.displayName=YN;var F4="SwitchBubbleInput",VN=h.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const o=h.useRef(null),l=bu(o,i),c=wM(r),d=jM(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 g=new Event("click",{bubbles:n});p.call(u,r),u.dispatchEvent(g)}},[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}})});VN.displayName=F4;function XN(e){return e?"checked":"unchecked"}var QN=KN,B4=GN;const ho=h.forwardRef(({className:e,...t},r)=>a.jsx(QN,{className:R("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(B4,{className:R("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")})}));ho.displayName=QN.displayName;function W4(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?he(new Date(e.start_date),"MMM d"):"—",r=e.end_date?he(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function Vu({open:e,onClose:t,projectId:r,defaultStatus:n="backlog",defaultTaskListId:s,defaultParentId:i}){const o=St(),{workspace:l,projectKey:c}=Vt(),{workspace:d}=Ie(),[u,f]=h.useState(""),[m,p]=h.useState(""),[g,x]=h.useState(n),[v,y]=h.useState("medium"),[w,N]=h.useState("task"),[j,k]=h.useState([]),[b,C]=h.useState(""),[S,_]=h.useState(s??""),[A,M]=h.useState(void 0),[P,T]=h.useState(void 0),[D,B]=h.useState(!1),[E,z]=h.useState("weekly"),[Q,K]=h.useState(void 0),se=f1(),{data:te}=Qn(r),U=h.useMemo(()=>te?te.members.filter(q=>q.user).map(q=>q.user):void 0,[te]),{data:G}=fo(r),{data:J}=mo(r||void 0),{data:X}=Jl(r||void 0),O=(J??[]).filter(q=>q.status!=="completed"),F=G&&G.length>0?Object.fromEntries(G.map(q=>[q.key,q.name])):Us,ae=()=>{f(""),p(""),x(n),y("medium"),N("task"),k([]),C(""),_(s??""),M(void 0),T(void 0),B(!1),z("weekly"),K(void 0),t()},W=q=>{q.preventDefault(),u.trim()&&se.mutate({title:u.trim(),description:m.trim()||void 0,status:g,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:S||null,parent_id:i||null,start_date:A?he(A,"yyyy-MM-dd"):null,due_date:P?he(P,"yyyy-MM-dd"):null,recurrence_frequency:D?E:void 0,recurrence_end_date:D&&Q?he(Q,"yyyy-MM-dd"):void 0},{onSuccess:()=>{L.success("Issue created"),ae()},onError:le=>L.error(le.message??"Failed to create issue")})};return a.jsx(li,{open:e,onOpenChange:q=>!q&&ae(),children:a.jsxs(ci,{className:"max-w-md",children:[a.jsx(oo,{children:a.jsx(co,{children:"New issue"})}),a.jsxs("form",{onSubmit:W,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(lo,{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ut,{htmlFor:"issue-title",children:"Title"}),a.jsx(Ae,{id:"issue-title",placeholder:"Issue title",value:u,onChange:q=>f(q.target.value),autoFocus:!0})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{htmlFor:"issue-desc",children:["Description ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(Wu,{id:"issue-desc",placeholder:"Add more context...",value:m,onChange:q=>p(q.target.value)})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ut,{children:"Status"}),a.jsxs(Be,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(F).map(([q,le])=>a.jsx(Ne,{value:q,className:"text-xs",children:le},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ut,{children:"Priority"}),a.jsxs(Be,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(kn).map(([q,le])=>a.jsx(Ne,{value:q,className:"text-xs",children:le},q))})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx(ut,{children:"Type"}),a.jsxs(Be,{value:w,onValueChange:N,children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(ss).map(([q,le])=>a.jsx(Ne,{value:q,className:"text-xs",children:le},q))})]})]})]}),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"}),(X??[]).length>0&&!i&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["List ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Be,{value:S||"none",onValueChange:q=>_(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No list"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No list"})}),(X??[]).map(q=>a.jsx(Ne,{value:q.id,className:"text-xs",children:q.name},q.id))]})]})]}),O.length>0&&a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["Sprint ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Be,{value:b||"none",onValueChange:q=>C(q==="none"?"":q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{placeholder:"No sprint"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs",children:a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})}),O.map(q=>{const le=W4(q);return a.jsx(Ne,{value:q.id,className:"text-xs",children:a.jsxs("div",{children:[a.jsx("span",{children:q.name}),le&&a.jsx("span",{className:"block text-[10px] text-muted-foreground leading-tight",children:le})]})},q.id)})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["Assignees ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsx(ec,{value:j,onChange:k,users:U})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["Start Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:A?"text-foreground":"text-muted-foreground",children:A?he(A,"MMM d, yyyy"):"No start date"}),A&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),M(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:A,onSelect:M,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["Due Date ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:P?"text-foreground":"text-muted-foreground",children:P?he(P,"MMM d, yyyy"):"No due date"}),P&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),T(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:P,onSelect:T,initialFocus:!0})})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ho,{id:"recurring",checked:D,onCheckedChange:B}),a.jsxs(ut,{htmlFor:"recurring",className:"cursor-pointer font-normal flex items-center gap-1.5",children:[a.jsx(ol,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Recurring"]})]}),D&&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(ut,{children:"Frequency"}),a.jsxs(Be,{value:E,onValueChange:q=>z(q),children:[a.jsx(ze,{className:"h-8 text-xs",children:a.jsx(Ye,{})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(Ne,{value:"monthly",className:"text-xs",children:"Monthly"})]})]})]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{children:["Until ",a.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Optional"})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),a.jsx("span",{className:Q?"text-foreground":"text-muted-foreground",children:Q?he(Q,"MMM d, yyyy"):"No end date"}),Q&&a.jsx("button",{type:"button",onClick:q=>{q.stopPropagation(),K(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:Q,onSelect:K,initialFocus:!0})})]})]})]})})]})]}),a.jsxs(Vl,{className:"flex-col-reverse sm:flex-row sm:items-center sm:justify-between gap-2",children:[a.jsxs(ee,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground gap-1.5 justify-start sm:justify-center",onClick:()=>{ae(),o(`/${l}/projects/${c}/issues/new`)},children:[a.jsx(b1,{className:"h-3.5 w-3.5"}),"Open full form"]}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx(ee,{type:"button",variant:"ghost",onClick:ae,children:"Cancel"}),a.jsx(ee,{type:"submit",disabled:!u.trim()||se.isPending,children:se.isPending?"Creating...":"Create issue"})]})]})]})]})})}const pg={byIssue:e=>["attachments",e]};function ZN(e){return We({queryKey:pg.byIssue(e),queryFn:()=>re.get(`/admin/issues/${e}/attachments`),select:t=>t.attachments,enabled:!!e})}function JN(e){const t=Se();return be({mutationFn:({file:r,commentId:n})=>{const s=new FormData;return s.append("file",r),n&&s.append("comment_id",n),re.upload(`/admin/issues/${e}/attachments`,s)},onSuccess:()=>{t.invalidateQueries({queryKey:pg.byIssue(e)})}})}function U4(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/issues/${e}/attachments/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:pg.byIssue(e)})}})}function ul(e){return e.startsWith("image/")}function Xu(e){return e.startsWith("video/")}function Qu(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function md(e){if(e.startsWith("/"))return!0;try{const{protocol:t}=new URL(e);return t==="http:"||t==="https:"}catch{return!1}}function gg(e,t){if(!md(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 xg({mimeType:e,className:t}){return ul(e)?a.jsx(UA,{className:t}):Xu(e)?a.jsx(Cu,{className:t}):e.startsWith("text/")||e.includes("json")?a.jsx(WA,{className:t}):e.includes("zip")||e.includes("tar")||e.includes("gz")?a.jsx(BA,{className:t}):e.includes("pdf")||e.includes("word")||e.includes("document")?a.jsx(qA,{className:t}):a.jsx(HA,{className:t})}function ek({attachment:e,onClose:t}){return e?a.jsx(li,{open:!0,onOpenChange:r=>!r&&t(),children:a.jsxs(ci,{className:"max-w-2xl w-full p-0 overflow-hidden",children:[a.jsxs(oo,{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(ee,{variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:()=>gg(e.url,e.original_name),children:[a.jsx(Bp,{className:"h-3.5 w-3.5"}),"Download"]})]}),a.jsxs(lo,{className:"flex items-center justify-center bg-black/5 dark:bg-black/30 min-h-[320px] max-h-[75vh] overflow-auto p-0",children:[ul(e.mime_type)&&md(e.url)&&a.jsx("img",{src:e.url,alt:e.original_name,className:"max-w-full max-h-[75vh] object-contain"}),Xu(e.mime_type)&&md(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:Qu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:e.mime_type}),a.jsx("span",{children:"·"}),a.jsxs("span",{children:["Uploaded ",he(new Date(e.created_at),"MMM d, yyyy")]})]})]})}):null}function q4({attachment:e}){const[t,r]=h.useState(null),n=ul(e.mime_type)||Xu(e.mime_type),s=()=>{n?r(e):gg(e.url,e.original_name)};return a.jsxs(a.Fragment,{children:[ul(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:md(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(xg,{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:Qu(e.size)}),!n&&a.jsx(Bp,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]}),t&&a.jsx(ek,{attachment:t,onClose:()=>r(null)})]})}function H4({attachment:e,onOpen:t,onDelete:r,isDeleting:n}){const s=ul(e.mime_type)||Xu(e.mime_type),i=()=>{s?t(e):gg(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(xg,{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:Qu(e.size)}),a.jsx("span",{children:"·"}),a.jsx("span",{children:he(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(Bp,{className:"h-2.5 w-2.5"}),"Click to download"]})]})]})]}),a.jsx(ee,{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($r,{className:"h-3.5 w-3.5"})})]})}function K4({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:R("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(gD,{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 Y4({issueId:e,className:t}){const[r,n]=h.useState(null),{data:s,isLoading:i}=ZN(e),o=JN(e),l=U4(e),c=u=>{u.forEach(f=>{o.mutate({file:f},{onSuccess:()=>L.success(`${f.name} uploaded`),onError:()=>L.error(`Failed to upload ${f.name}`)})})},d=u=>{l.mutate(u,{onSuccess:()=>L.success("Attachment removed"),onError:()=>L.error("Failed to remove attachment")})};return a.jsxs("div",{className:R("px-6 py-4 space-y-4",t),children:[a.jsx(K4,{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(ue,{className:"h-8 w-8 rounded-md shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(ue,{className:"h-3 w-2/3"}),a.jsx(ue,{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(Up,{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(H4,{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(ek,{attachment:r,onClose:()=>n(null)})]})}const is={byIssue:e=>["time-logs",e],activeTimer:e=>["time-logs",e,"active-timer"]};function G4(e){return We({queryKey:is.byIssue(e),queryFn:()=>re.get(`/admin/issues/${e}/time-logs`),enabled:!!e})}function V4(e){return We({queryKey:is.activeTimer(e),queryFn:()=>re.get(`/admin/issues/${e}/time-logs/timer`),select:t=>t.active_timer,enabled:!!e,refetchInterval:1e4})}function X4(e){const t=Se();return be({mutationFn:r=>re.post(`/admin/issues/${e}/time-logs`,r),onSuccess:()=>{t.invalidateQueries({queryKey:is.byIssue(e)})}})}function Q4(e){const t=Se();return be({mutationFn:()=>re.post(`/admin/issues/${e}/time-logs/timer`,{action:"start"}),onSuccess:()=>{t.invalidateQueries({queryKey:is.activeTimer(e)}),t.invalidateQueries({queryKey:is.byIssue(e)})}})}function Z4(e){const t=Se();return be({mutationFn:()=>re.post(`/admin/issues/${e}/time-logs/timer`,{action:"stop"}),onSuccess:()=>{t.invalidateQueries({queryKey:is.activeTimer(e)}),t.invalidateQueries({queryKey:is.byIssue(e)})}})}function J4(e){const t=Se();return be({mutationFn:r=>re.delete(`/admin/issues/${e}/time-logs/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:is.byIssue(e)})}})}const e$=$l("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 Zu({className:e,variant:t,...r}){return a.jsx("div",{className:R(e$({variant:t}),e),...r})}function vh(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function oy(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 t$({startedAt:e}){const[t,r]=h.useState(()=>oy(e));return h.useEffect(()=>{const n=setInterval(()=>r(oy(e)),1e3);return()=>clearInterval(n)},[e]),a.jsx("span",{className:"font-mono tabular-nums text-sm font-semibold text-foreground",children:t})}function r$({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),g=parseInt(i||"0",10),x=p*60+g;if(x<=0){L.error("Please enter a duration greater than 0.");return}e({duration_minutes:x,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(Ae,{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(Ae,{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(Ae,{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(Ae,{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(ee,{type:"button",variant:"ghost",size:"sm",onClick:r,className:"h-7 text-xs",children:"Cancel"}),a.jsx(ee,{type:"submit",size:"sm",disabled:t,className:"h-7 text-xs",children:t?"Saving…":"Log time"})]})]})}function n$({entry:e,userName:t,onDelete:r,isDeleting:n}){const s=e.started_at!=null&&e.stopped_at==null;return 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:R("flex h-7 w-7 shrink-0 items-center justify-center rounded-full mt-0.5",s?"bg-emerald-50 dark:bg-emerald-950/40":"bg-muted"),children:s?a.jsx(fD,{className:"h-3.5 w-3.5 text-emerald-600"}):e.source==="timer"?a.jsx(Xn,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(LA,{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-1.5 flex-wrap",children:[s?a.jsx(t$,{startedAt:e.started_at}):a.jsx("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:vh(e.duration_minutes??0)}),a.jsx(Zu,{variant:"muted",className:R("text-[10px] px-1.5 py-0",s?"bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400":""),children:s?"Running":e.source==="timer"?"Timer":"Manual"}),t&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:t})]}),e.description&&a.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:e.description}),e.logged_date&&!s&&a.jsx("p",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:he(new Date(e.logged_date),"MMM d, yyyy")})]}),!s&&a.jsx(ee,{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 mt-0.5",onClick:()=>r(e.id),disabled:n,children:a.jsx($r,{className:"h-3.5 w-3.5"})})]})}function a$({issueId:e,className:t}){const[r,n]=h.useState(!1),{data:s,isLoading:i}=G4(e),{data:o}=V4(e),{data:l}=di(),c=X4(e),d=Q4(e),u=Z4(e),f=J4(e),m=(s==null?void 0:s.time_logs)??[],p=(s==null?void 0:s.total_minutes)??0,g=o!=null,x=N=>{c.mutate(N,{onSuccess:()=>{n(!1),L.success("Time logged")},onError:()=>L.error("Failed to log time")})},v=()=>{d.mutate(void 0,{onSuccess:()=>L.success("Timer started"),onError:N=>L.error(N.message??"Failed to start timer")})},y=()=>{u.mutate(void 0,{onSuccess:N=>{const j=N.time_log.duration_minutes??0;L.success(`Timer stopped — ${vh(j)} logged`)},onError:()=>L.error("Failed to stop timer")})},w=N=>{f.mutate(N,{onSuccess:()=>L.success("Time entry removed"),onError:()=>L.error("Failed to remove entry")})};return a.jsxs("div",{className:R("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:p>0?vh(p):"—"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[!r&&a.jsxs(ee,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>n(!0),children:[a.jsx(ct,{className:"h-3.5 w-3.5"}),"Log time"]}),g?a.jsxs(ee,{size:"sm",variant:"destructive",className:"h-8 text-xs gap-1.5",onClick:y,disabled:u.isPending,children:[a.jsx(oD,{className:"h-3.5 w-3.5 fill-current"}),"Stop"]}):a.jsxs(ee,{size:"sm",className:"h-8 text-xs gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",onClick:v,disabled:d.isPending,children:[a.jsx(Cu,{className:"h-3.5 w-3.5 fill-current"}),"Start"]})]})]}),r&&a.jsx(r$,{onSubmit:x,isPending:c.isPending,onCancel:()=>n(!1)}),i?a.jsx("div",{className:"space-y-2",children:[1,2].map(N=>a.jsxs("div",{className:"flex items-center gap-3 px-3",children:[a.jsx(ue,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(ue,{className:"h-3 w-1/3"}),a.jsx(ue,{className:"h-2.5 w-1/4"})]})]},N))}):m.length>0?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx(Xn,{className:"h-3 w-3 text-muted-foreground"}),a.jsxs("span",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider",children:[m.length," ",m.length===1?"entry":"entries"]})]}),a.jsx("div",{children:m.map(N=>{var j;return a.jsx(n$,{entry:N,userName:(j=l==null?void 0:l.get(N.user_id))==null?void 0:j.name,onDelete:w,isDeleting:f.isPending},N.id)})})]}):a.jsx("p",{className:"text-sm text-muted-foreground/50 text-center py-1",children:"No time logged yet."})]})}function s$(e){var t;const{char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:l}=e,c=n&&!s,d=JM(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"),g=((t=l.nodeBefore)==null?void 0:t.isText)&&l.nodeBefore.text;if(!g)return null;const x=l.pos-g.length,v=Array.from(g.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=x+v.index;let j=N+v[0].length;return c&&u.test(g.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 i$=new Hj("suggestion");function o$({pluginKey:e=i$,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:g=()=>!0,findSuggestionMatch:x=s$,shouldShow:v}){let y;const w=p==null?void 0:p(),N=()=>{const C=t.state.selection.$anchor.pos,S=t.view.coordsAtPos(C),{top:_,right:A,bottom:M,left:P}=S;try{return new DOMRect(P,_,A-P,M-_)}catch{return null}},j=(C,S)=>S?()=>{const _=e.getState(t.state),A=_==null?void 0:_.decorationId,M=C.dom.querySelector(`[data-decoration-id="${A}"]`);return(M==null?void 0:M.getBoundingClientRect())||null}:N;function k(C,S){var _;try{const M=e.getState(C.state),P=M!=null&&M.decorationId?C.dom.querySelector(`[data-decoration-id="${M.decorationId}"]`):null,T={editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},query:(M==null?void 0:M.query)||null,text:(M==null?void 0:M.text)||null,items:[],command:D=>f({editor:t,range:(M==null?void 0:M.range)||{from:0,to:0},props:D}),decorationNode:P,clientRect:j(C,P)};(_=w==null?void 0:w.onExit)==null||_.call(w,T)}catch{}const A=C.state.tr.setMeta(S,{exit:!0});C.dispatch(A)}const b=new XM({key:e,view(){return{update:async(C,S)=>{var _,A,M,P,T,D,B;const E=(_=this.key)==null?void 0:_.getState(S),z=(A=this.key)==null?void 0:A.getState(C.state),Q=E.active&&z.active&&E.range.from!==z.range.from,K=!E.active&&z.active,se=E.active&&!z.active,te=!K&&!se&&E.query!==z.query,U=K||Q&&te,G=te||Q,J=se||Q&&te;if(!U&&!G&&!J)return;const X=J&&!U?E:z,O=C.dom.querySelector(`[data-decoration-id="${X.decorationId}"]`);y={editor:t,range:X.range,query:X.query,text:X.text,items:[],command:F=>f({editor:t,range:X.range,props:F}),decorationNode:O,clientRect:j(C,O)},U&&((M=w==null?void 0:w.onBeforeStart)==null||M.call(w,y)),G&&((P=w==null?void 0:w.onBeforeUpdate)==null||P.call(w,y)),(G||U)&&(y.items=await m({editor:t,query:X.query})),J&&((T=w==null?void 0:w.onExit)==null||T.call(w,y)),G&&((D=w==null?void 0:w.onUpdate)==null||D.call(w,y)),U&&((B=w==null?void 0:w.onStart)==null||B.call(w,y))},destroy:()=>{var C;y&&((C=w==null?void 0:w.onExit)==null||C.call(w,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,S,_,A){const{isEditable:M}=t,{composing:P}=t.view,{selection:T}=C,{empty:D,from:B}=T,E={...S},z=C.getMeta(e);if(z&&z.exit)return E.active=!1,E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null,E;if(E.composing=P,M&&(D||t.view.composing)){(B<S.range.from||B>S.range.to)&&!P&&!S.composing&&(E.active=!1);const Q=x({char:r,allowSpaces:n,allowToIncludeChar:s,allowedPrefixes:i,startOfLine:o,$position:T.$from}),K=`id_${Math.floor(Math.random()*4294967295)}`;Q&&g({editor:t,state:A,range:Q.range,isActive:S.active})&&(!v||v({editor:t,range:Q.range,query:Q.query,text:Q.text,transaction:C}))?(E.active=!0,E.decorationId=S.decorationId?S.decorationId:K,E.range=Q.range,E.query=Q.query,E.text=Q.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(C,S){var _,A,M,P;const{active:T,range:D}=b.getState(C.state);if(!T)return!1;if(S.key==="Escape"||S.key==="Esc"){const E=b.getState(C.state),z=(_=y==null?void 0:y.decorationNode)!=null?_:null,Q=z??(E!=null&&E.decorationId?C.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`):null);if(((A=w==null?void 0:w.onKeyDown)==null?void 0:A.call(w,{view:C,event:S,range:E.range}))||!1)return!0;const se={editor:t,range:E.range,query:E.query,text:E.text,items:[],command:te=>f({editor:t,range:E.range,props:te}),decorationNode:Q,clientRect:Q?()=>Q.getBoundingClientRect()||null:null};return(M=w==null?void 0:w.onExit)==null||M.call(w,se),k(C,e),!0}return((P=w==null?void 0:w.onKeyDown)==null?void 0:P.call(w,{view:C,event:S,range:D}))||!1},decorations(C){const{active:S,range:_,decorationId:A,query:M}=b.getState(C);if(!S)return null;const P=!(M!=null&&M.length),T=[c];return P&&T.push(u),QM.create(C.doc,[ZM.inline(_.from,_.to,{nodeName:l,class:T.join(" "),"data-decoration-id":A,"data-decoration-content":d})])}}});return b}function l$({editor:e,overrideSuggestionOptions:t,extensionName:r,char:n="@"}){const s=new Hj;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 tk(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>l$({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function ly(e,t){const r=tk(e),n=r.find(s=>s.char===t);return n||(r.length?r[0]:null)}var c$=eE.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",Nc(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=ly(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Nc({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:r})];const n={...this.options};n.HTMLAttributes=Nc({"data-type":this.name},this.options.HTMLAttributes,t);const s=this.options.renderHTML({options:n,node:e,suggestion:r});return typeof s=="string"?["span",Nc({"data-type":this.name},this.options.HTMLAttributes,t),s]:s},...rE({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:ly(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 tE,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 tk(this).map(o$)}}),d$=c$;function u$({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:R("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=bg(s.label);return a.jsxs("button",{"data-index":i,role:"option","aria-selected":i===t,onMouseDown:c=>{c.preventDefault(),r(s)},className:R("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(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{className:R("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)})})})}function xs({onClick:e,active:t,title:r,children:n}){return a.jsx("button",{type:"button",title:r,onMouseDown:s=>{s.preventDefault(),e()},className:R("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 cy(){return a.jsx("span",{className:"mx-0.5 h-3.5 w-px shrink-0 bg-border"})}const Ec={active:!1,items:[],selectedIndex:0,rect:null,command:null};function rk({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(Ec),p=h.useRef(null),g=h.useRef(async()=>{}),x=h.useRef(null),{user:v}=Ie(),y=AA(e),w=JN(e),{data:N}=Qn(t??""),j=h.useMemo(()=>N!=null&&N.members?N.members.filter(O=>O.user).map(O=>{const F=O.user,ae=`${F.first_name??""} ${F.last_name??""}`.trim()||F.email;return{id:F.id,label:ae,email:F.email}}):[],[N]),k=h.useRef([]);k.current=j;const b=h.useRef(m);b.current=m;const C=h.useRef([]),S=h.useRef(null),_=h.useRef(0),A=(v==null?void 0:v.first_name)??"",M=(v==null?void 0:v.last_name)??"",P=`${A} ${M}`.trim()||(v==null?void 0:v.email)||"?",T=v&&`${A[0]??""}${M[0]??""}`.toUpperCase()||"?",D=bg(P),B=h.useMemo(()=>nE.create({name:"submitShortcut",addKeyboardShortcuts(){return{"Mod-Enter":()=>(g.current(),!0)}}}),[]),E=h.useMemo(()=>d$.configure({HTMLAttributes:{class:"mention"},suggestion:{items:({query:O})=>{const F=k.current;if(!F.length)return[];const ae=O.toLowerCase();return F.filter(W=>!ae||W.label.toLowerCase().includes(ae)||W.email.toLowerCase().includes(ae)).slice(0,8)},render:()=>({onStart:O=>{var F;C.current=O.items,S.current=O.command,_.current=0,b.current({active:!0,items:O.items,selectedIndex:0,rect:((F=O.clientRect)==null?void 0:F.call(O))??null,command:O.command})},onUpdate:O=>{var F;C.current=O.items,S.current=O.command,_.current=0,b.current({active:!0,items:O.items,selectedIndex:0,rect:((F=O.clientRect)==null?void 0:F.call(O))??null,command:O.command})},onKeyDown:({event:O})=>{var ae;const F=C.current;if(!F.length)return!1;if(O.key==="Escape")return b.current(Ec),!0;if(O.key==="ArrowDown"){const W=(_.current+1)%F.length;return _.current=W,b.current(q=>({...q,selectedIndex:W})),!0}if(O.key==="ArrowUp"){const W=(_.current-1+F.length)%F.length;return _.current=W,b.current(q=>({...q,selectedIndex:W})),!0}if(O.key==="Enter"){const W=F[_.current];return W&&((ae=S.current)==null||ae.call(S,W)),!0}return!1},onExit:()=>{b.current(Ec),S.current=null}})}}),[]),z=Kj({extensions:[Yj,Gj,Vj.configure({placeholder:"Leave a comment… (type @ to mention)"}),B,E],editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:O}){o(O.isEmpty)}}),Q=!i||l.length>0,K=25*1024*1024,se=O=>{const F=O.filter(W=>W.size>K);F.length>0&&L.error(`Files must be under 25 MB: ${F.map(W=>W.name).join(", ")}`);const ae=O.filter(W=>W.size<=K);c(W=>{const q=new Set(W.map(le=>`${le.name}-${le.size}`));return[...W,...ae.filter(le=>!q.has(`${le.name}-${le.size}`))]})},te=O=>{c(F=>F.filter((ae,W)=>W!==O))},U=h.useCallback(O=>{var F;(F=S.current)==null||F.call(S,O),m(Ec)},[]),G=async()=>{if(!(!Q||d)){u(!0);try{const O=z!=null&&z.isEmpty?"":(z==null?void 0:z.getHTML())??"",F=[];O&&new DOMParser().parseFromString(O,"text/html").querySelectorAll("[data-type='mention']").forEach(de=>{const V=de.getAttribute("data-id");V&&!F.includes(V)&&F.push(V)});const ae=F.length>0?{mentioned_user_ids:F}:void 0,q=(await y.mutateAsync({body:O||" ",metadata:ae})).comment.id;for(const le of l)await w.mutateAsync({file:le,commentId:q});z==null||z.commands.clearContent(),o(!0),c([]),L.success("Comment added"),s==null||s()}catch{L.error("Failed to add comment")}finally{u(!1)}}};g.current=G;const J="h-3 w-3",X=h.useMemo(()=>{if(!f.rect||!x.current)return{bottom:"105%",left:0};const O=x.current.getBoundingClientRect(),F=Math.max(0,f.rect.left-O.left);return{top:f.rect.bottom-O.top+4,left:F}},[f.rect]);return a.jsxs("div",{className:R("flex gap-3 items-start",n),children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0 mt-1",children:a.jsx(Bt,{className:R("text-[11px] font-semibold",D.bg,D.text),children:T})}),a.jsxs("div",{className:"flex-1 min-w-0 relative",ref:x,children:[a.jsxs("div",{className:R("rounded-md border border-input overflow-hidden transition-shadow","focus-within:ring-1 focus-within:ring-ring",d&&"opacity-60 pointer-events-none"),children:[z&&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(xs,{title:"Bold (⌘B)",active:z.isActive("bold"),onClick:()=>z.chain().focus().toggleBold().run(),children:a.jsx(h1,{className:J})}),a.jsx(xs,{title:"Italic (⌘I)",active:z.isActive("italic"),onClick:()=>z.chain().focus().toggleItalic().run(),children:a.jsx(j1,{className:J})}),a.jsx(xs,{title:"Strikethrough",active:z.isActive("strike"),onClick:()=>z.chain().focus().toggleStrike().run(),children:a.jsx(O1,{className:J})}),a.jsx(xs,{title:"Inline code",active:z.isActive("code"),onClick:()=>z.chain().focus().toggleCode().run(),children:a.jsx(y1,{className:J})}),a.jsx(cy,{}),a.jsx(xs,{title:"Bullet list",active:z.isActive("bulletList"),onClick:()=>z.chain().focus().toggleBulletList().run(),children:a.jsx(k1,{className:J})}),a.jsx(xs,{title:"Ordered list",active:z.isActive("orderedList"),onClick:()=>z.chain().focus().toggleOrderedList().run(),children:a.jsx(N1,{className:J})}),a.jsx(cy,{}),a.jsx(xs,{title:"Code block",active:z.isActive("codeBlock"),onClick:()=>z.chain().focus().toggleCodeBlock().run(),children:a.jsx(v1,{className:J})})]}),a.jsx(Xj,{editor:z,className:R("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((O,F)=>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(xg,{mimeType:O.type,className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:"truncate",children:O.name}),a.jsxs("span",{className:"text-muted-foreground shrink-0",children:["(",Qu(O.size),")"]}),a.jsx("button",{type:"button",onClick:()=>te(F),className:"ml-0.5 rounded hover:text-destructive transition-colors shrink-0",children:a.jsx(at,{className:"h-3 w-3"})})]},F))}),a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(ee,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>{var O;return(O=p.current)==null?void 0:O.click()},disabled:d,title:"Attach files",children:a.jsx(Up,{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(ee,{size:"icon",className:"h-8 w-8",onClick:G,disabled:!Q||d,children:a.jsx(aD,{className:"h-3.5 w-3.5"})})]}),a.jsx("input",{ref:p,type:"file",multiple:!0,className:"hidden",onChange:O=>{const F=Array.from(O.target.files??[]);F.length>0&&se(F),O.target.value=""}}),f.active&&f.items.length>0&&a.jsx("div",{className:"absolute z-[9999]",style:X,children:a.jsx(u$,{items:f.items,selectedIndex:f.selectedIndex,onSelect:U})})]})]})}/*! @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:nk,setPrototypeOf:dy,isFrozen:f$,getPrototypeOf:m$,getOwnPropertyDescriptor:h$}=Object;let{freeze:kr,seal:on,create:yh}=Object,{apply:bh,construct:wh}=typeof Reflect<"u"&&Reflect;kr||(kr=function(t){return t});on||(on=function(t){return t});bh||(bh=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)});wh||(wh=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 Ac=Sr(Array.prototype.forEach),p$=Sr(Array.prototype.lastIndexOf),uy=Sr(Array.prototype.pop),Io=Sr(Array.prototype.push),g$=Sr(Array.prototype.splice),ad=Sr(String.prototype.toLowerCase),Sm=Sr(String.prototype.toString),Cm=Sr(String.prototype.match),Ro=Sr(String.prototype.replace),x$=Sr(String.prototype.indexOf),v$=Sr(String.prototype.trim),xn=Sr(Object.prototype.hasOwnProperty),vr=Sr(RegExp.prototype.test),$o=y$(TypeError);function Sr(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 bh(e,t,n)}}function y$(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return wh(e,r)}}function $e(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ad;dy&&dy(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=r(s);i!==s&&(f$(t)||(t[n]=i),s=i)}e[s]=!0}return e}function b$(e){for(let t=0;t<e.length;t++)xn(e,t)||(e[t]=null);return e}function $n(e){const t=yh(null);for(const[r,n]of nk(e))xn(e,r)&&(Array.isArray(n)?t[r]=b$(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=$n(n):t[r]=n);return t}function zo(e,t){for(;e!==null;){const n=h$(e,t);if(n){if(n.get)return Sr(n.get);if(typeof n.value=="function")return Sr(n.value)}e=m$(e)}function r(){return null}return r}const fy=kr(["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"]),_m=kr(["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"]),Om=kr(["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"]),w$=kr(["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"]),Pm=kr(["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"]),j$=kr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),my=kr(["#text"]),hy=kr(["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"]),Mm=kr(["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"]),py=kr(["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"]),Dc=kr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N$=on(/\{\{[\w\W]*|[\w\W]*\}\}/gm),k$=on(/<%[\w\W]*|[\w\W]*%>/gm),S$=on(/\$\{[\w\W]*/gm),C$=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),_$=on(/^aria-[\-\w]+$/),ak=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),O$=on(/^(?:\w+script|data):/i),P$=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sk=on(/^html$/i),M$=on(/^[a-z][.\w]*(-[.\w]+)+$/i);var gy=Object.freeze({__proto__:null,ARIA_ATTR:_$,ATTR_WHITESPACE:P$,CUSTOM_ELEMENT:M$,DATA_ATTR:C$,DOCTYPE_NAME:sk,ERB_EXPR:k$,IS_ALLOWED_URI:ak,IS_SCRIPT_OR_DATA:O$,MUSTACHE_EXPR:N$,TMPLIT_EXPR:S$});const Lo={element:1,text:3,progressingInstruction:7,comment:8,document:9},E$=function(){return typeof window>"u"?null:window},A$=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}},xy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ik(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E$();const t=Me=>ik(Me);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Lo.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,g=c.prototype,x=zo(g,"cloneNode"),v=zo(g,"remove"),y=zo(g,"nextSibling"),w=zo(g,"childNodes"),N=zo(g,"parentNode");if(typeof o=="function"){const Me=r.createElement("template");Me.content&&Me.content.ownerDocument&&(r=Me.content.ownerDocument)}let j,k="";const{implementation:b,createNodeIterator:C,createDocumentFragment:S,getElementsByTagName:_}=r,{importNode:A}=n;let M=xy();t.isSupported=typeof nk=="function"&&typeof N=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:T,TMPLIT_EXPR:D,DATA_ATTR:B,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:z,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:K}=gy;let{IS_ALLOWED_URI:se}=gy,te=null;const U=$e({},[...fy,..._m,...Om,...Pm,...my]);let G=null;const J=$e({},[...hy,...Mm,...py,...Dc]);let X=Object.seal(yh(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}})),O=null,F=null;const ae=Object.seal(yh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,q=!0,le=!1,Z=!0,de=!1,V=!0,oe=!1,pe=!1,we=!1,_e=!1,H=!1,ve=!1,De=!0,He=!1;const Fe="user-content-";let Qe=!0,gt=!1,Ge={},Ze=null;const pr=$e({},["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 mn=null;const Pr=$e({},["audio","video","img","source","image","track"]);let hn=null;const gr=$e({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",qt="http://www.w3.org/1999/xhtml";let er=qt,Mn=!1,ta=null;const Pe=$e({},[Ct,Rt,qt],Sm);let me=$e({},["mi","mo","mn","ms","mtext"]),ye=$e({},["annotation-xml"]);const fe=$e({},["title","style","font","a","script"]);let ge=null;const Ve=["application/xhtml+xml","text/html"],ie="text/html";let Ce=null,Te=null;const xt=r.createElement("form"),tt=function($){return $ instanceof RegExp||$ instanceof Function},rt=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Te&&Te===$)){if((!$||typeof $!="object")&&($={}),$=$n($),ge=Ve.indexOf($.PARSER_MEDIA_TYPE)===-1?ie:$.PARSER_MEDIA_TYPE,Ce=ge==="application/xhtml+xml"?Sm:ad,te=xn($,"ALLOWED_TAGS")?$e({},$.ALLOWED_TAGS,Ce):U,G=xn($,"ALLOWED_ATTR")?$e({},$.ALLOWED_ATTR,Ce):J,ta=xn($,"ALLOWED_NAMESPACES")?$e({},$.ALLOWED_NAMESPACES,Sm):Pe,hn=xn($,"ADD_URI_SAFE_ATTR")?$e($n(gr),$.ADD_URI_SAFE_ATTR,Ce):gr,mn=xn($,"ADD_DATA_URI_TAGS")?$e($n(Pr),$.ADD_DATA_URI_TAGS,Ce):Pr,Ze=xn($,"FORBID_CONTENTS")?$e({},$.FORBID_CONTENTS,Ce):pr,O=xn($,"FORBID_TAGS")?$e({},$.FORBID_TAGS,Ce):$n({}),F=xn($,"FORBID_ATTR")?$e({},$.FORBID_ATTR,Ce):$n({}),Ge=xn($,"USE_PROFILES")?$.USE_PROFILES:!1,W=$.ALLOW_ARIA_ATTR!==!1,q=$.ALLOW_DATA_ATTR!==!1,le=$.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,de=$.SAFE_FOR_TEMPLATES||!1,V=$.SAFE_FOR_XML!==!1,oe=$.WHOLE_DOCUMENT||!1,_e=$.RETURN_DOM||!1,H=$.RETURN_DOM_FRAGMENT||!1,ve=$.RETURN_TRUSTED_TYPE||!1,we=$.FORCE_BODY||!1,De=$.SANITIZE_DOM!==!1,He=$.SANITIZE_NAMED_PROPS||!1,Qe=$.KEEP_CONTENT!==!1,gt=$.IN_PLACE||!1,se=$.ALLOWED_URI_REGEXP||ak,er=$.NAMESPACE||qt,me=$.MATHML_TEXT_INTEGRATION_POINTS||me,ye=$.HTML_INTEGRATION_POINTS||ye,X=$.CUSTOM_ELEMENT_HANDLING||{},$.CUSTOM_ELEMENT_HANDLING&&tt($.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=$.CUSTOM_ELEMENT_HANDLING.tagNameCheck),$.CUSTOM_ELEMENT_HANDLING&&tt($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=$.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=$.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),de&&(q=!1),H&&(_e=!0),Ge&&(te=$e({},my),G=[],Ge.html===!0&&($e(te,fy),$e(G,hy)),Ge.svg===!0&&($e(te,_m),$e(G,Mm),$e(G,Dc)),Ge.svgFilters===!0&&($e(te,Om),$e(G,Mm),$e(G,Dc)),Ge.mathMl===!0&&($e(te,Pm),$e(G,py),$e(G,Dc))),$.ADD_TAGS&&(typeof $.ADD_TAGS=="function"?ae.tagCheck=$.ADD_TAGS:(te===U&&(te=$n(te)),$e(te,$.ADD_TAGS,Ce))),$.ADD_ATTR&&(typeof $.ADD_ATTR=="function"?ae.attributeCheck=$.ADD_ATTR:(G===J&&(G=$n(G)),$e(G,$.ADD_ATTR,Ce))),$.ADD_URI_SAFE_ATTR&&$e(hn,$.ADD_URI_SAFE_ATTR,Ce),$.FORBID_CONTENTS&&(Ze===pr&&(Ze=$n(Ze)),$e(Ze,$.FORBID_CONTENTS,Ce)),$.ADD_FORBID_CONTENTS&&(Ze===pr&&(Ze=$n(Ze)),$e(Ze,$.ADD_FORBID_CONTENTS,Ce)),Qe&&(te["#text"]=!0),oe&&$e(te,["html","head","body"]),te.table&&($e(te,["tbody"]),delete O.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw $o('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $o('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');j=$.TRUSTED_TYPES_POLICY,k=j.createHTML("")}else j===void 0&&(j=A$(p,s)),j!==null&&typeof k=="string"&&(k=j.createHTML(""));kr&&kr($),Te=$}},xr=$e({},[..._m,...Om,...w$]),tr=$e({},[...Pm,...j$]),En=function($){let ce=N($);(!ce||!ce.tagName)&&(ce={namespaceURI:er,tagName:"template"});const je=ad($.tagName),mt=ad(ce.tagName);return ta[$.namespaceURI]?$.namespaceURI===Rt?ce.namespaceURI===qt?je==="svg":ce.namespaceURI===Ct?je==="svg"&&(mt==="annotation-xml"||me[mt]):!!xr[je]:$.namespaceURI===Ct?ce.namespaceURI===qt?je==="math":ce.namespaceURI===Rt?je==="math"&&ye[mt]:!!tr[je]:$.namespaceURI===qt?ce.namespaceURI===Rt&&!ye[mt]||ce.namespaceURI===Ct&&!me[mt]?!1:!tr[je]&&(fe[je]||!xr[je]):!!(ge==="application/xhtml+xml"&&ta[$.namespaceURI]):!1},An=function($){Io(t.removed,{element:$});try{N($).removeChild($)}catch{v($)}},hs=function($,ce){try{Io(t.removed,{attribute:ce.getAttributeNode($),from:ce})}catch{Io(t.removed,{attribute:null,from:ce})}if(ce.removeAttribute($),$==="is")if(_e||H)try{An(ce)}catch{}else try{ce.setAttribute($,"")}catch{}},pv=function($){let ce=null,je=null;if(we)$="<remove></remove>"+$;else{const Et=Cm($,/^[\r\n\t ]+/);je=Et&&Et[0]}ge==="application/xhtml+xml"&&er===qt&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const mt=j?j.createHTML($):$;if(er===qt)try{ce=new m().parseFromString(mt,ge)}catch{}if(!ce||!ce.documentElement){ce=b.createDocument(er,"template",null);try{ce.documentElement.innerHTML=Mn?k:mt}catch{}}const cr=ce.body||ce.documentElement;return $&&je&&cr.insertBefore(r.createTextNode(je),cr.childNodes[0]||null),er===qt?_.call(ce,oe?"html":"body")[0]:oe?ce.documentElement:cr},gv=function($){return C.call($.ownerDocument||$,$,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},rm=function($){return $ instanceof f&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof u)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},xv=function($){return typeof l=="function"&&$ instanceof l};function ra(Me,$,ce){Ac(Me,je=>{je.call(t,$,ce,Te)})}const vv=function($){let ce=null;if(ra(M.beforeSanitizeElements,$,null),rm($))return An($),!0;const je=Ce($.nodeName);if(ra(M.uponSanitizeElement,$,{tagName:je,allowedTags:te}),V&&$.hasChildNodes()&&!xv($.firstElementChild)&&vr(/<[/\w!]/g,$.innerHTML)&&vr(/<[/\w!]/g,$.textContent)||$.nodeType===Lo.progressingInstruction||V&&$.nodeType===Lo.comment&&vr(/<[/\w]/g,$.data))return An($),!0;if(!(ae.tagCheck instanceof Function&&ae.tagCheck(je))&&(!te[je]||O[je])){if(!O[je]&&bv(je)&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,je)||X.tagNameCheck instanceof Function&&X.tagNameCheck(je)))return!1;if(Qe&&!Ze[je]){const mt=N($)||$.parentNode,cr=w($)||$.childNodes;if(cr&&mt){const Et=cr.length;for(let Mr=Et-1;Mr>=0;--Mr){const na=x(cr[Mr],!0);na.__removalCount=($.__removalCount||0)+1,mt.insertBefore(na,y($))}}}return An($),!0}return $ instanceof c&&!En($)||(je==="noscript"||je==="noembed"||je==="noframes")&&vr(/<\/no(script|embed|frames)/i,$.innerHTML)?(An($),!0):(de&&$.nodeType===Lo.text&&(ce=$.textContent,Ac([P,T,D],mt=>{ce=Ro(ce,mt," ")}),$.textContent!==ce&&(Io(t.removed,{element:$.cloneNode()}),$.textContent=ce)),ra(M.afterSanitizeElements,$,null),!1)},yv=function($,ce,je){if(De&&(ce==="id"||ce==="name")&&(je in r||je in xt))return!1;if(!(q&&!F[ce]&&vr(B,ce))){if(!(W&&vr(E,ce))){if(!(ae.attributeCheck instanceof Function&&ae.attributeCheck(ce,$))){if(!G[ce]||F[ce]){if(!(bv($)&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,$)||X.tagNameCheck instanceof Function&&X.tagNameCheck($))&&(X.attributeNameCheck instanceof RegExp&&vr(X.attributeNameCheck,ce)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(ce,$))||ce==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&vr(X.tagNameCheck,je)||X.tagNameCheck instanceof Function&&X.tagNameCheck(je))))return!1}else if(!hn[ce]){if(!vr(se,Ro(je,Q,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&$!=="script"&&x$(je,"data:")===0&&mn[$])){if(!(le&&!vr(z,Ro(je,Q,"")))){if(je)return!1}}}}}}}return!0},bv=function($){return $!=="annotation-xml"&&Cm($,K)},wv=function($){ra(M.beforeSanitizeAttributes,$,null);const{attributes:ce}=$;if(!ce||rm($))return;const je={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let mt=ce.length;for(;mt--;){const cr=ce[mt],{name:Et,namespaceURI:Mr,value:na}=cr,pi=Ce(Et),nm=na;let rr=Et==="value"?nm:v$(nm);if(je.attrName=pi,je.attrValue=rr,je.keepAttr=!0,je.forceKeepAttr=void 0,ra(M.uponSanitizeAttribute,$,je),rr=je.attrValue,He&&(pi==="id"||pi==="name")&&(hs(Et,$),rr=Fe+rr),V&&vr(/((--!?|])>)|<\/(style|title|textarea)/i,rr)){hs(Et,$);continue}if(pi==="attributename"&&Cm(rr,"href")){hs(Et,$);continue}if(je.forceKeepAttr)continue;if(!je.keepAttr){hs(Et,$);continue}if(!Z&&vr(/\/>/i,rr)){hs(Et,$);continue}de&&Ac([P,T,D],Nv=>{rr=Ro(rr,Nv," ")});const jv=Ce($.nodeName);if(!yv(jv,pi,rr)){hs(Et,$);continue}if(j&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Mr)switch(p.getAttributeType(jv,pi)){case"TrustedHTML":{rr=j.createHTML(rr);break}case"TrustedScriptURL":{rr=j.createScriptURL(rr);break}}if(rr!==nm)try{Mr?$.setAttributeNS(Mr,Et,rr):$.setAttribute(Et,rr),rm($)?An($):uy(t.removed)}catch{hs(Et,$)}}ra(M.afterSanitizeAttributes,$,null)},YP=function Me($){let ce=null;const je=gv($);for(ra(M.beforeSanitizeShadowDOM,$,null);ce=je.nextNode();)ra(M.uponSanitizeShadowNode,ce,null),vv(ce),wv(ce),ce.content instanceof i&&Me(ce.content);ra(M.afterSanitizeShadowDOM,$,null)};return t.sanitize=function(Me){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce=null,je=null,mt=null,cr=null;if(Mn=!Me,Mn&&(Me="<!-->"),typeof Me!="string"&&!xv(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw $o("dirty is not a string, aborting")}else throw $o("toString is not a function");if(!t.isSupported)return Me;if(pe||rt($),t.removed=[],typeof Me=="string"&&(gt=!1),gt){if(Me.nodeName){const na=Ce(Me.nodeName);if(!te[na]||O[na])throw $o("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof l)ce=pv("<!---->"),je=ce.ownerDocument.importNode(Me,!0),je.nodeType===Lo.element&&je.nodeName==="BODY"||je.nodeName==="HTML"?ce=je:ce.appendChild(je);else{if(!_e&&!de&&!oe&&Me.indexOf("<")===-1)return j&&ve?j.createHTML(Me):Me;if(ce=pv(Me),!ce)return _e?null:ve?k:""}ce&&we&&An(ce.firstChild);const Et=gv(gt?Me:ce);for(;mt=Et.nextNode();)vv(mt),wv(mt),mt.content instanceof i&&YP(mt.content);if(gt)return Me;if(_e){if(H)for(cr=S.call(ce.ownerDocument);ce.firstChild;)cr.appendChild(ce.firstChild);else cr=ce;return(G.shadowroot||G.shadowrootmode)&&(cr=A.call(n,cr,!0)),cr}let Mr=oe?ce.outerHTML:ce.innerHTML;return oe&&te["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&vr(sk,ce.ownerDocument.doctype.name)&&(Mr="<!DOCTYPE "+ce.ownerDocument.doctype.name+`>
|
|
541
|
-
`+Mr),de&&Ac([P,T,D],na=>{Mr=Ro(Mr,na," ")}),j&&ve?j.createHTML(Mr):Mr},t.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rt(Me),pe=!0},t.clearConfig=function(){Te=null,pe=!1},t.isValidAttribute=function(Me,$,ce){Te||rt({});const je=Ce(Me),mt=Ce($);return yv(je,mt,ce)},t.addHook=function(Me,$){typeof $=="function"&&Io(M[Me],$)},t.removeHook=function(Me,$){if($!==void 0){const ce=p$(M[Me],$);return ce===-1?void 0:g$(M[Me],ce,1)[0]}return uy(M[Me])},t.removeHooks=function(Me){M[Me]=[]},t.removeAllHooks=function(){M=xy()},t}var D$=ik();function T$({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:R("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 Tc(){return a.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border"})}function vg({content:e="",onChange:t,placeholder:r="Add a description…",className:n,toolbarClassName:s,editorClassName:i}){const o=Kj({extensions:[Yj.configure({heading:{levels:[1,2,3]}}),Gj,aE,sE.configure({nested:!0}),Vj.configure({placeholder:r})],content:e||"",editorProps:{attributes:{class:"meridian-editor"}},onUpdate({editor:d}){t&&t(d.isEmpty?"":d.getHTML())}});if(!o)return null;const l=(d,u,f,m,p)=>a.jsx(T$,{title:d,onClick:f,active:m,disabled:p,children:u},d),c="h-3.5 w-3.5";return a.jsxs("div",{className:R("flex flex-col overflow-hidden",n),children:[a.jsxs("div",{className:R("flex flex-wrap items-center gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30",s),children:[l("Undo",a.jsx(pD,{className:c}),()=>o.chain().focus().undo().run(),!1,!o.can().undo()),l("Redo",a.jsx(nD,{className:c}),()=>o.chain().focus().redo().run(),!1,!o.can().redo()),a.jsx(Tc,{}),l("Bold (⌘B)",a.jsx(h1,{className:c}),()=>o.chain().focus().toggleBold().run(),o.isActive("bold")),l("Italic (⌘I)",a.jsx(j1,{className:c}),()=>o.chain().focus().toggleItalic().run(),o.isActive("italic")),l("Underline (⌘U)",a.jsx(hD,{className:c}),()=>o.chain().focus().toggleUnderline().run(),o.isActive("underline")),l("Strikethrough",a.jsx(O1,{className:c}),()=>o.chain().focus().toggleStrike().run(),o.isActive("strike")),l("Inline code",a.jsx(y1,{className:c}),()=>o.chain().focus().toggleCode().run(),o.isActive("code")),a.jsx(Tc,{}),l("Heading 1",a.jsx(KA,{className:c}),()=>o.chain().focus().toggleHeading({level:1}).run(),o.isActive("heading",{level:1})),l("Heading 2",a.jsx(YA,{className:c}),()=>o.chain().focus().toggleHeading({level:2}).run(),o.isActive("heading",{level:2})),l("Heading 3",a.jsx(GA,{className:c}),()=>o.chain().focus().toggleHeading({level:3}).run(),o.isActive("heading",{level:3})),a.jsx(Tc,{}),l("Bullet list",a.jsx(k1,{className:c}),()=>o.chain().focus().toggleBulletList().run(),o.isActive("bulletList")),l("Ordered list",a.jsx(N1,{className:c}),()=>o.chain().focus().toggleOrderedList().run(),o.isActive("orderedList")),l("Task list",a.jsx(QA,{className:c}),()=>o.chain().focus().toggleTaskList().run(),o.isActive("taskList")),a.jsx(Tc,{}),l("Blockquote",a.jsx(rD,{className:c}),()=>o.chain().focus().toggleBlockquote().run(),o.isActive("blockquote")),l("Code block",a.jsx(v1,{className:c}),()=>o.chain().focus().toggleCodeBlock().run(),o.isActive("codeBlock")),l("Divider line",a.jsx(oi,{className:c}),()=>o.chain().focus().setHorizontalRule().run())]}),a.jsx(Xj,{editor:o,className:R("flex-1 px-5 py-4",i)})]})}function yg({html:e,className:t}){return e?a.jsx("div",{className:R("meridian-editor",t),dangerouslySetInnerHTML:{__html:D$.sanitize(e,{ADD_ATTR:["data-type","data-id","data-label"]})}}):null}const vy=[{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 bg(e){let t=0;for(let r=0;r<e.length;r++)t=t*31+e.charCodeAt(r)&65535;return vy[t%vy.length]}function I$({body:e}){const t=e.trim();return t?/^<[a-z][\s\S]*>/i.test(t)?a.jsx(yg,{html:t,className:"text-xs"}):a.jsx("p",{className:"text-xs text-foreground leading-relaxed whitespace-pre-wrap",children:t}):null}const yy={created:{icon:ct,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40"},status_changed:{icon:$p,color:"text-indigo-500",bg:"bg-indigo-50 dark:bg-indigo-950/40"},assigned:{icon:no,color:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-950/40"},unassigned:{icon:P1,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800"},updated:{icon:Ls,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40"}};function R$(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:Us[c]??c})]}),d&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:Us[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 g;return((g=t==null?void 0:t.get(p))==null?void 0:g.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:kn[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:kn[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:ss[f]??String(f)})]}),m!=null&&a.jsxs(a.Fragment,{children:[" to ",a.jsx("strong",{className:"font-medium text-foreground",children:ss[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 ok({issueId:e,projectId:t,className:r,compact:n,onViewMore:s,onTabChange:i,hideCommentInput:o}){const[l,c]=h.useState("comments"),d=j=>{c(j),i==null||i(j)},u=h.useRef(null),f=h.useRef(null),{user:m}=Ie(),{data:p}=di(),{data:g,isLoading:x}=MA(e),{data:v,isLoading:y}=EA(e),{data:w}=ZN(e);h.useEffect(()=>{var k;const j=g==null?void 0:g.length;j!==void 0&&(f.current!==null&&j>f.current&&((k=u.current)==null||k.scrollIntoView({behavior:"smooth",block:"nearest"})),f.current=j)},[g==null?void 0:g.length]);const N=j=>{var k;if(m&&j===m.id){const b=m.first_name??"",C=m.last_name??"",S=`${b} ${C}`.trim()||m.email,_=(b[0]??C[0]??((k=m.email)==null?void 0:k[0])??"U").toUpperCase();return{name:S,initials:_}}return(p==null?void 0:p.get(j))??{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(j=>{const k=j==="comments"?(g==null?void 0:g.length)??0:j==="activity"?(v==null?void 0:v.length)??0:void 0,b=j==="comments"?"Comments":j==="activity"?"Activity":j==="attachments"?"Attachments":"Time",C=l===j;return a.jsxs("button",{onClick:()=>d(j),className:R("pb-2.5 mr-5 text-xs font-medium transition-colors border-b-2 -mb-px",C?"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:[b,k!=null&&k>0&&a.jsx("span",{className:R("ml-1.5 text-[10px] tabular-nums font-normal",C?"text-indigo-700 dark:text-indigo-500":"text-zinc-400"),children:k})]},j)})}),l==="comments"&&a.jsxs("div",{className:"px-6 pb-5 pt-4",children:[a.jsx("div",{className:"space-y-5 mb-5",children:x?a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ue,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsx(ue,{className:"h-16 flex-1"})]}):g&&g.length>0?(n?g.slice(-5):g).map(j=>{const k=N(j.author_id),b=bg(k.name),C=(w??[]).filter(S=>S.comment_id===j.id);return a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Ft,{className:"h-7 w-7 mt-0.5 shrink-0",children:a.jsx(Bt,{className:R("text-[11px] font-semibold",b.bg,b.text),children:k.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:k.name}),a.jsx("span",{className:"text-[11px] text-zinc-400 dark:text-zinc-500",children:he(new Date(j.created_at),"MMM d, h:mm a")})]}),a.jsx("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(I$,{body:j.body})}),C.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:C.map(S=>a.jsx(q4,{attachment:S},S.id))})]})]},j.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(S1,{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 →"]}),a.jsx("div",{ref:u}),!o&&a.jsx(rk,{issueId:e,projectId:t})]}),l==="activity"&&a.jsx("div",{className:"px-6 pb-6 pt-4",children:y?a.jsx("div",{className:"space-y-4",children:[1,2,3].map(j=>a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ue,{className:"h-6 w-6 rounded-full shrink-0 mt-0.5"}),a.jsx(ue,{className:"h-4 flex-1 mt-1"})]},j))}):v&&v.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?v.slice(-5):v).map((j,k,b)=>{var M;const C=yy[j.action]??yy.updated,S=C.icon,_=((M=p==null?void 0:p.get(j.actor_id))==null?void 0:M.name)??"System",A=k===b.length-1;return a.jsxs("div",{className:R("relative flex gap-3",A?"pb-0":"pb-4"),children:[a.jsx("div",{className:R("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full mt-0.5",C.bg),children:a.jsx(S,{className:R("h-3 w-3",C.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:_})," ",a.jsx("span",{className:"text-zinc-500 dark:text-zinc-400",children:R$(j,p)})]}),a.jsx("p",{className:"text-[11px] text-zinc-400 dark:text-zinc-500 mt-0.5",children:he(new Date(j.created_at),"MMM d, yyyy · h:mm a")})]})]},j.id)})})]}),n&&v.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 ",v.length," events →"]})]}):a.jsx("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 py-4",children:"No activity yet."})}),l==="attachments"&&a.jsx(Y4,{issueId:e}),l==="time"&&a.jsx(a$,{issueId:e})]})}const lk=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs($j,{ref:n,className:R("relative overflow-hidden",e),...r,children:[a.jsx(NM,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(ck,{}),a.jsx(kM,{})]}));lk.displayName=$j.displayName;const ck=h.forwardRef(({className:e,orientation:t="vertical",...r},n)=>a.jsx(zj,{ref:n,orientation:t,className:R("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(SM,{className:"relative flex-1 rounded-full bg-border"})}));ck.displayName=zj.displayName;function $$(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 z$(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?he(new Date(e.start_date),"MMM d"):"—",r=e.end_date?he(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}const L$={urgent:"bg-red-500",high:"bg-orange-500",medium:"bg-amber-500",low:"bg-sky-500",no_priority:"bg-zinc-400"};function F$(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 Dn=({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}),Fo=()=>a.jsx("div",{className:"border-t border-zinc-100 dark:border-zinc-800"});function dk({issue:e,projectId:t,open:r,onClose:n}){const s=St(),{workspace:i,projectKey:o}=Vt(),{data:l}=u1((e==null?void 0:e.id)??""),c=l??e,[d,u]=h.useState(!1),[f,m]=h.useState(""),[p,g]=h.useState(""),[x,v]=h.useState("comments"),[y,w]=h.useState(!1),[N,j]=h.useState(new Set),k=ju((c==null?void 0:c.id)??"",t),{data:b}=Qn(t),C=h.useMemo(()=>b?b.members.filter(H=>H.user).map(H=>H.user):void 0,[b]),{data:S}=fo(t),{data:_}=mo(t||void 0),{data:A}=Jl(t||void 0),{data:M}=Rl(t||void 0),{data:P}=lg(),{data:T=[]}=cg(new Date().getFullYear()),D=(_??[]).filter(H=>H.status!=="completed"),{data:B}=qI(),E=(B==null?void 0:B.maxChildIssueDepth)??1,Q=(c?$$(c,M??[]):0)<E,K=c!=null&&c.parent_id?M==null?void 0:M.find(H=>H.id===c.parent_id):null,se=(M==null?void 0:M.filter(H=>H.parent_id===(c==null?void 0:c.id)))??[],te=c!=null&&c.task_list_id?A==null?void 0:A.find(H=>H.id===c.task_list_id):null,U=S&&S.length>0?Object.fromEntries(S.map(H=>[H.key,H.name])):Us;if(h.useEffect(()=>{c&&(m(c.title),g(c.description??"")),u(!1)},[c==null?void 0:c.id]),!c)return null;const G=()=>{f.trim()&&k.mutate({title:f.trim(),description:p.trim()||void 0},{onSuccess:()=>{u(!1),L.success("Issue updated")},onError:()=>L.error("Failed to update issue")})},J=()=>{m(c.title),g(c.description??""),u(!1)},X=H=>{k.mutate({status:H},{onSuccess:()=>L.success("Status updated"),onError:()=>L.error("Failed to update status")})},O=H=>{k.mutate({priority:H},{onSuccess:()=>L.success("Priority updated"),onError:()=>L.error("Failed to update priority")})},F=H=>{k.mutate({type:H},{onSuccess:()=>L.success("Type updated"),onError:()=>L.error("Failed to update type")})},ae=H=>{k.mutate({assignee_ids:H},{onSuccess:()=>L.success("Assignees updated"),onError:()=>L.error("Failed to update assignees")})},W=H=>{k.mutate({sprint_id:H},{onSuccess:()=>L.success(H?"Sprint assigned":"Removed from sprint"),onError:()=>L.error("Failed to update sprint")})},q=H=>{k.mutate({task_list_id:H},{onSuccess:()=>L.success(H?"Moved to list":"Removed from list"),onError:()=>L.error("Failed to update list")})},le=H=>{k.mutate({start_date:H?he(H,"yyyy-MM-dd"):null},{onSuccess:()=>L.success(H?"Start date set":"Start date cleared"),onError:()=>L.error("Failed to update start date")})},Z=H=>{k.mutate({due_date:H?he(H,"yyyy-MM-dd"):null},{onSuccess:()=>L.success(H?"Due date set":"Due date cleared"),onError:()=>L.error("Failed to update due date")})},de=H=>{if(H){const ve=c.start_date?new Date(c.start_date):new Date,De=new Date(ve);De.setDate(De.getDate()+7),k.mutate({recurrence_frequency:"weekly",next_occurrence_date:he(De,"yyyy-MM-dd"),recurrence_end_date:null},{onSuccess:()=>L.success("Recurrence enabled"),onError:()=>L.error("Failed to enable recurrence")})}else k.mutate({recurrence_frequency:null,next_occurrence_date:null,recurrence_end_date:null},{onSuccess:()=>L.success("Recurrence stopped"),onError:()=>L.error("Failed to stop recurrence")})},V=H=>{const ve=c.start_date?new Date(c.start_date):new Date,De=new Date(ve);H==="weekly"?De.setDate(De.getDate()+7):De.setMonth(De.getMonth()+1),k.mutate({recurrence_frequency:H,next_occurrence_date:he(De,"yyyy-MM-dd")},{onSuccess:()=>L.success("Frequency updated"),onError:()=>L.error("Failed to update frequency")})},oe=H=>{k.mutate({recurrence_end_date:H?he(H,"yyyy-MM-dd"):null},{onSuccess:()=>L.success(H?"End date set":"End date cleared"),onError:()=>L.error("Failed to update end date")})},pe=S==null?void 0:S.find(H=>H.category==="completed"),we=!!pe&&c.status===pe.key,_e=(H,ve,De)=>{const He=H;return a.jsx("button",{title:ve,onClick:De,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(He,{className:"h-4 w-4"})},ve)};return a.jsxs(a.Fragment,{children:[a.jsx(li,{open:r,onOpenChange:H=>!H&&n(),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 H;pe&&X(we?((H=S==null?void 0:S.find(ve=>ve.category==="unstarted"||ve.category==="backlog"))==null?void 0:H.key)??c.status:pe.key)},className:R("flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-xs font-medium transition-colors",we?"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(ir,{className:"h-3.5 w-3.5"}),we?"Completed":"Mark complete"]}),a.jsxs("div",{className:"flex items-center",children:[_e(uD,"Upvote"),_e(Up,"Attachments"),Q&&_e(ga,"Add sub-issue",()=>w(!0)),_e(Wl,"Copy link",()=>{navigator.clipboard.writeText(`${window.location.origin}/${i}/projects/${o}/issues/${c.id}`),L.success("Link copied")}),_e(ZA,"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(ee,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:J,children:"Cancel"}),a.jsxs(ee,{size:"sm",className:"h-7 text-xs",onClick:G,disabled:!f.trim()||k.isPending,children:[a.jsx(ir,{className:"h-3.5 w-3.5 mr-1"}),"Save"]})]}):a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:_e(cs,"More options")}),a.jsx(zr,{align:"end",className:"w-40",children:a.jsxs(bt,{onClick:()=>u(!0),children:[a.jsx(Ls,{className:"h-3.5 w-3.5 mr-2"}),"Edit"]})})]}),_e(tD,"Open in full page",()=>{n(),s(`/${i}/projects/${o}/issues/${c.id}`)})]})]}),a.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:d?a.jsx(Ae,{value:f,onChange:H=>m(H.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:ss[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(ol,{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(ol,{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(lk,{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"px-6 pb-4 space-y-5 min-w-0",children:[a.jsx(Nr,{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(Dn,{children:"Status"}),a.jsxs(Be,{value:c.status,onValueChange:X,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(U).map(([H,ve])=>{const De=S==null?void 0:S.find(He=>He.key===H);return a.jsx(Ne,{value:H,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:R("h-2 w-2 rounded-full shrink-0 flex-none",F$(De==null?void 0:De.category,H))}),a.jsx("span",{children:ve})]})},H)})})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Dn,{children:"Priority"}),a.jsxs(Be,{value:c.priority,onValueChange:O,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(kn).map(([H,ve])=>a.jsx(Ne,{value:H,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:R("h-2 w-2 rounded-full shrink-0 flex-none",L$[H]??"bg-zinc-400")}),a.jsx("span",{children:ve})]})},H))})]})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsx(Dn,{children:"Type"}),a.jsxs(Be,{value:c.type,onValueChange:F,children:[a.jsx(ze,{className:"h-8 text-xs min-w-0",children:a.jsx(Ye,{})}),a.jsx(Le,{children:Object.entries(ss).map(([H,ve])=>a.jsx(Ne,{value:H,className:"text-xs",children:ve},H))})]})]})]}),a.jsx(Fo,{}),a.jsxs("div",{children:[a.jsx(Dn,{children:"Assignees"}),a.jsx(ec,{value:c.assignee_ids??[],onChange:ae,disabled:k.isPending,users:C})]}),a.jsx(Fo,{}),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(Dn,{children:"Sprint"}),a.jsxs(Be,{value:c.sprint_id??"none",onValueChange:H=>W(H==="none"?null:H),children:[a.jsx(ze,{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(Rr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),D.map(H=>{const ve=z$(H);return a.jsx(Ne,{value:H.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:H.name}),ve&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:ve})]})},H.id)})]})]})]}),(A??[]).length>0&&a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Dn,{children:"List"}),a.jsxs(Be,{value:c.task_list_id??"none",onValueChange:H=>q(H==="none"?null:H),children:[a.jsx(ze,{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(Wp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list",children:te?te.name:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(A??[]).map(H=>a.jsx(Ne,{value:H.id,className:"text-xs",children:H.name},H.id))]})]})]}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Dn,{children:"Start Date"}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{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?he(new Date(c.start_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.start_date?new Date(c.start_date):void 0,onSelect:le,initialFocus:!0}),c.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>le(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear date"]})})]})]})]}),(c==null?void 0:c.start_date)&&(c==null?void 0:c.due_date)&&(P==null?void 0:P.working_days)&&(()=>{const H=SN(new Date(c.start_date),new Date(c.due_date),P.working_days,T);return a.jsxs("div",{className:"shrink-0 self-end pb-1 text-[11px] text-muted-foreground whitespace-nowrap",children:[H," biz day",H!==1?"s":""]})})(),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx(Dn,{children:"Due Date"}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{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?he(new Date(c.due_date),"MMM d, yyyy"):"No date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.due_date?new Date(c.due_date):void 0,onSelect:Z,initialFocus:!0}),c.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>Z(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear date"]})})]})]})]})]}),a.jsx(Fo,{}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Dn,{children:"Recurring"}),a.jsx(ho,{checked:!!c.recurrence_frequency,onCheckedChange:de,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(Be,{value:c.recurrence_frequency,onValueChange:H=>V(H),children:[a.jsx(ze,{className:"h-7 text-xs",children:a.jsx(Ye,{})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(Ne,{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(Ot,{children:[a.jsx(Pt,{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(mr,{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?he(new Date(c.recurrence_end_date),"MMM d, yyyy"):"No end date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:c.recurrence_end_date?new Date(c.recurrence_end_date):void 0,onSelect:oe,initialFocus:!0}),c.recurrence_end_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>oe(void 0),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear end date"]})})]})]})]})]})]}),a.jsx(Fo,{}),Q&&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(ct,{className:"h-3 w-3"}),"Add"]})]}),K&&a.jsxs("button",{onClick:()=>s(`/${i}/projects/${o}/issues/${K.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(zp,{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:K.identifier}),a.jsx("span",{className:"text-xs text-zinc-600 dark:text-zinc-300 truncate",children:K.title})]}),se.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(ct,{className:"h-3.5 w-3.5"}),"Create child issue"]}):a.jsx("div",{className:"space-y-1",children:se.map(H=>{const ve=(M??[]).filter(Fe=>Fe.parent_id===H.id),De=ve.length>0,He=N.has(H.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:[De?a.jsx("button",{onClick:()=>j(Fe=>{const Qe=new Set(Fe);return Qe.has(H.id)?Qe.delete(H.id):Qe.add(H.id),Qe}),className:"shrink-0 text-indigo-400 dark:text-indigo-500 hover:text-indigo-600 dark:hover:text-indigo-300 transition-colors",children:He?a.jsx(Vn,{className:"h-3.5 w-3.5"}):a.jsx(_n,{className:"h-3.5 w-3.5"})}):a.jsx(jn,{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/${H.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:H.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:H.title}),De&&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(jn,{className:"h-2.5 w-2.5"}),ve.length]})]})]}),De&&He&&a.jsx("div",{className:"mt-1 ml-6 space-y-1",children:ve.map(Fe=>a.jsxs("button",{onClick:()=>{n(),s(`/${i}/projects/${o}/issues/${Fe.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(jn,{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:Fe.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:Fe.title})]},Fe.id))})]},H.id)})})]}),a.jsx(Fo,{}),a.jsxs("div",{children:[a.jsx(Dn,{children:"Description"}),d?a.jsx(vg,{content:p,onChange:g,placeholder:"Add a description…",className:"min-h-[160px] rounded-md border border-input"},`${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(yg,{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(Ls,{className:"h-3.5 w-3.5"}),"Add description"]})]})]}),a.jsx("div",{className:"px-6 py-4",children:a.jsx(Nr,{zone:"issue.details.after",props:{issue:c}})}),a.jsx(ok,{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}`)}})]}),x==="comments"&&a.jsx("div",{className:"border-t border-border px-6 py-3 shrink-0",children:a.jsx(rk,{issueId:c.id,projectId:t,compact:!0})})]})}),a.jsx(Vu,{open:y,onClose:()=>w(!1),projectId:t,defaultParentId:c.id,defaultTaskListId:c.task_list_id})]})}function B$(){const{projectKey:e}=Vt(),[t,r]=h.useState(null),[n,s]=h.useState(!1),[i,o]=h.useState({}),{data:l}=Pa(e??""),c=(l==null?void 0:l.id)??"",{data:d,isLoading:u}=Rl(c||void 0,i),{data:f,isLoading:m}=fo(c||void 0),{data:p}=Qn(c),{data:g}=di(),x=jI(c);if(!e)return null;const v=u||m||!l,y=N=>{x.mutate(N)},w=h.useMemo(()=>!(p!=null&&p.members)||!g?[]:p.members.map(N=>{const j=g.get(N.user_id);return j?{userId:N.user_id,name:j.name,initials:j.initials}:null}).filter(N=>N!==null),[p,g]);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(zI,{statuses:f??[],members:w,filters:i,onChange:o}),a.jsxs(ee,{size:"sm",onClick:()=>s(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"Create"]})]}),a.jsx(Nr,{zone:"project.board.before",props:{projectId:c}}),a.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:v?a.jsx("div",{className:"flex gap-4 px-6 py-6",children:[1,2,3,4].map(N=>a.jsxs("div",{className:"min-w-[260px]",children:[a.jsx(ue,{className:"h-5 w-24 mb-3 rounded"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ue,{className:"h-[82px] w-full rounded-lg"}),a.jsx(ue,{className:"h-[82px] w-full rounded-lg"})]})]},N))}):a.jsx(kN,{issues:d??[],projectId:c,statuses:f??[],onIssueClick:r,onColumnsReorder:y,filters:i})})]}),a.jsx(Nr,{zone:"project.board.after",props:{projectId:c}}),a.jsx(dk,{issue:t,projectId:c,open:!!t,onClose:()=>r(null)}),a.jsx(Vu,{open:n,onClose:()=>s(!1),projectId:c})]})}const by=({priority:e,className:t})=>{const r=R("h-3.5 w-3.5 shrink-0",og[e],t);switch(e){case"urgent":return a.jsx(ds,{className:r});case"high":return a.jsx(Fl,{className:r});case"medium":return a.jsx(oi,{className:r});case"low":return a.jsx(zl,{className:r});default:return a.jsx(sn,{className:R("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}},jh="grid-cols-[70px_250px_150px_120px_130px_140px_130px_32px]";function uk({issue:e,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:d=!1,children:u=[],childrenMap:f,onAddChild:m}){const p=St(),[g,x]=h.useState(null),[v,y]=h.useState(!1),w=ju(e.id,t),{data:N}=Qn(t),j=h.useMemo(()=>N?N.members.filter(_=>_.user).map(_=>_.user):void 0,[N]);function k(_){w.mutate(_),x(null)}const b=(s==null?void 0:s[e.status])??"#94a3b8",C=i.find(_=>_.id===e.sprint_id),S=u.length>0;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{onClick:()=>c(e),className:R(`group grid ${jh} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 cursor-pointer transition-colors",d&&"bg-muted/10",w.isPending&&"opacity-70"),children:[a.jsx("span",{className:R("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",d&&"text-muted-foreground"),children:e.identifier}),a.jsxs("div",{className:R("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",d&&"bg-white dark:bg-muted/20"),children:[S?a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsx("button",{onClick:_=>{_.stopPropagation(),y(!v)},className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors p-0.5 rounded",children:v?a.jsx(Vn,{className:"h-3.5 w-3.5"}):a.jsx(_n,{className:"h-3.5 w-3.5"})})}),a.jsx(pa,{side:"top",children:v?"Collapse":"Expand"})]}):d?a.jsx(jn,{className:"h-3 w-3 text-muted-foreground shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:R("text-sm text-foreground truncate",d&&"text-primary"),children:e.title}),S&&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(jn,{className:"h-2.5 w-2.5"}),u.length]})]}),a.jsx("div",{onClick:_=>_.stopPropagation(),children:a.jsxs(Ot,{open:g==="status",onOpenChange:_=>x(_?"status":null),children:[a.jsx(Pt,{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:b}}),a.jsx("span",{className:"text-xs text-primary truncate",children:n[e.status]??e.status})]})}),a.jsx(kt,{className:"w-52 p-1",align:"start",onClick:_=>_.stopPropagation(),children:a.jsx(Ts,{children:a.jsx(Is,{children:a.jsx(Ja,{children:r.map(_=>a.jsxs(nn,{value:_.name,onSelect:()=>k({status:_.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:_.color}}),a.jsx("span",{className:"text-xs flex-1",children:_.name}),e.status===_.key&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]},_.key))})})})})]})}),a.jsx("div",{onClick:_=>_.stopPropagation(),children:a.jsxs(Ot,{open:g==="priority",onOpenChange:_=>x(_?"priority":null),children:[a.jsx(Pt,{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(by,{priority:e.priority}),a.jsx("span",{className:"text-xs text-primary",children:kn[e.priority]??e.priority})]})}),a.jsx(kt,{className:"w-44 p-1",align:"start",onClick:_=>_.stopPropagation(),children:a.jsx(Ts,{children:a.jsx(Is,{children:a.jsx(Ja,{children:Object.entries(kn).map(([_,A])=>a.jsxs(nn,{value:A,onSelect:()=>k({priority:_}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(by,{priority:_}),a.jsx("span",{className:"text-xs flex-1",children:A}),e.priority===_&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]},_))})})})})]})}),a.jsx("div",{onClick:_=>_.stopPropagation(),children:a.jsxs(Ot,{open:g==="sprint",onOpenChange:_=>x(_?"sprint":null),children:[a.jsx(Pt,{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(Rr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:R("text-xs truncate",C?"text-foreground":"text-muted-foreground"),children:(C==null?void 0:C.name)??"No sprint"})]})}),a.jsx(kt,{className:"w-56 p-1",align:"start",onClick:_=>_.stopPropagation(),children:a.jsx(Ts,{children:a.jsx(Is,{children:a.jsxs(Ja,{children:[a.jsxs(nn,{value:"no-sprint",onSelect:()=>k({sprint_id:null}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(at,{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(ir,{className:"h-3.5 w-3.5 text-indigo-500"})]}),i.filter(_=>_.status!=="completed").map(_=>a.jsxs(nn,{value:_.name,onSelect:()=>k({sprint_id:_.id}),className:"flex items-center gap-2 py-1.5 px-2 cursor-pointer",children:[a.jsx(Rr,{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:_.name}),(_.start_date||_.end_date)&&a.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[_.start_date?he(new Date(_.start_date),"MMM d"):"—"," → ",_.end_date?he(new Date(_.end_date),"MMM d"):"—"]})]}),e.sprint_id===_.id&&a.jsx(ir,{className:"h-3.5 w-3.5 text-indigo-500 shrink-0"})]},_.id))]})})})})]})}),a.jsx("div",{onClick:_=>_.stopPropagation(),children:a.jsxs(Ot,{open:g==="due",onOpenChange:_=>x(_?"due":null),children:[a.jsx(Pt,{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(mr,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("span",{className:R("text-xs",e.due_date?"text-foreground":"text-muted-foreground"),children:e.due_date?he(new Date(e.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",onClick:_=>_.stopPropagation(),children:[a.jsx(hr,{mode:"single",selected:e.due_date?new Date(e.due_date):void 0,onSelect:_=>k({due_date:_?he(_,"yyyy-MM-dd"):null}),initialFocus:!0}),e.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>k({due_date:null}),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx("div",{onClick:_=>_.stopPropagation(),children:a.jsx(ec,{value:e.assignee_ids??[],onChange:_=>w.mutate({assignee_ids:_}),users:j})}),a.jsxs("div",{className:"flex items-center gap-1 pr-6",onClick:_=>_.stopPropagation(),children:[!d&&m&&a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsx("button",{onClick:()=>m(e.id),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(jn,{className:"h-3.5 w-3.5"})})}),a.jsx(pa,{side:"top",children:"Add child issue"})]}),a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsx("button",{onClick:()=>p(`/${o}/projects/${l}/issues/${e.id}`),className:"p-1 rounded hover:bg-border text-muted-foreground hover:text-foreground",children:a.jsx(b1,{className:"h-3.5 w-3.5"})})}),a.jsx(pa,{side:"top",children:"Open full page"})]})]})]}),v&&u.map(_=>a.jsx(uk,{issue:_,projectId:t,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,workspace:o,projectKey:l,onOpen:c,isChild:!0,children:(f==null?void 0:f[_.id])??[],childrenMap:f,onAddChild:m},_.id))]})}function wy({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:g}){const[x,v]=h.useState(!1),[y,w]=h.useState(!1),[N,j]=h.useState((e==null?void 0:e.name)??""),k=t.reduce((S,_)=>{var A;return S+(((A=r[_.id])==null?void 0:A.length)??0)},0),b=t.length+k,C=()=>{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(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsx("button",{onClick:()=>v(!x),className:"text-muted-foreground hover:text-foreground transition-colors",children:x?a.jsx(_n,{className:"h-3.5 w-3.5"}):a.jsx(Vn,{className:"h-3.5 w-3.5"})})}),a.jsx(pa,{side:"right",children:x?"Expand":"Collapse"})]}),e?y?a.jsx("input",{autoFocus:!0,value:N,onChange:S=>j(S.target.value),onBlur:C,onKeyDown:S=>{S.key==="Enter"&&C(),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(ct,{className:"h-3 w-3"}),"Add issue"]}),e&&a.jsxs(Xr,{children:[a.jsxs(Qa,{children:[a.jsx(Za,{asChild:!0,children:a.jsx(Qr,{asChild:!0,children:a.jsx("button",{className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(cs,{className:"h-3.5 w-3.5"})})})}),a.jsx(pa,{side:"top",children:"More options"})]}),a.jsxs(zr,{align:"end",className:"w-36",children:[a.jsxs(bt,{className:"text-xs gap-2 cursor-pointer",onClick:()=>{w(!0),j(e.name)},children:[a.jsx(Ls,{className:"h-3.5 w-3.5"}),"Rename"]}),a.jsxs(bt,{className:"text-xs gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>g==null?void 0:g(e.id),children:[a.jsx($r,{className:"h-3.5 w-3.5"}),"Delete list"]})]})]})]})]}),!x&&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(S=>a.jsx(uk,{issue:S,projectId:n,statuses:s,statusLabels:i,statusColorMap:o,sprints:l,workspace:c,projectKey:d,onOpen:u,children:r[S.id]??[],childrenMap:r,onAddChild:m},S.id))})]})}function W$(){var X;const{workspace:e,projectKey:t}=Vt(),[r,n]=h.useState(null),[s,i]=h.useState({open:!1}),[o,l]=h.useState(""),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,p]=h.useState("all"),[g,x]=h.useState("all"),[v,y]=h.useState("all"),{data:w}=Pa(t??""),N=(w==null?void 0:w.id)??"",{data:j,isLoading:k}=Rl(N||void 0),{data:b}=fo(N||void 0),{data:C}=mo(N||void 0),{data:S}=Jl(N||void 0),_=XI(N),A=QI(N),M=ZI(N),P=b&&b.length>0?b:Object.entries(Us).map(([O,F],ae)=>({id:O,project_id:N,key:O,name:F,color:{backlog:"#94a3b8",todo:"#64748b",in_progress:"#6366f1",in_review:"#f59e0b",done:"#10b981",cancelled:"#9ca3af"}[O]??"#94a3b8",category:{backlog:"backlog",todo:"unstarted",in_progress:"started",in_review:"started",done:"completed",cancelled:"cancelled"}[O]??"backlog",position:ae})),T=Object.fromEntries(P.map(O=>[O.key,O.name])),D=Object.fromEntries(P.map(O=>[O.key,O.color])),B=C??[];if(!t||!e)return null;const E=(j??[]).filter(O=>{const F=!u||O.title.toLowerCase().includes(u.toLowerCase())||O.identifier.toLowerCase().includes(u.toLowerCase()),ae=m==="all"||O.status===m,W=g==="all"||O.priority===g,q=v==="all"||(v==="none"?!O.sprint_id:O.sprint_id===v);return F&&ae&&W&&q}).sort((O,F)=>{const ae=parseInt(O.identifier.split("-")[1]??"0",10),W=parseInt(F.identifier.split("-")[1]??"0",10);return ae-W}),z={};for(const O of j??[])O.parent_id&&(z[O.parent_id]||(z[O.parent_id]=[]),z[O.parent_id].push(O));const Q=E.filter(O=>!O.parent_id),K=E.length,se=new Set((S??[]).map(O=>O.id)),te={__none__:[]};for(const O of S??[])te[O.id]=[];for(const O of Q){const F=O.task_list_id&&se.has(O.task_list_id)?O.task_list_id:"__none__";te[F].push(O)}function U(){o.trim()&&_.mutate({name:o.trim()},{onSuccess:()=>{l(""),d(!1),L.success("List created")},onError:()=>L.error("Failed to create list")})}function G(O,F){A.mutate({id:O,name:F},{onError:()=>L.error("Failed to rename list")})}function J(O){const F=S==null?void 0:S.find(ae=>ae.id===O);confirm(`Delete list "${F==null?void 0:F.name}"? Issues in this list will be moved to No List.`)&&M.mutate(O,{onSuccess:()=>L.success("List deleted"),onError:()=>L.error("Failed to delete list")})}return a.jsxs("div",{className:"p-2",children:[a.jsx(Nr,{zone:"project.issues.before",props:{projectId:N}}),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:[c?a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Ae,{autoFocus:!0,placeholder:"List name...",value:o,onChange:O=>l(O.target.value),onKeyDown:O=>{O.key==="Enter"&&U(),O.key==="Escape"&&(d(!1),l(""))},className:"h-8 text-xs w-36"}),a.jsx(ee,{size:"sm",variant:"outline",className:"h-8 text-xs",onClick:U,disabled:!o.trim()||_.isPending,children:"Add"}),a.jsx(ee,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{d(!1),l("")},children:"Cancel"})]}):a.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"New List"]}),a.jsxs(ee,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(ct,{className:"h-4 w-4"}),"Create"]})]})}),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(Be,{value:v,onValueChange:y,children:[a.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),B.map(O=>a.jsx(Ne,{value:O.id,className:"text-xs",children:O.name},O.id))]})]}),a.jsxs(Be,{value:m,onValueChange:p,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All statuses"}),P.map(({key:O,name:F})=>a.jsx(Ne,{value:O,className:"text-xs",children:F},O))]})]}),a.jsxs(Be,{value:g,onValueChange:x,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(kn).map(([O,F])=>a.jsx(Ne,{value:O,className:"text-xs",children:F},O))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(Ul,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),a.jsx(Ae,{placeholder:"Search...",value:u,onChange:O=>f(O.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-[1025px]",children:[a.jsxs("div",{className:R("grid items-center py-2.5 border-b border-border",jh),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"}),a.jsx("span",{className:"pr-6"})]}),k?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3,4].map(O=>a.jsxs("div",{className:R("grid items-center px-6 py-3 gap-4",jh),children:[a.jsx(ue,{className:"h-4 w-14"}),a.jsx(ue,{className:"h-4 w-56"}),a.jsx(ue,{className:"h-5 w-20"}),a.jsx(ue,{className:"h-4 w-16"}),a.jsx(ue,{className:"h-4 w-20"}),a.jsx(ue,{className:"h-4 w-24"}),a.jsx(ue,{className:"h-6 w-16"}),a.jsx("span",{})]},O))}):K===0&&(j??[]).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(ee,{size:"sm",onClick:()=>i({open:!0}),children:[a.jsx(ct,{className:"h-4 w-4"}),"Create issue"]})]}):Q.length===0&&(j??[]).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(wu,{delayDuration:200,children:a.jsxs("div",{className:"divide-y divide-border",children:[(S??[]).map(O=>a.jsx(wy,{taskList:O,issues:te[O.id]??[],childrenMap:z,projectId:N,statuses:P,statusLabels:T,statusColorMap:D,sprints:B,workspace:e,projectKey:t,onOpen:n,onAddIssue:F=>i({open:!0,defaultTaskListId:F}),onAddChild:F=>i({open:!0,defaultParentId:F}),onRenameList:G,onDeleteList:J},O.id)),(((X=te.__none__)==null?void 0:X.length)>0||(S??[]).length===0)&&a.jsx(wy,{taskList:null,issues:te.__none__??[],childrenMap:z,projectId:N,statuses:P,statusLabels:T,statusColorMap:D,sprints:B,workspace:e,projectKey:t,onOpen:n,onAddIssue:O=>i({open:!0,defaultTaskListId:O}),onAddChild:O=>i({open:!0,defaultParentId:O})})]})})]})}),!k&&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(Nr,{zone:"project.issues.after",props:{projectId:N}}),a.jsx(dk,{issue:r,projectId:N,open:!!r,onClose:()=>n(null)}),a.jsx(Vu,{open:s.open,onClose:()=>i({open:!1}),projectId:N,defaultTaskListId:s.defaultTaskListId,defaultParentId:s.defaultParentId})]})}function U$(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,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var x;const p=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=h.useContext(p);if(g)return g;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,q$(s,...t)]}function q$(...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 H$=Symbol("radix.slottable");function K$(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=H$,t}var fk="AlertDialog",[Y$]=U$(fk,[Lj]),Ta=Lj(),mk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ta(t);return a.jsx(Il,{...n,...r,modal:!0})};mk.displayName=fk;var G$="AlertDialogTrigger",V$=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ta(r);return a.jsx(_M,{...s,...n,ref:t})});V$.displayName=G$;var X$="AlertDialogPortal",hk=e=>{const{__scopeAlertDialog:t,...r}=e,n=Ta(t);return a.jsx(Tl,{...n,...r})};hk.displayName=X$;var Q$="AlertDialogOverlay",pk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ta(r);return a.jsx(ai,{...s,...n,ref:t})});pk.displayName=Q$;var Ei="AlertDialogContent",[Z$,J$]=Y$(Ei),e6=K$("AlertDialogContent"),gk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=Ta(r),o=h.useRef(null),l=bu(t,o),c=h.useRef(null);return a.jsx(CM,{contentName:Ei,titleName:xk,docsSlug:"alert-dialog",children:a.jsx(Z$,{scope:r,cancelRef:c,children:a.jsxs(si,{role:"alertdialog",...i,...s,ref:l,onOpenAutoFocus:ks(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(e6,{children:n}),a.jsx(r6,{contentRef:o})]})})})});gk.displayName=Ei;var xk="AlertDialogTitle",vk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ta(r);return a.jsx(Qi,{...s,...n,ref:t})});vk.displayName=xk;var yk="AlertDialogDescription",bk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ta(r);return a.jsx(Zi,{...s,...n,ref:t})});bk.displayName=yk;var t6="AlertDialogAction",wk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=Ta(r);return a.jsx(yu,{...s,...n,ref:t})});wk.displayName=t6;var jk="AlertDialogCancel",Nk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=J$(jk,r),i=Ta(r),o=bu(t,s);return a.jsx(yu,{...i,...n,ref:o})});Nk.displayName=jk;var r6=({contentRef:e})=>{const t=`\`${Ei}\` requires a description for the component to be accessible for screen reader users.
|
|
542
|
-
|
|
543
|
-
You can add a description to the \`${Ei}\` by passing a \`${yk}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
544
|
-
|
|
545
|
-
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 \`${Ei}\`. 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.
|
|
546
|
-
|
|
547
|
-
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},n6=mk,a6=hk,kk=pk,Sk=gk,Ck=wk,_k=Nk,Ok=vk,Pk=bk;const Fi=n6,s6=a6,Mk=h.forwardRef(({className:e,...t},r)=>a.jsx(kk,{className:R("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}));Mk.displayName=kk.displayName;const qs=h.forwardRef(({className:e,...t},r)=>a.jsxs(s6,{children:[a.jsx(Mk,{}),a.jsx(Sk,{ref:r,className:R("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})]}));qs.displayName=Sk.displayName;const Hs=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col space-y-2 text-center sm:text-left",e),...t});Hs.displayName="AlertDialogHeader";const Ks=({className:e,...t})=>a.jsx("div",{className:R("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ks.displayName="AlertDialogFooter";const Ys=h.forwardRef(({className:e,...t},r)=>a.jsx(Ok,{ref:r,className:R("text-base font-semibold",e),...t}));Ys.displayName=Ok.displayName;const Gs=h.forwardRef(({className:e,...t},r)=>a.jsx(Pk,{ref:r,className:R("text-sm text-muted-foreground",e),...t}));Gs.displayName=Pk.displayName;const Vs=h.forwardRef(({className:e,...t},r)=>a.jsx(Ck,{ref:r,className:R(Mi(),e),...t}));Vs.displayName=Ck.displayName;const Xs=h.forwardRef(({className:e,...t},r)=>a.jsx(_k,{ref:r,className:R(Mi({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Xs.displayName=_k.displayName;function i6({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(Ft,{className:"h-8 w-8 shrink-0",children:a.jsx(Bt,{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(Zu,{className:R("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(ee,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.user_id,i),children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})}function o6({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(Fs,{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(ee,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(e.team_id),children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})}function l6(){const{projectKey:e}=Vt(),{workspace:t}=Ie(),r=(t==null?void 0:t.id)??"",{data:n}=Pa(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=Qn(s),{data:l}=ql(r),{data:c}=Pu(r),d=R1(s),u=$1(s),f=z1(s),m=L1(s),[p,g]=h.useState(""),[x,v]=h.useState(""),[y,w]=h.useState(null),N=new Set((i==null?void 0:i.members.map(A=>A.user_id))??[]),j=new Set((i==null?void 0:i.teams.map(A=>A.team_id))??[]),k=(l??[]).filter(A=>!N.has(A.user_id)),b=(c??[]).filter(A=>!j.has(A.id)),C=(i==null?void 0:i.members.length)??0,S=(i==null?void 0:i.teams.length)??0;function _(){y&&u.mutate(y.userId,{onSuccess:()=>{L.success("Access removed"),w(null)},onError:()=>L.error("Failed to remove")})}return a.jsxs("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",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:[C," member",C!==1?"s":""," • ",S," team",S!==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(A=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(ue,{className:"h-8 w-8 rounded-full"}),a.jsx(ue,{className:"h-4 w-44"}),a.jsx("div",{className:"flex-1"}),a.jsx(ue,{className:"h-5 w-20"})]},A))}),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(A=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(ue,{className:"h-8 w-8 rounded-lg"}),a.jsx(ue,{className:"h-4 w-32"}),a.jsx("div",{className:"flex-1"}),a.jsx(ue,{className:"h-4 w-20"})]},A))})]}):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.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"People"}),k.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Be,{value:p,onValueChange:g,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add person…"})}),a.jsx(Le,{children:k.map(A=>{const M=A.user,P=(M==null?void 0:M.first_name)??"",T=(M==null?void 0:M.last_name)??"",D=`${P} ${T}`.trim()||(M==null?void 0:M.email)||"Unknown";return a.jsx(Ne,{value:A.user_id,children:D},A.user_id)})})]}),a.jsxs(ee,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!p||d.isPending,onClick:()=>d.mutate({userId:p},{onSuccess:()=>{L.success("Access granted"),g("")},onError:()=>L.error("Failed to grant access")}),children:[a.jsx(no,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),C===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No individual members."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.members.map(A=>a.jsx(i6,{member:A,onRequestRemove:(M,P)=>w({userId:M,displayName:P})},A.id))})]}),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.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Teams"}),b.length>0&&a.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[a.jsxs(Be,{value:x,onValueChange:v,children:[a.jsx(ze,{className:"h-8 text-xs w-full sm:w-56",children:a.jsx(Ye,{placeholder:"Add team…"})}),a.jsx(Le,{children:b.map(A=>a.jsx(Ne,{value:A.id,children:A.name},A.id))})]}),a.jsxs(ee,{size:"sm",className:"h-8 px-3 text-xs shrink-0",disabled:!x||f.isPending,onClick:()=>f.mutate(x,{onSuccess:()=>{L.success("Team access granted"),v("")},onError:()=>L.error("Failed to add team")}),children:[a.jsx(Fs,{className:"h-3.5 w-3.5"}),"Add"]})]})]}),S===0?a.jsx("p",{className:"text-sm text-muted-foreground px-6 py-4",children:"No teams have access."}):a.jsx("div",{className:"divide-y divide-border",children:i==null?void 0:i.teams.map(A=>a.jsx(o6,{teamEntry:A,onRemove:M=>m.mutate(M,{onSuccess:()=>L.success("Team access removed"),onError:()=>L.error("Failed to remove team")})},A.id))})]}),C===0&&S===0&&k.length===0&&b.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(Fs,{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(Fi,{open:!!y,onOpenChange:A=>{A||w(null)},children:a.jsxs(qs,{className:"sm:max-w-md",children:[a.jsxs(Hs,{children:[a.jsx(Ys,{children:"Remove member access?"}),a.jsx(Gs,{children:y?`${y.displayName} will lose access to this project.`:"This member will lose access to this project."})]}),a.jsxs(Ks,{children:[a.jsx(Xs,{disabled:u.isPending,children:"Cancel"}),a.jsx(Vs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:A=>{A.preventDefault(),_()},disabled:u.isPending,children:u.isPending?"Removing...":"Remove"})]})]})})]})}function jy(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?he(new Date(e.start_date),"MMM d"):"—",r=e.end_date?he(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function sa({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 c6={backlog:a.jsx(sn,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(sn,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Xn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(ii,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(ls,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Lp,{className:"h-3 w-3 text-zinc-400"})},d6={urgent:a.jsx(ds,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Fl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(oi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(zl,{className:"h-3 w-3 text-blue-400"})},u6={bug:a.jsx(p1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(C1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(_1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx($p,{className:"h-3 w-3 text-zinc-500"})};function Em({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Be,{value:e,onValueChange:t,children:[a.jsx(ze,{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(x1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(Ne,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function f6(){const{workspace:e,projectKey:t,issueId:r}=Vt(),n=St(),[s,i]=h.useState(!1),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(!1),{data:m}=Pa(t??""),p=(m==null?void 0:m.id)??"",{data:g,isLoading:x}=u1(r??""),v=ju(r??"",p),{data:y}=Qn(p),w=h.useMemo(()=>y?y.members.filter(E=>E.user).map(E=>E.user):void 0,[y]),{data:N}=fo(p||void 0),{data:j}=mo(p||void 0),{data:k}=Jl(p||void 0),{data:b}=Rl(p||void 0),C=(j??[]).filter(E=>E.status!=="completed"),S=g!=null&&g.parent_id?b==null?void 0:b.find(E=>E.id===g.parent_id):null,_=(b==null?void 0:b.filter(E=>E.parent_id===r))??[],A=g!=null&&g.task_list_id?k==null?void 0:k.find(E=>E.id===g.task_list_id):null,M=N&&N.length>0?Object.fromEntries(N.map(E=>[E.key,E.name])):Us,P=N&&N.length>0?Object.fromEntries(N.map(E=>[E.key,E.category==="completed"?a.jsx(ls,{className:"h-3 w-3",style:{color:E.color}}):E.category==="started"?a.jsx(Xn,{className:"h-3 w-3",style:{color:E.color}}):a.jsx(sn,{className:"h-3 w-3",style:{color:E.color}})])):c6;if(h.useEffect(()=>{g&&(l(g.title),d(g.description??"")),i(!1)},[g==null?void 0:g.id]),!t||!r)return null;const T=()=>{o.trim()&&v.mutate({title:o.trim(),description:c.trim()||void 0},{onSuccess:()=>{i(!1),L.success("Issue updated")},onError:()=>L.error("Failed to update issue")})},D=()=>{g&&(l(g.title),d(g.description??"")),i(!1)},B=(E,z)=>{v.mutate(E,{onSuccess:()=>L.success(`${z} updated`),onError:()=>L.error(`Failed to update ${z.toLowerCase()}`)})};return x||!g?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",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5",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(ue,{className:"h-7 w-3/4"}),a.jsx(ue,{className:"h-32 w-full"})]}),a.jsx(ue,{className:"h-24 w-full rounded-xl"}),a.jsx(ue,{className:"h-48 w-full rounded-xl"})]}),a.jsx(ue,{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(ee,{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(ku,{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:g.identifier}),a.jsx(Zu,{variant:"muted",className:"text-[10px] ml-1",children:ss[g.type]??g.type})]}),a.jsx("div",{className:"flex items-center gap-2",children:s?a.jsxs(a.Fragment,{children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:D,children:"Discard"}),a.jsx(ee,{size:"sm",onClick:T,disabled:!o.trim()||v.isPending,className:"px-4",children:v.isPending?"Saving…":"Save changes"})]}):a.jsxs(ee,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-foreground",onClick:()=>i(!0),children:[a.jsx(Ls,{className:"h-3.5 w-3.5"}),"Edit"]})})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 items-start",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx(Nr,{zone:"issue.details.before",props:{issue:g}}),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:E=>l(E.target.value),onKeyDown:E=>{E.key==="Enter"&&E.preventDefault()},className:R("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:g.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(vg,{content:c,onChange:d,placeholder:"Add a description…",className:"border-t border-border/50 min-h-[280px]"}):g.description?a.jsx("div",{className:"border-t border-border/50",children:a.jsx(yg,{html:g.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"})})]}),!g.parent_id&&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(ct,{className:"h-3.5 w-3.5"}),"Add child issue"]})]}),_.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:_.map(E=>a.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs",children:[a.jsx(jn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${E.id}`),className:"font-mono text-muted-foreground hover:text-foreground transition-colors shrink-0",children:E.identifier}),a.jsx("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${E.id}`),className:"text-foreground hover:text-foreground/70 truncate text-left transition-colors",children:E.title})]},E.id))})]}),a.jsx("div",{className:"bg-white dark:bg-card border border-border rounded-xl overflow-hidden shadow-sm",children:a.jsx(ok,{issueId:r,projectId:p})}),a.jsx(Nr,{zone:"issue.details.after",props:{issue:g}})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Nr,{zone:"issue.details.sidebar",props:{issue:g}}),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(sa,{label:"Status",children:a.jsx(Em,{value:g.status,onValueChange:E=>B({status:E},"Status"),options:M,icons:P})}),a.jsx(sa,{label:"Priority",children:a.jsx(Em,{value:g.priority,onValueChange:E=>B({priority:E},"Priority"),options:kn,icons:d6})}),a.jsx(sa,{label:"Type",children:a.jsx(Em,{value:g.type,onValueChange:E=>B({type:E},"Type"),options:ss,icons:u6})}),a.jsx(sa,{label:"Assignees",children:a.jsx(ec,{value:g.assignee_ids??[],onChange:E=>B({assignee_ids:E},"Assignees"),disabled:v.isPending,users:w})}),a.jsx(sa,{label:"Sprint",children:a.jsxs(Be,{value:g.sprint_id??"none",onValueChange:E=>B({sprint_id:E==="none"?null:E},"Sprint"),children:[a.jsx(ze,{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(Rr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),g.sprint_id?(()=>{const E=C.find(Q=>Q.id===g.sprint_id)??(j==null?void 0:j.find(Q=>Q.id===g.sprint_id));if(!E)return a.jsxs("span",{className:"truncate",children:[g.sprint_id.slice(0,8),"…"]});const z=jy(E);return a.jsxs("span",{className:"truncate",children:[E.name,z&&a.jsxs("span",{className:"text-muted-foreground ml-1",children:["· ",z]})]})})():a.jsx("span",{className:"text-muted-foreground",children:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),C.map(E=>{const z=jy(E);return a.jsx(Ne,{value:E.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:E.name}),z&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:z})]})},E.id)})]})]})}),(k??[]).length>0&&a.jsx(sa,{label:"List",children:a.jsxs(Be,{value:g.task_list_id??"none",onValueChange:E=>B({task_list_id:E==="none"?null:E},"List"),children:[a.jsx(ze,{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(Wp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:A?"truncate":"text-muted-foreground",children:(A==null?void 0:A.name)??"No list"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(k??[]).map(E=>a.jsx(Ne,{value:E.id,className:"text-xs",children:E.name},E.id))]})]})}),a.jsx(sa,{label:"Start Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.start_date?"text-foreground":"text-muted-foreground",children:g.start_date?he(new Date(g.start_date),"MMM d, yyyy"):"No start date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:g.start_date?new Date(g.start_date):void 0,onSelect:E=>B({start_date:E?he(E,"yyyy-MM-dd"):null},"Start date"),initialFocus:!0}),g.start_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>B({start_date:null},"Start date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),a.jsx(sa,{label:"Due Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:g.due_date?"text-foreground":"text-muted-foreground",children:g.due_date?he(new Date(g.due_date),"MMM d, yyyy"):"No due date"})]})}),a.jsxs(kt,{className:"w-auto p-0",align:"start",children:[a.jsx(hr,{mode:"single",selected:g.due_date?new Date(g.due_date):void 0,onSelect:E=>B({due_date:E?he(E,"yyyy-MM-dd"):null},"Due date"),initialFocus:!0}),g.due_date&&a.jsx("div",{className:"border-t px-3 py-2",children:a.jsxs("button",{onClick:()=>B({due_date:null},"Due date"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-destructive transition-colors",children:[a.jsx(at,{className:"h-3 w-3"}),"Clear date"]})})]})]})}),S&&a.jsx(sa,{label:"Parent",children:a.jsxs("button",{onClick:()=>n(`/${e}/projects/${t}/issues/${S.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(zp,{className:"h-3 w-3 text-muted-foreground shrink-0"}),a.jsx("span",{className:"font-mono text-muted-foreground shrink-0",children:S.identifier}),a.jsx("span",{className:"text-foreground truncate",children:S.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:he(new Date(g.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:he(new Date(g.updated_at),"MMM d, yyyy")})]})]})]})]})]})})]}),a.jsx(Vu,{open:u,onClose:()=>f(!1),projectId:p,defaultParentId:r,defaultTaskListId:g.task_list_id})]})}function ia({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 m6={backlog:a.jsx(sn,{className:"h-3 w-3 text-zinc-400"}),todo:a.jsx(sn,{className:"h-3 w-3 text-zinc-500",strokeWidth:2.5}),in_progress:a.jsx(Xn,{className:"h-3 w-3 text-indigo-500"}),in_review:a.jsx(ii,{className:"h-3 w-3 text-amber-500"}),done:a.jsx(ls,{className:"h-3 w-3 text-emerald-500"}),cancelled:a.jsx(Lp,{className:"h-3 w-3 text-zinc-400"})},h6={urgent:a.jsx(ds,{className:"h-3 w-3 text-red-500"}),high:a.jsx(Fl,{className:"h-3 w-3 text-orange-500"}),medium:a.jsx(oi,{className:"h-3 w-3 text-yellow-500"}),low:a.jsx(zl,{className:"h-3 w-3 text-blue-400"})},p6={bug:a.jsx(p1,{className:"h-3 w-3 text-red-500"}),feature:a.jsx(C1,{className:"h-3 w-3 text-purple-500"}),task:a.jsx(_1,{className:"h-3 w-3 text-blue-500"}),chore:a.jsx($p,{className:"h-3 w-3 text-zinc-500"})};function Am({value:e,onValueChange:t,options:r,icons:n,placeholder:s}){return a.jsxs(Be,{value:e,onValueChange:t,children:[a.jsx(ze,{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(x1,{className:"h-3 w-3 text-muted-foreground"}),a.jsx("span",{children:r[e]??s??""})]})}),a.jsx(Le,{children:Object.entries(r).map(([i,o])=>a.jsx(Ne,{value:i,className:"text-xs",children:a.jsxs("div",{className:"flex items-center gap-2",children:[n[i],o]})},i))})]})}function g6(e){if(!e.start_date&&!e.end_date)return null;const t=e.start_date?he(new Date(e.start_date),"MMM d"):"—",r=e.end_date?he(new Date(e.end_date),"MMM d"):"—";return`${t} – ${r}`}function x6(){const{workspace:e,projectKey:t}=Vt(),r=St(),{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"),[g,x]=h.useState([]),[v,y]=h.useState(""),[w,N]=h.useState(""),[j,k]=h.useState(void 0),[b,C]=h.useState(void 0),[S,_]=h.useState(!1),[A,M]=h.useState("weekly"),[P,T]=h.useState(void 0),{data:D}=Pa(t??""),B=(D==null?void 0:D.id)??"",E=f1(),{data:z}=Qn(B),Q=h.useMemo(()=>z?z.members.filter(O=>O.user).map(O=>O.user):void 0,[z]),{data:K}=fo(B||void 0),{data:se}=mo(B||void 0),{data:te}=Jl(B||void 0),U=(se??[]).filter(O=>O.status!=="completed"),G=K&&K.length>0?Object.fromEntries(K.map(O=>[O.key,O.name])):Us,J=K&&K.length>0?Object.fromEntries(K.map(O=>[O.key,O.category==="completed"?a.jsx(ls,{className:"h-3 w-3",style:{color:O.color}}):O.category==="started"?a.jsx(Xn,{className:"h-3 w-3",style:{color:O.color}}):a.jsx(sn,{className:"h-3 w-3",style:{color:O.color}})])):m6;if(!t||!B)return null;const X=()=>{if(!s.trim()){L.error("Title is required");return}E.mutate({title:s.trim(),description:o||void 0,status:c,priority:u,type:m,project_id:B,workspace_id:n.id,assignee_ids:g.length>0?g:void 0,sprint_id:v||null,task_list_id:w||null,start_date:j?he(j,"yyyy-MM-dd"):null,due_date:b?he(b,"yyyy-MM-dd"):null,recurrence_frequency:S?A:void 0,recurrence_end_date:S&&P?he(P,"yyyy-MM-dd"):void 0},{onSuccess:O=>{L.success("Issue created"),r(`/${e}/projects/${t}/issues/${O.issue.id}`,{replace:!0})},onError:O=>L.error(O.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(ee,{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(ku,{className:"h-3.5 w-3.5"}),(D==null?void 0:D.name)??"Issues"]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>r(`/${e}/projects/${t}/issues`),children:"Discard"}),a.jsx(ee,{size:"sm",onClick:X,disabled:!s.trim()||E.isPending,className:"px-4",children:E.isPending?"Creating…":"Create issue"})]})]}),a.jsx("div",{className:"px-2 py-2",children:a.jsxs("div",{className:"grid grid-cols-[1fr_256px] gap-5 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:R("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(vg,{content:"",onChange:l,placeholder:"Add steps to reproduce, acceptance criteria, or context…",className:"border-t border-border/50 min-h-[320px]"})]}),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(ia,{label:"Status",children:a.jsx(Am,{value:c,onValueChange:d,options:G,icons:J})}),a.jsx(ia,{label:"Priority",children:a.jsx(Am,{value:u,onValueChange:f,options:kn,icons:h6})}),a.jsx(ia,{label:"Type",children:a.jsx(Am,{value:m,onValueChange:p,options:ss,icons:p6})}),a.jsx(ia,{label:"Assignees",children:a.jsx(ec,{value:g,onChange:x,users:Q})}),U.length>0&&a.jsx(ia,{label:"Sprint",children:a.jsxs(Be,{value:v||"none",onValueChange:O=>y(O==="none"?"":O),children:[a.jsx(ze,{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(Rr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No sprint"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),U.map(O=>{const F=g6(O);return a.jsx(Ne,{value:O.id,className:"text-xs",children:a.jsxs("div",{className:"flex items-baseline gap-1.5",children:[a.jsx("span",{children:O.name}),F&&a.jsx("span",{className:"text-[10px] text-muted-foreground font-normal",children:F})]})},O.id)})]})]})}),(te??[]).length>0&&a.jsx(ia,{label:"List",children:a.jsxs(Be,{value:w||"none",onValueChange:O=>N(O==="none"?"":O),children:[a.jsx(ze,{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(Wp,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx(Ye,{placeholder:"No list"})]})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No list"}),(te??[]).map(O=>a.jsx(Ne,{value:O.id,className:"text-xs",children:O.name},O.id))]})]})}),a.jsx(ia,{label:"Start Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:j?"text-foreground":"text-muted-foreground",children:j?he(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(at,{className:"h-3 w-3"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:j,onSelect:k,initialFocus:!0})})]})}),a.jsx(ia,{label:"Due Date",children:a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:b?"text-foreground":"text-muted-foreground",children:b?he(b,"MMM d, yyyy"):"No due date"}),b&&a.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),C(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(at,{className:"h-3 w-3"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:b,onSelect:C,initialFocus:!0})})]})}),a.jsx(ia,{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(ho,{id:"new-recurring",checked:S,onCheckedChange:_}),a.jsxs(ut,{htmlFor:"new-recurring",className:"cursor-pointer font-normal text-xs flex items-center gap-1.5",children:[a.jsx(ol,{className:"h-3 w-3 text-muted-foreground"}),S?A.charAt(0).toUpperCase()+A.slice(1):"Off"]})]}),S&&a.jsxs("div",{className:"space-y-2 pl-1 border-l-2 border-indigo-200 dark:border-indigo-800",children:[a.jsxs(Be,{value:A,onValueChange:O=>M(O),children:[a.jsx(ze,{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(Ye,{})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"weekly",className:"text-xs",children:"Weekly"}),a.jsx(Ne,{value:"monthly",className:"text-xs",children:"Monthly"})]})]}),a.jsxs(Ot,{children:[a.jsx(Pt,{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(mr,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),a.jsx("span",{className:P?"text-foreground":"text-muted-foreground",children:P?he(P,"MMM d, yyyy"):"No end date"}),P&&a.jsx("button",{type:"button",onClick:O=>{O.stopPropagation(),T(void 0)},className:"ml-auto text-muted-foreground hover:text-foreground transition-colors",children:a.jsx(at,{className:"h-3 w-3"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:P,onSelect:T,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 v6={issue:{icon:ga,label:"Issue"},project:{icon:Rr,label:"Project"},comment:{icon:S1,label:"Comment"},sprint:{icon:ds,label:"Sprint"}};function y6(e){const t=new Date(e);return hI(t)?oI(t,{addSuffix:!0}):pI(t)?`Yesterday ${he(t,"h:mm a")}`:he(t,"MMM d, yyyy")}function b6(){const{workspace:e}=Vt(),t=St(),{data:r,isLoading:n}=gT(),{data:s=[]}=so(),i=vT(),o=yT(),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",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(ee,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5",onClick:()=>o.mutate(void 0,{onSuccess:()=>L.success("All marked as read"),onError:()=>L.error("Failed")}),disabled:o.isPending,children:[a.jsx(zA,{className:"h-3.5 w-3.5"}),"Mark all read"]})]}),a.jsxs("div",{className:"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",{className:"grid grid-cols-[20px_130px_1fr_130px_88px] items-center px-6 py-3",children:[a.jsx("div",{}),a.jsx(ue,{className:"h-5 w-20 rounded-full"}),a.jsx(ue,{className:"h-4 w-3/4"}),a.jsx(ue,{className:"h-4 w-20"}),a.jsx("div",{})]},u))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(u=>{const f=v6[u.entity_type]??{icon:Ii,label:u.entity_type},m=f.icon,p=d(u);return a.jsxs("div",{className:R("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:()=>{p&&(u.read||i.mutate(u.id),t(p))},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:R("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:y6(u.created_at)}),a.jsx("div",{className:"flex justify-end",onClick:g=>g.stopPropagation(),children:!u.read&&a.jsx(ee,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground px-2",onClick:()=>i.mutate(u.id,{onError:()=>L.error("Failed")}),children:"Mark read"})})]},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(Ii,{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 w6({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,g]=h.useState(!1),x=YI(r);function v(){s(""),o(""),c(void 0),u(void 0),t()}async function y(w){w.preventDefault(),n.trim()&&x.mutate({name:n.trim(),goal:i.trim()||void 0,start_date:l?he(l,"yyyy-MM-dd"):null,end_date:d?he(d,"yyyy-MM-dd"):null},{onSuccess:()=>{L.success("Sprint created"),v()},onError:()=>L.error("Failed to create sprint")})}return a.jsx(li,{open:e,onOpenChange:w=>!w&&v(),children:a.jsxs(ci,{className:"sm:max-w-md",children:[a.jsx(oo,{children:a.jsx(co,{children:"New Sprint"})}),a.jsxs("form",{onSubmit:y,className:"flex flex-col flex-1 overflow-hidden",children:[a.jsxs(lo,{className:"space-y-4 py-1",children:[a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs(ut,{htmlFor:"sprint-name",children:["Name ",a.jsx("span",{className:"text-destructive",children:"*"})]}),a.jsx(Ae,{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(ut,{htmlFor:"sprint-goal",children:["Goal ",a.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),a.jsx(Wu,{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(ut,{children:"Start Date"}),a.jsxs(Ot,{open:f,onOpenChange:m,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(ee,{variant:"outline",className:R("w-full justify-start text-left font-normal text-sm h-9",!l&&"text-muted-foreground"),children:[a.jsx(mr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),l?he(l,"MMM d, yyyy"):"Pick date"]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{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(ut,{children:"End Date"}),a.jsxs(Ot,{open:p,onOpenChange:g,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(ee,{variant:"outline",className:R("w-full justify-start text-left font-normal text-sm h-9",!d&&"text-muted-foreground"),children:[a.jsx(mr,{className:"mr-2 h-3.5 w-3.5 shrink-0"}),d?he(d,"MMM d, yyyy"):"Pick date"]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:d,onSelect:w=>{u(w),g(!1)},disabled:w=>l?w<l:!1,initialFocus:!0})})]})]})]})]}),a.jsxs(Vl,{children:[a.jsx(ee,{type:"button",variant:"ghost",onClick:v,children:"Cancel"}),a.jsx(ee,{type:"submit",disabled:!n.trim()||x.isPending,children:x.isPending?"Creating…":"Create Sprint"})]})]})]})})}const j6={active:{label:"Active",icon:Cu,badge:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",section:"Active Sprint"},planned:{label:"Planned",icon:Xn,badge:"bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",section:"Planned"},completed:{label:"Completed",icon:ls,badge:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",section:"Completed"}};function N6({sprint:e,projectId:t,issueCount:r,workingDays:n,holidays:s=[]}){const i=GI(e.id,t),o=VI(t),l=j6[e.status],c=l.icon;function d(){i.mutate({status:"active"},{onSuccess:()=>L.success(`"${e.name}" started`),onError:()=>L.error("Failed to start sprint")})}function u(){i.mutate({status:"completed"},{onSuccess:()=>L.success(`"${e.name}" completed`),onError:g=>L.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:()=>L.success("Sprint deleted"),onError:()=>L.error("Failed to delete sprint")})}const m=!!e.start_date,p=!!e.end_date;return a.jsxs("div",{className:"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:R("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:R("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(dD,{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(eo,{className:"h-3.5 w-3.5 shrink-0"}),m||p?a.jsxs("span",{children:[m?he(new Date(e.start_date),"MMM d"):"—"," → ",p?he(new Date(e.end_date),"MMM d, yyyy"):"—",m&&p&&n&&(()=>{const g=SN(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(Zu,{className:R("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(ee,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:d,disabled:i.isPending,children:[a.jsx(Cu,{className:"h-3 w-3"}),"Start"]}),e.status==="active"&&a.jsxs(ee,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:u,disabled:i.isPending,children:[a.jsx(ls,{className:"h-3 w-3"}),"Complete"]}),a.jsx(ee,{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($r,{className:"h-3.5 w-3.5"})})]})]})}function k6(){const{projectKey:e}=Vt(),[t,r]=h.useState(!1),{data:n}=Pa(e??""),s=(n==null?void 0:n.id)??"",{data:i,isLoading:o}=mo(s||void 0),{data:l}=Rl(s||void 0),{data:c}=lg(),{data:d=[]}=cg(new Date().getFullYear()),u=(l??[]).reduce((p,g)=>(g.sprint_id&&(p[g.sprint_id]=(p[g.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",children:[a.jsx(Nr,{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(ee,{size:"sm",onClick:()=>r(!0),children:[a.jsx(ct,{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(ue,{className:"h-7 w-7 rounded-full"}),a.jsx(ue,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(ue,{className:"h-4 w-32"}),a.jsx(ue,{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(eo,{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(ee,{size:"sm",onClick:()=>r(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"New Sprint"]})]}):a.jsx("div",{children:m.map(({key:p,label:g,items:x})=>x.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:g})}),a.jsx("div",{className:"divide-y divide-border",children:x.map(v=>a.jsx(N6,{sprint:v,projectId:s,issueCount:u[v.id]??0,workingDays:c==null?void 0:c.working_days,holidays:d},v.id))})]},p))})]}),a.jsx(Nr,{zone:"project.sprints.after",props:{projectId:s}}),a.jsx(w6,{open:t,onClose:()=>r(!1),projectId:s})]})}const Bi={all:["roles"],list:()=>[...Bi.all,"list"],detail:e=>[...Bi.all,e]};function Ju(){return We({queryKey:Bi.list(),queryFn:()=>re.get("/admin/roles"),select:e=>e.roles,staleTime:1e3*60*2})}function S6(){const e=Se();return be({mutationFn:t=>re.post("/admin/roles",t),onSuccess:()=>{e.invalidateQueries({queryKey:Bi.list()})}})}function C6(e){const t=Se();return be({mutationFn:r=>re.put(`/admin/roles/${e}`,r),onSuccess:()=>{t.invalidateQueries({queryKey:Bi.list()})}})}function _6(){const e=Se();return be({mutationFn:t=>re.delete(`/admin/roles/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:Bi.list()})}})}function Ek(){const e=Se();return be({mutationFn:({userId:t,appRoleId:r})=>re.patch(`/admin/users/${t}/role`,{app_role_id:r}),onSuccess:()=>{e.invalidateQueries({queryKey:["workspaces"]}),e.invalidateQueries({queryKey:["users"]})}})}const hd=[{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 pd({open:e,onClose:t,onConfirm:r,title:n,description:s,confirmLabel:i="Confirm",variant:o="default",loading:l=!1}){return a.jsx(Fi,{open:e,onOpenChange:c=>!c&&t(),children:a.jsxs(qs,{children:[a.jsxs(Hs,{children:[a.jsx(Ys,{children:n}),a.jsx(Gs,{children:s})]}),a.jsxs(Ks,{children:[a.jsx(Xs,{onClick:t,disabled:l,children:"Cancel"}),a.jsx(Vs,{onClick:r,disabled:l,className:R(o==="destructive"&&"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus:ring-destructive"),children:l?"Please wait…":i})]})]})})}function wg({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:R("text-muted-foreground hover:text-foreground transition-colors",t),title:"Copy",children:r?a.jsx(ir,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Fp,{className:"h-3.5 w-3.5"})})}function Ny({value:e,onChange:t,appRoles:r}){return!r||r.length===0?null:a.jsxs(Be,{value:e||"none",onValueChange:n=>t(n==="none"?"":n),children:[a.jsx(ze,{className:"h-9",children:a.jsx(Ye,{placeholder:"No custom role"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),r.map(n=>a.jsx(Ne,{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 O6({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,g]=h.useState(""),[x,v]=h.useState(null),{data:y=[]}=Zl(),{data:w=[]}=ql(r),N=OD(r),j=CD(r),{data:k}=Ju(),b=h.useMemo(()=>new Set(w.map(M=>M.user_id)),[w]),C=h.useMemo(()=>y.filter(M=>!b.has(M.id)),[y,b]),S=h.useMemo(()=>{const M=i.toLowerCase().trim();return M?C.filter(P=>P.email.toLowerCase().includes(M)||`${P.first_name} ${P.last_name}`.toLowerCase().includes(M)):C},[C,i]);h.useEffect(()=>{e&&(o(""),c(""),u(""),m(""),g(""),v(null),s("existing"))},[e]);const _=()=>{l&&N.mutate({user_id:l,role:"member",app_role_id:d||null},{onSuccess:()=>{L.success("Member added"),t()},onError:M=>L.error(M.message||"Failed to add member")})},A=M=>{M.preventDefault(),j.mutate({email:f.trim()||void 0,role:"member",app_role_id:p||null},{onSuccess:P=>{v(P.invitation),L.success("Invitation created")},onError:P=>L.error(P.message||"Failed to create invitation")})};return a.jsx(Ma,{open:e,onOpenChange:M=>!M&&t(),children:a.jsxs(Zn,{className:"sm:max-w-[520px]",children:[a.jsx(Ea,{children:a.jsx(Aa,{children:"Add member"})}),!x&&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:R("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:R("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"&&!x&&a.jsxs("div",{className:"space-y-3 pt-1",children:[a.jsx(Ae,{placeholder:"Search by name or email…",value:i,onChange:M=>o(M.target.value),className:"h-9",autoFocus:!0}),a.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:C.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"})]}):S.length===0?a.jsx("div",{className:"py-6 text-center",children:a.jsxs("p",{className:"text-sm text-muted-foreground",children:['No users match "',i,'"']})}):a.jsx("div",{className:"max-h-52 overflow-y-auto divide-y divide-border",children:S.map(M=>{const P=M.first_name??"",T=M.last_name??"",D=`${P} ${T}`.trim()||M.email,B=(P[0]??T[0]??M.email[0]??"U").toUpperCase(),E=l===M.id;return a.jsxs("button",{type:"button",onClick:()=>c(E?"":M.id),className:R("w-full flex items-center gap-3 px-3 py-2.5 text-left transition-colors",E?"bg-indigo/5 dark:bg-indigo/10":"hover:bg-muted/40"),children:[a.jsx(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:B})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium truncate",children:D}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.email})]}),E&&a.jsx(ir,{className:"h-4 w-4 text-indigo shrink-0"})]},M.id)})})}),C.length>0&&a.jsxs(a.Fragment,{children:[k&&k.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(Ny,{value:d,onChange:u,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ee,{type:"button",size:"sm",disabled:!l||N.isPending,onClick:_,children:N.isPending?"Adding…":"Add to workspace"})]})]})]}),n==="invite"&&!x&&a.jsxs("form",{onSubmit:A,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(Ae,{type:"email",placeholder:"colleague@example.com",value:f,onChange:M=>m(M.target.value),className:"h-9",autoFocus:!0}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Leave blank to generate a shareable link."})]}),k&&k.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(Ny,{value:p,onChange:g,appRoles:k})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ee,{type:"submit",size:"sm",disabled:j.isPending,children:j.isPending?"Creating…":"Create invitation"})]})]}),x&&a.jsxs("div",{className:"space-y-4 pt-1",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Share this link with"," ",x.email?a.jsx("span",{className:"font-medium text-foreground",children:x.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(Wl,{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/${x.token}`}),a.jsx(wg,{value:`${window.location.origin}/invite/${x.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(ee,{size:"sm",onClick:t,children:"Done"})]})]})]})})}function P6({invitation:e,workspaceId:t}){const r=_D(t),n=`${window.location.origin}/invite/${e.token}`;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("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(Wl,{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:R("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:n}),a.jsx(wg,{value:n})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:he(new Date(e.created_at),"MMM d")}),a.jsx("button",{onClick:()=>r.mutate(e.id,{onSuccess:()=>L.success("Invitation revoked"),onError:()=>L.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(at,{className:"h-3.5 w-3.5"})})]})]})}function M6({workspaceId:e}){var v;const{workspace:t,setWorkspace:r}=Ie(),{data:n,isLoading:s}=Ou(),i=n==null?void 0:n.find(y=>y.id===(t==null?void 0:t.id)),o=jD(e),l=ND(e),c=kD(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}),L.success("Workspace updated")},onError:()=>L.error("Failed to update workspace")})},g=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}),L.success("Logo updated")},onError:()=>L.error("Failed to upload logo")}),d.current&&(d.current.value=""))},x=()=>{c.mutate(void 0,{onSuccess:y=>{r({id:y.workspace.id,name:y.workspace.name,slug:y.workspace.slug,logo_url:null}),L.success("Logo removed")},onError:()=>L.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-[180px_1fr] items-center gap-4 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:g}),a.jsx(ee,{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(ee,{size:"sm",variant:"ghost",className:"h-8 text-muted-foreground",onClick:x,disabled:c.isPending,children:c.isPending?"Removing…":"Remove"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Name"}),s?a.jsx(ue,{className:"h-8 w-64"}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ae,{value:u,onChange:y=>f(y.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Workspace name"}),m&&a.jsx(ee,{size:"sm",className:"h-8",onClick:p,disabled:!u.trim()||o.isPending,children:o.isPending?"Saving…":"Save"})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 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(ue,{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(wg,{value:(i==null?void 0:i.slug)??""})]})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),s?a.jsx(ue,{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-[180px_1fr] items-center gap-4 px-6 py-3.5",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Created"}),s?a.jsx(ue,{className:"h-4 w-28"}):a.jsx("span",{className:"text-sm text-muted-foreground",children:i!=null&&i.created_at?he(new Date(i.created_at),"MMMM d, yyyy"):"—"})]})]})}function E6({workspaceId:e,onInvite:t}){var p;const{data:r,isLoading:n}=ql(e),{data:s,isLoading:i}=SD(e),o=PD(e),l=Ek(),{data:c}=Ju(),{user:d}=Ie(),[u,f]=h.useState(null),m=(s==null?void 0:s.filter(g=>g.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",children:["Members",!n&&r&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",r.length]})]})}),n?a.jsx("div",{className:"divide-y divide-border",children:[1,2,3].map(g=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(ue,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(ue,{className:"h-3.5 w-32"}),a.jsx(ue,{className:"h-3 w-48"})]})]},g))}):r!=null&&r.length?a.jsx("div",{className:"divide-y divide-border",children:r.map(g=>{var k;const x=g.user,v=(x==null?void 0:x.first_name)??"",y=(x==null?void 0:x.last_name)??"",w=`${v} ${y}`.trim()||(x==null?void 0:x.email)||"Unknown",N=(v[0]??y[0]??((k=x==null?void 0:x.email)==null?void 0:k[0])??"U").toUpperCase(),j=(x==null?void 0:x.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(Ft,{className:"h-7 w-7 shrink-0",children:a.jsx(Bt,{className:"text-[11px] font-medium",children:N})}),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:w}),j&&a.jsx("span",{className:"text-[11px] text-muted-foreground",children:"(you)"})]}),(x==null?void 0:x.email)&&a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:x.email})]}),c&&c.length>0&&a.jsxs(Be,{value:g.app_role_id??"none",onValueChange:b=>l.mutate({userId:g.user_id,appRoleId:b==="none"?null:b},{onSuccess:()=>L.success("Custom role updated"),onError:()=>L.error("Failed to update custom role")}),children:[a.jsx(ze,{className:"h-7 text-[11px] w-32 shrink-0",children:a.jsx(Ye,{placeholder:"Custom role"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",children:a.jsx("span",{className:"text-muted-foreground",children:"No custom role"})}),c.map(b=>a.jsx(Ne,{value:b.id,children:b.name},b.id))]})]}),!j&&a.jsxs(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(cs,{className:"h-4 w-4"})})}),a.jsxs(zr,{align:"end",className:"w-44",children:[a.jsx(bt,{onClick:()=>{fetch(`/admin/users/${g.user_id}/sessions`,{method:"DELETE",headers:{Authorization:`Bearer ${localStorage.getItem("meridian_token")}`}}).then(()=>L.success("Sessions revoked — user will be signed out")).catch(()=>L.error("Failed to revoke sessions"))},children:"Revoke sessions"}),a.jsx(qn,{}),a.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:()=>f(g),children:[a.jsx($r,{className:"h-3.5 w-3.5 mr-2"}),"Remove"]})]})]})]},g.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(da,{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",children:["Pending invitations",!i&&m.length>0&&a.jsxs("span",{className:"ml-2 font-normal normal-case tracking-normal",children:["· ",m.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(ct,{className:"h-3 w-3"}),"Invite"]})]}),i?a.jsx("div",{className:"divide-y divide-border",children:[1,2].map(g=>a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5",children:[a.jsx(ue,{className:"h-7 w-7 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(ue,{className:"h-3.5 w-48"}),a.jsx(ue,{className:"h-3 w-64"})]})]},g))}):m.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:m.map(g=>a.jsx(P6,{invitation:g,workspaceId:e},g.id))}),a.jsx(pd,{open:!!u,onClose:()=>f(null),onConfirm:()=>{u&&o.mutate(u.user_id,{onSuccess:()=>{L.success("Member removed"),f(null)},onError:()=>{L.error("Failed to remove member"),f(null)}})},title:"Remove member",description:`Remove ${((p=u==null?void 0:u.user)==null?void 0:p.email)??"this member"} from the workspace? They will lose access to all projects.`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending})]})}function A6({workspaceId:e,teamId:t,allMembers:r}){var y,w;const{data:n,isLoading:s}=AD(e,t),i=DD(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))??[]),g=r.filter(N=>!p.has(N.user_id)),x=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(ue,{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 _;const j=N.user,k=(j==null?void 0:j.first_name)??"",b=(j==null?void 0:j.last_name)??"",C=`${k} ${b}`.trim()||(j==null?void 0:j.email)||"Unknown",S=(k[0]??b[0]??((_=j==null?void 0:j.email)==null?void 0:_[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(Ft,{className:"h-6 w-6 shrink-0",children:a.jsx(Bt,{className:"text-[10px] font-medium",children:S})}),a.jsx("span",{className:"flex-1 text-sm truncate",children:C}),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(at,{className:"h-3.5 w-3.5"})})]},N.id)})}),g.length>0&&a.jsxs("div",{className:"px-8 py-2.5 flex items-center gap-2 border-t border-border/50",children:[a.jsx(no,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),a.jsxs(Be,{value:l,onValueChange:c,children:[a.jsx(ze,{className:"h-7 text-xs flex-1 max-w-[200px]",children:a.jsx(Ye,{placeholder:"Add member…"})}),a.jsx(Le,{children:g.map(N=>{const j=N.user,k=(j==null?void 0:j.first_name)??"",b=(j==null?void 0:j.last_name)??"",C=`${k} ${b}`.trim()||(j==null?void 0:j.email)||"Unknown";return a.jsx(Ne,{value:N.user_id,children:C},N.user_id)})})]}),l&&a.jsx(ee,{size:"sm",className:"h-7 text-xs px-2",disabled:i.isPending,onClick:()=>m(l),children:"Add"})]}),a.jsx(pd,{open:!!d,onClose:()=>u(null),onConfirm:()=>{d&&o.mutate(d,{onSuccess:()=>{L.success("Removed from team"),u(null)},onError:()=>{L.error("Failed to remove"),u(null)}})},title:"Remove from team",description:`Remove ${((y=x==null?void 0:x.user)==null?void 0:y.email)??"this member"} from the team?`,confirmLabel:"Remove",variant:"destructive",loading:o.isPending}),a.jsx(pd,{open:!!f,onClose:()=>{m(null),c("")},onConfirm:()=>{f&&i.mutate(f,{onSuccess:()=>{L.success("Added to team"),m(null),c("")},onError:()=>{L.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 D6({workspaceId:e}){const{data:t,isLoading:r}=Pu(e),{data:n}=ql(e),s=MD(e),i=ED(e),[o,l]=h.useState(new Set),[c,d]=h.useState(!1),[u,f]=h.useState(""),[m,p]=h.useState(null),g=t==null?void 0:t.find(y=>y.id===m),x=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:()=>{L.success("Team created"),f(""),d(!1)},onError:()=>L.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(ct,{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(Ae,{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(ee,{type:"submit",size:"sm",className:"h-8",disabled:!u.trim()||s.isPending,children:s.isPending?"Creating…":"Create"}),a.jsx(ee,{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(ue,{className:"h-7 w-7 rounded-lg shrink-0"}),a.jsx(ue,{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:()=>x(y.id),className:"text-muted-foreground hover:text-foreground shrink-0 transition-colors",children:w?a.jsx(Vn,{className:"h-4 w-4"}):a.jsx(_n,{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(Fs,{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(Xr,{children:[a.jsx(Qr,{asChild:!0,children:a.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",children:a.jsx(cs,{className:"h-4 w-4"})})}),a.jsx(zr,{align:"end",className:"w-36",children:a.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:()=>p(y.id),children:[a.jsx($r,{className:"h-3.5 w-3.5 mr-2"}),"Delete team"]})})]})]}),w&&a.jsx(A6,{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(Fs,{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(ee,{variant:"outline",size:"sm",onClick:()=>d(!0),children:"Create a team"})]}),a.jsx(pd,{open:!!m,onClose:()=>p(null),onConfirm:()=>{m&&i.mutate(m,{onSuccess:()=>{L.success("Team deleted"),p(null)},onError:()=>{L.error("Failed to delete team"),p(null)}})},title:"Delete team",description:`Delete "${(g==null?void 0:g.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 T6=["general","members","teams"];function I6(){const{workspace:e}=Ie(),t=(e==null?void 0:e.id)??"",[r,n]=Dl(),s=r.get("tab"),[i,o]=h.useState(T6.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",children:[a.jsx(Nr,{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",children:["general","members","teams"].map(u=>a.jsx("button",{onClick:()=>l(u),className:R("h-12 px-4 text-sm font-medium border-b-2 transition-colors capitalize",i===u?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:u},u))}),i==="members"&&a.jsxs(ee,{size:"sm",onClick:()=>d(!0),children:[a.jsx(ct,{className:"h-4 w-4"}),"Add member"]})]}),i==="general"&&a.jsx(M6,{workspaceId:t}),i==="members"&&a.jsx(E6,{workspaceId:t,onInvite:()=>d(!0)}),i==="teams"&&a.jsx(D6,{workspaceId:t})]}),a.jsx(Nr,{zone:"workspace.settings.after",props:{workspaceId:t}}),a.jsx(O6,{open:c,onClose:()=>d(!1),workspaceId:t})]})}function R6({open:e,onClose:t}){const[r,n]=h.useState(""),[s,i]=h.useState(""),[o,l]=h.useState(new Set),c=S6();h.useEffect(()=>{e&&(n(""),i(""),l(new Set))},[e]);const d=hd.flatMap(x=>x.permissions.map(v=>v.key)),u=d.every(x=>o.has(x)),f=!u&&d.some(x=>o.has(x)),m=()=>{l(u?new Set:new Set(d))},p=x=>{l(v=>{const y=new Set(v);return y.has(x)?y.delete(x):y.add(x),y})},g=x=>{x.preventDefault(),r.trim()&&c.mutate({name:r.trim(),description:s.trim()||void 0,permissions:Array.from(o)},{onSuccess:()=>{L.success("Role created"),t()},onError:v=>L.error(v.message||"Failed to create role")})};return a.jsx(Ma,{open:e,onOpenChange:x=>!x&&t(),children:a.jsxs(Zn,{className:"sm:max-w-[580px] max-h-[85vh] overflow-y-auto",children:[a.jsxs(Ea,{children:[a.jsx(Aa,{children:"Create role"}),a.jsx(io,{children:"Define a new custom role with a specific permission set."})]}),a.jsxs("form",{onSubmit:g,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(Ae,{value:r,onChange:x=>n(x.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(Ae,{value:s,onChange:x=>i(x.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"})]}),hd.map(x=>a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:x.group}),a.jsx("div",{className:"space-y-1.5",children:x.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))})]},x.group))]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[a.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ee,{type:"submit",size:"sm",disabled:!r.trim()||c.isPending,children:c.isPending?"Creating…":"Create role"})]})]})]})})}function $6({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=C6(e.id),f=_6();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=hd.flatMap(j=>j.permissions.map(k=>k.key)),g=p.every(j=>o.has(j)),x=!g&&p.some(j=>o.has(j)),v=()=>{l(g?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:()=>L.success("Role saved"),onError:j=>L.error(j.message||"Failed to save role")})},N=()=>{f.mutate(e.id,{onSuccess:()=>{L.success("Role deleted"),t(),d(!1)},onError:j=>L.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(ro,{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($r,{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(Ae,{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(Ae,{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:g?"Deselect all":"Select all"})]}),hd.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(ee,{size:"sm",onClick:w,disabled:!m||!r.trim()||u.isPending,children:u.isPending?"Saving…":"Save changes"})}),a.jsx(Fi,{open:c,onOpenChange:d,children:a.jsxs(qs,{children:[a.jsxs(Hs,{children:[a.jsxs(Ys,{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(Ks,{children:[a.jsx(Xs,{children:"Cancel"}),a.jsx(Vs,{onClick:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function z6(){const{data:e,isLoading:t}=Ju(),[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 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(uh,{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(ee,{size:"sm",onClick:()=>i(!0),children:[a.jsx(ct,{className:"h-4 w-4 mr-1.5"}),"Create role"]})]}),a.jsxs("div",{className:"flex flex-1 min-h-0",children:[a.jsx("div",{className:"w-56 shrink-0 border-r border-border flex flex-col overflow-y-auto",children:t?a.jsx("div",{className:"p-4 space-y-2",children:[1,2,3].map(d=>a.jsx(ue,{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:R("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(ro,{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:R("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($6,{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(uh,{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(R6,{open:s,onClose:()=>i(!1)})]})})}function L6(e){return We({queryKey:["invite",e],queryFn:()=>re.get(`/auth/invite/${e}`),retry:!1,enabled:!!e})}function F6(){const{token:e}=Vt(),{isAuthenticated:t}=Ie(),r=St(),{data:n,isLoading:s,error:i}=L6(e??""),{data:o}=Mu(),l=LD(e??""),[c,d]=h.useState(""),[u,f]=h.useState(""),[m,p]=h.useState(""),[g,x]=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){L.error("Email is required");return}l.mutate({email:k,password:g,first_name:c,last_name:u},{onSuccess:()=>{r(n.workspace?`/${n.workspace.slug}/projects`:"/",{replace:!0})},onError:b=>L.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("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"})})})})}),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(Yr,{to:"/login",children:a.jsx(ee,{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(RA,{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(iD,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):a.jsx(xD,{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(Ae,{placeholder:"First name",value:c,onChange:j=>d(j.target.value),required:!0,className:"h-9 bg-transparent",autoFocus:!0}),a.jsx(Ae,{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(Ae,{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(Ae,{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(Ae,{type:v?"text":"password",placeholder:"Password (min. 8 characters)",value:g,onChange:j=>x(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(Bl,{className:"h-4 w-4"}):a.jsx(ii,{className:"h-4 w-4"})})]}),a.jsx("div",{className:"pt-1",children:a.jsx(ee,{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(Jp,{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(Yr,{to:"/login",className:"text-indigo hover:opacity-80 transition-opacity",children:"Sign in"})]})]}):null]})})}var B6=["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 jg(e){if(typeof e!="string")return!1;var t=B6;return t.includes(e)}var W6=["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"],U6=new Set(W6);function Ak(e){return typeof e!="string"?!1:U6.has(e)}function Dk(e){return typeof e=="string"&&e.startsWith("data-")}function ya(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ak(r)||Dk(r))&&(t[r]=e[r]);return t}function Ng(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ya(t)}return typeof e=="object"&&!Array.isArray(e)?ya(e):null}function ln(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Ak(r)||Dk(r)||jg(r))&&(t[r]=e[r]);return t}var q6=["children","width","height","viewBox","className","style","title","desc"];function Nh(){return Nh=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},Nh.apply(null,arguments)}function H6(e,t){if(e==null)return{};var r,n,s=K6(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 K6(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 Tk=h.forwardRef((e,t)=>{var{children:r,width:n,height:s,viewBox:i,className:o,style:l,title:c,desc:d}=e,u=H6(e,q6),f=i||{width:n,height:s,x:0,y:0},m=st("recharts-surface",o);return h.createElement("svg",Nh({},ln(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)}),Y6=["children","className"];function kh(){return kh=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},kh.apply(null,arguments)}function G6(e,t){if(e==null)return{};var r,n,s=V6(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 V6(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 ba=h.forwardRef((e,t)=>{var{children:r,className:n}=e,s=G6(e,Y6),i=st("recharts-layer",n);return h.createElement("g",kh({className:i},ln(s),{ref:t}),r)}),X6=h.createContext(null);function lt(e){return function(){return e}}const Ik=Math.cos,gd=Math.sin,On=Math.sqrt,xd=Math.PI,ef=2*xd,Sh=Math.PI,Ch=2*Sh,bs=1e-6,Q6=Ch-bs;function Rk(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Z6(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Rk;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 J6{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Rk:Z6(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>bs)if(!(Math.abs(f*c-d*u)>bs)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,g=s-l,x=c*c+d*d,v=p*p+g*g,y=Math.sqrt(x),w=Math.sqrt(m),N=i*Math.tan((Sh-Math.acos((x+m-v)/(2*y*w)))/2),j=N/w,k=N/y;Math.abs(j-1)>bs&&this._append`L${t+j*u},${r+j*f}`,this._append`A${i},${i},0,0,${+(f*p>u*g)},${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)>bs||Math.abs(this._y1-u)>bs)&&this._append`L${d},${u}`,n&&(m<0&&(m=m%Ch+Ch),m>Q6?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>bs&&this._append`A${n},${n},0,${+(m>=Sh)},${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 kg(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 J6(t)}function Sg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $k(e){this._context=e}$k.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 tf(e){return new $k(e)}function zk(e){return e[0]}function Lk(e){return e[1]}function Fk(e,t){var r=lt(!0),n=null,s=tf,i=null,o=kg(l);e=typeof e=="function"?e:e===void 0?zk:lt(e),t=typeof t=="function"?t:t===void 0?Lk:lt(t);function l(c){var d,u=(c=Sg(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:lt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:lt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:lt(!!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 Ic(e,t,r){var n=null,s=lt(!0),i=null,o=tf,l=null,c=kg(d);e=typeof e=="function"?e:e===void 0?zk:lt(+e),t=typeof t=="function"?t:lt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?Lk:lt(+r);function d(f){var m,p,g,x=(f=Sg(f)).length,v,y=!1,w,N=new Array(x),j=new Array(x);for(i==null&&(l=o(w=c())),m=0;m<=x;++m){if(!(m<x&&s(v=f[m],m,f))===y)if(y=!y)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=m-1;g>=p;--g)l.point(N[g],j[g]);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 Fk().defined(s).curve(o).context(i)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:lt(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:lt(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:lt(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:lt(+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:lt(!!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 Bk{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 ez(e){return new Bk(e,!0)}function tz(e){return new Bk(e,!1)}const Cg={draw(e,t){const r=On(t/xd);e.moveTo(r,0),e.arc(0,0,r,0,ef)}},rz={draw(e,t){const r=On(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()}},Wk=On(1/3),nz=Wk*2,az={draw(e,t){const r=On(t/nz),n=r*Wk;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},sz={draw(e,t){const r=On(t),n=-r/2;e.rect(n,n,r,r)}},iz=.8908130915292852,Uk=gd(xd/10)/gd(7*xd/10),oz=gd(ef/10)*Uk,lz=-Ik(ef/10)*Uk,cz={draw(e,t){const r=On(t*iz),n=oz*r,s=lz*r;e.moveTo(0,-r),e.lineTo(n,s);for(let i=1;i<5;++i){const o=ef*i/5,l=Ik(o),c=gd(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*s,c*n+l*s)}e.closePath()}},Dm=On(3),dz={draw(e,t){const r=-On(t/(Dm*3));e.moveTo(0,r*2),e.lineTo(-Dm*r,-r),e.lineTo(Dm*r,-r),e.closePath()}},Jr=-.5,en=On(3)/2,_h=1/On(12),uz=(_h/2+1)*3,fz={draw(e,t){const r=On(t/uz),n=r/2,s=r*_h,i=n,o=r*_h+r,l=-i,c=o;e.moveTo(n,s),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(Jr*n-en*s,en*n+Jr*s),e.lineTo(Jr*i-en*o,en*i+Jr*o),e.lineTo(Jr*l-en*c,en*l+Jr*c),e.lineTo(Jr*n+en*s,Jr*s-en*n),e.lineTo(Jr*i+en*o,Jr*o-en*i),e.lineTo(Jr*l+en*c,Jr*c-en*l),e.closePath()}};function mz(e,t){let r=null,n=kg(s);e=typeof e=="function"?e:lt(e||Cg),t=typeof t=="function"?t:lt(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:lt(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:lt(+i),s):t},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function vd(){}function yd(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 qk(e){this._context=e}qk.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:yd(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:yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hz(e){return new qk(e)}function Hk(e){this._context=e}Hk.prototype={areaStart:vd,areaEnd:vd,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:yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pz(e){return new Hk(e)}function Kk(e){this._context=e}Kk.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:yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gz(e){return new Kk(e)}function Yk(e){this._context=e}Yk.prototype={areaStart:vd,areaEnd:vd,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 xz(e){return new Yk(e)}function ky(e){return e<0?-1:1}function Sy(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(ky(i)+ky(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function Cy(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Tm(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 bd(e){this._context=e}bd.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:Tm(this,this._t0,Cy(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,Tm(this,Cy(this,r=Sy(this,e,t)),r);break;default:Tm(this,this._t0,r=Sy(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Gk(e){this._context=new Vk(e)}(Gk.prototype=Object.create(bd.prototype)).point=function(e,t){bd.prototype.point.call(this,t,e)};function Vk(e){this._context=e}Vk.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 vz(e){return new bd(e)}function yz(e){return new Gk(e)}function Xk(e){this._context=e}Xk.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=_y(e),s=_y(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 _y(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 bz(e){return new Xk(e)}function rf(e,t){this._context=e,this._t=t}rf.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 wz(e){return new rf(e,.5)}function jz(e){return new rf(e,0)}function Nz(e){return new rf(e,1)}function Qs(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 Oh(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function kz(e,t){return e[t]}function Sz(e){const t=[];return t.key=e,t}function Cz(){var e=lt([]),t=Oh,r=Qs,n=kz;function s(i){var o=Array.from(e.apply(this,arguments),Sz),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=Sg(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:lt(Array.from(i)),s):e},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:lt(+i),s):n},s.order=function(i){return arguments.length?(t=i==null?Oh:typeof i=="function"?i:lt(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??Qs,s):r},s}function _z(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}Qs(e,t)}}function Oz(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}Qs(e,t)}}function Pz(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,g=0;g<l;++g){var x=e[t[g]],v=x[n][1]||0,y=x[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,Qs(e,t)}}var nf={},Qk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(Qk);var _g={};(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})(_g);var af={};(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})(af);var sf={},Zk={};(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})(Zk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zk,r=af;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})(sf);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qk,r=_g,n=af,s=sf;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})(nf);var Mz=nf.get;const Wi=Oa(Mz);var Ez=4;function Va(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ez,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Nt(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+Va(l)+i:s+i},"")}var Ar=e=>e===0?0:e>0?1:-1,Hn=e=>typeof e=="number"&&e!=+e,Zs=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ke=e=>(typeof e=="number"||e instanceof Number)&&!Hn(e),Kn=e=>ke(e)||typeof e=="string",Az=0,fl=e=>{var t=++Az;return"".concat(e||"").concat(t)},Sn=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(!ke(t)&&typeof t!="string")return n;var i;if(Zs(t)){if(r==null)return n;var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Hn(i)&&(i=n),s&&r!=null&&i>r&&(i=r),i},Jk=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 sr(e,t,r){return ke(e)&&ke(t)?Va(e+r*(t-e)):t}function Dz(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Wi(n,t))===r)}var Gt=e=>e===null||typeof e>"u",nc=e=>Gt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Dr(e){return e!=null}function po(){}var Tz=["type","size","sizeType"];function Ph(){return Ph=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},Ph.apply(null,arguments)}function Oy(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 Py(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(r),!0).forEach(function(n){Iz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Iz(e,t,r){return(t=Rz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rz(e){var t=$z(e,"string");return typeof t=="symbol"?t:t+""}function $z(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 zz(e,t){if(e==null)return{};var r,n,s=Lz(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 Lz(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 eS={symbolCircle:Cg,symbolCross:rz,symbolDiamond:az,symbolSquare:sz,symbolStar:cz,symbolTriangle:dz,symbolWye:fz},Fz=Math.PI/180,Bz=e=>{var t="symbol".concat(nc(e));return eS[t]||Cg},Wz=(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*Fz;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}},Uz=(e,t)=>{eS["symbol".concat(nc(e))]=t},tS=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,s=zz(e,Tz),i=Py(Py({},s),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=Bz(o),p=mz().type(m).size(Wz(r,n,o)),g=p();if(g!==null)return g},{className:c,cx:d,cy:u}=i,f=ln(i);return ke(d)&&ke(u)&&ke(r)?h.createElement("path",Ph({},f,{className:st("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};tS.registerSymbol=Uz;var rS=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,qz=(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=>{jg(s)&&(n[s]=i=>r[s](r,i))}),n},Hz=(e,t,r)=>n=>(e(t,r,n),null),Og=(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];jg(s)&&typeof i=="function"&&(n||(n={}),n[s]=Hz(i,t,r))}),n};function My(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 Kz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?My(Object(r),!0).forEach(function(n){Yz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):My(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yz(e,t,r){return(t=Gz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gz(e){var t=Vz(e,"string");return typeof t=="symbol"?t:t+""}function Vz(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 Zr(e,t){var r=Kz({},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 nS={},aS={};(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})(aS);var sS={};(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})(sS);var Pg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Pg);var iS={},of={},oS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(oS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oS;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(of);var lS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(lS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=of,r=lS;function n(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=n})(iS);var cS={},dS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nf;function r(n){return function(s){return t.get(s,n)}}e.property=r})(dS);var uS={},Mg={},fS={},Eg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(Eg);var Ag={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Ag);var Dg={};(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})(Dg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Eg,r=Ag,n=Dg;function s(u,f,m){return typeof m!="function"?s(u,f,()=>{}):i(u,f,function p(g,x,v,y,w,N){const j=m(g,x,v,y,w,N);return j!==void 0?!!j:i(g,x,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 g=Object.keys(f);if(u==null||r.isPrimitive(u))return g.length===0;if(g.length===0)return!0;if(p!=null&&p.has(f))return p.get(f)===u;p==null||p.set(f,u);try{for(let x=0;x<g.length;x++){const v=g[x];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[g,x]of f.entries()){const v=u.get(g);if(m(v,x,g,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 g=new Set;for(let x=0;x<f.length;x++){const v=f[x];let y=!1;for(let w=0;w<u.length;w++){if(g.has(w))continue;const N=u[w];let j=!1;if(m(N,v,x,u,f,p)&&(j=!0),j){g.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})(fS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fS;function r(n,s){return t.isMatchWith(n,s,()=>{})}e.isMatch=r})(Mg);var mS={},Tg={},hS={};(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})(hS);var lf={};(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})(lf);var Ig={};(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]",g="[object Error]",x="[object DataView]",v="[object Uint8Array]",y="[object Uint8ClampedArray]",w="[object Uint16Array]",N="[object Uint32Array]",j="[object BigUint64Array]",k="[object Int8Array]",b="[object Int16Array]",C="[object Int32Array]",S="[object BigInt64Array]",_="[object Float32Array]",A="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=m,e.arrayTag=u,e.bigInt64ArrayTag=S,e.bigUint64ArrayTag=j,e.booleanTag=s,e.dataViewTag=x,e.dateTag=l,e.errorTag=g,e.float32ArrayTag=_,e.float64ArrayTag=A,e.functionTag=f,e.int16ArrayTag=b,e.int32ArrayTag=C,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})(Ig);var pS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(pS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hS,r=lf,n=Ig,s=Ag,i=pS;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,m,p=new Map,g=void 0){const x=g==null?void 0:g(u,f,m,p);if(x!==void 0)return x;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,g);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,g));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,g));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,g);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,g),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,g),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,g),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,g),v}if(u instanceof Boolean){const v=new Boolean(u.valueOf());return p.set(u,v),c(v,u,m,p,g),v}if(u instanceof Number){const v=new Number(u.valueOf());return p.set(u,v),c(v,u,m,p,g),v}if(u instanceof String){const v=new String(u.valueOf());return p.set(u,v),c(v,u,m,p,g),v}if(typeof u=="object"&&d(u)){const v=Object.create(Object.getPrototypeOf(u));return p.set(u,v),c(v,u,m,p,g),v}return u}function c(u,f,m=u,p,g){const x=[...Object.keys(f),...t.getSymbols(f)];for(let v=0;v<x.length;v++){const y=x[v],w=Object.getOwnPropertyDescriptor(u,y);(w==null||w.writable)&&(u[y]=l(f[y],y,m,p,g))}}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})(Tg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tg;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(mS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mg,r=mS;function n(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=n})(uS);var gS={},xS={},vS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tg,r=lf,n=Ig;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})(vS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vS;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(xS);var yS={},Rg={};(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})(Rg);var bS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lf;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(bS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_g,r=Rg,n=bS,s=sf;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})(yS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mg,r=af,n=xS,s=nf,i=yS;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})(gS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pg,r=dS,n=uS,s=gS;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})(cS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aS,r=sS,n=Pg,s=iS,i=cS;function o(l,c=n.identity){return s.isArrayLikeObject(l)?t.uniqBy(Array.from(l),r.ary(i.iteratee(c),1)):[]}e.uniqBy=o})(nS);var Xz=nS.uniqBy;const Ey=Oa(Xz);function Qz(e,t,r){return t===!0?Ey(e,r):typeof t=="function"?Ey(e,t):e}var $g=h.createContext(null),Zz=e=>e,Mt=()=>{var e=h.useContext($g);return e?e.store.dispatch:Zz},sd=()=>{},Jz=()=>sd,eL=(e,t)=>e===t;function Ee(e){var t=h.useContext($g),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:sd,[t,e]);return iE.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Jz,t?t.store.getState:sd,t?t.store.getState:sd,r,eL)}function tL(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rL(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nL(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 Ay=e=>Array.isArray(e)?e:[e];function aL(e){const t=Array.isArray(e[0])?e[0]:e;return nL(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function sL(e,t){const r=[],{length:n}=e;for(let s=0;s<n;s++)r.push(e[s].apply(null,t));return r}var iL=class{constructor(e){this.value=e}deref(){return this.value}},oL=typeof WeakRef<"u"?WeakRef:iL,lL=0,Dy=1;function Rc(){return{s:lL,v:void 0,o:null,p:null}}function wS(e,t={}){let r=Rc();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 g=arguments[m];if(typeof g=="function"||typeof g=="object"&&g!==null){let x=l.o;x===null&&(l.o=x=new WeakMap);const v=x.get(g);v===void 0?(l=Rc(),x.set(g,l)):l=v}else{let x=l.p;x===null&&(l.p=x=new Map);const v=x.get(g);v===void 0?(l=Rc(),x.set(g,l)):l=v}}const d=l;let u;if(l.s===Dy)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 oL(u):u}return d.s=Dy,d.v=u,u}return o.clearCache=()=>{r=Rc(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function cL(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()),tL(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:p=wS,argsMemoizeOptions:g=[]}=u,x=Ay(m),v=Ay(g),y=aL(s),w=f(function(){return i++,d.apply(null,arguments)},...x),N=p(function(){o++;const k=sL(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 Y=cL(wS),dL=Object.assign((e,t=Y)=>{rL(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:()=>dL}),jS={},NS={},kS={};(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})(kS);var SS={},zg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(zg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zg,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})(SS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kS,r=SS,n=sf;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,g)=>{let x=p;for(let v=0;v<g.length&&x!=null;++v)x=x[g[v]];return x},u=(p,g)=>g==null||p==null?g:typeof p=="object"&&"key"in p?Object.hasOwn(g,p.key)?g[p.key]:d(g,p.path):typeof p=="function"?p(g):Array.isArray(p)?d(g,p):typeof g=="object"?g[p]:g,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(g=>u(g,p))})).slice().sort((p,g)=>{for(let x=0;x<f.length;x++){const v=t.compareValues(p.criteria[x],g.criteria[x],l[x]);if(v!==0)return v}return 0}).map(p=>p.original)}e.orderBy=s})(NS);var CS={};(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})(CS);var Lg={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rg,r=of,n=Eg,s=Dg;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})(Lg);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=NS,r=CS,n=Lg;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})(jS);var uL=jS.sortBy;const cf=Oa(uL);var _S=e=>e.legend.settings,fL=e=>e.legend.size,mL=e=>e.legend.payload;Y([mL,_S],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?cf(n,r):n});var $c=1;function hL(){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)>$c||Math.abs(o.left-t.left)>$c||Math.abs(o.top-t.top)>$c||Math.abs(o.width-t.width)>$c)&&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 nr(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 pL=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ty=pL,Im=()=>Math.random().toString(36).substring(7).split("").join("."),gL={INIT:`@@redux/INIT${Im()}`,REPLACE:`@@redux/REPLACE${Im()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Im()}`},wd=gL;function Fg(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 OS(e,t,r){if(typeof e!="function")throw new Error(nr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(nr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(nr(1));return r(OS)(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(nr(3));return s}function f(v){if(typeof v!="function")throw new Error(nr(4));if(c)throw new Error(nr(5));let y=!0;d();const w=l++;return o.set(w,v),function(){if(y){if(c)throw new Error(nr(6));y=!1,d(),o.delete(w),i=null}}}function m(v){if(!Fg(v))throw new Error(nr(7));if(typeof v.type>"u")throw new Error(nr(8));if(typeof v.type!="string")throw new Error(nr(17));if(c)throw new Error(nr(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(nr(10));n=v,m({type:wd.REPLACE})}function g(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(nr(11));function w(){const j=y;j.next&&j.next(u())}return w(),{unsubscribe:v(w)}},[Ty](){return this}}}return m({type:wd.INIT}),{dispatch:m,subscribe:f,getState:u,replaceReducer:p,[Ty]:g}}function xL(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:wd.INIT})>"u")throw new Error(nr(12));if(typeof r(void 0,{type:wd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(nr(13))})}function PS(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{xL(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],g=m(p,l);if(typeof g>"u")throw l&&l.type,new Error(nr(14));d[f]=g,c=c||g!==p}return c=c||n.length!==Object.keys(o).length,c?d:o}}function jd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function vL(...e){return t=>(r,n)=>{const s=t(r,n);let i=()=>{throw new Error(nr(15))};const o={getState:s.getState,dispatch:(c,...d)=>i(c,...d)},l=e.map(c=>c(o));return i=jd(...l)(s.dispatch),{...s,dispatch:i}}}function MS(e){return Fg(e)&&"type"in e&&typeof e.type=="string"}var ES=Symbol.for("immer-nothing"),Iy=Symbol.for("immer-draftable"),Cr=Symbol.for("immer-state");function vn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Hr=Object,Ui=Hr.getPrototypeOf,Nd="constructor",df="prototype",Mh="configurable",kd="enumerable",id="writable",ml="value",wa=e=>!!e&&!!e[Cr];function Cn(e){var t;return e?AS(e)||ff(e)||!!e[Iy]||!!((t=e[Nd])!=null&&t[Iy])||mf(e)||hf(e):!1}var yL=Hr[df][Nd].toString(),Ry=new WeakMap;function AS(e){if(!e||!Bg(e))return!1;const t=Ui(e);if(t===null||t===Hr[df])return!0;const r=Hr.hasOwnProperty.call(t,Nd)&&t[Nd];if(r===Object)return!0;if(!ki(r))return!1;let n=Ry.get(r);return n===void 0&&(n=Function.toString.call(r),Ry.set(r,n)),n===yL}function uf(e,t,r=!0){ac(e)===0?(r?Reflect.ownKeys(e):Hr.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((n,s)=>t(s,n,e))}function ac(e){const t=e[Cr];return t?t.type_:ff(e)?1:mf(e)?2:hf(e)?3:0}var $y=(e,t,r=ac(e))=>r===2?e.has(t):Hr[df].hasOwnProperty.call(e,t),Eh=(e,t,r=ac(e))=>r===2?e.get(t):e[t],Sd=(e,t,r,n=ac(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function bL(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ff=Array.isArray,mf=e=>e instanceof Map,hf=e=>e instanceof Set,Bg=e=>typeof e=="object",ki=e=>typeof e=="function",Rm=e=>typeof e=="boolean";function wL(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var la=e=>e.copy_||e.base_,Wg=e=>e.modified_?e.copy_:e.base_;function Ah(e,t){if(mf(e))return new Map(e);if(hf(e))return new Set(e);if(ff(e))return Array[df].slice.call(e);const r=AS(e);if(t===!0||t==="class_only"&&!r){const n=Hr.getOwnPropertyDescriptors(e);delete n[Cr];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){const o=s[i],l=n[o];l[id]===!1&&(l[id]=!0,l[Mh]=!0),(l.get||l.set)&&(n[o]={[Mh]:!0,[id]:!0,[kd]:l[kd],[ml]:e[o]})}return Hr.create(Ui(e),n)}else{const n=Ui(e);if(n!==null&&r)return{...e};const s=Hr.create(n);return Hr.assign(s,e)}}function Ug(e,t=!1){return pf(e)||wa(e)||!Cn(e)||(ac(e)>1&&Hr.defineProperties(e,{set:zc,add:zc,clear:zc,delete:zc}),Hr.freeze(e),t&&uf(e,(r,n)=>{Ug(n,!0)},!1)),e}function jL(){vn(2)}var zc={[ml]:jL};function pf(e){return e===null||!Bg(e)?!0:Hr.isFrozen(e)}var Cd="MapSet",Dh="Patches",zy="ArrayMethods",DS={};function Js(e){const t=DS[e];return t||vn(0,e),t}var Ly=e=>!!DS[e],hl,TS=()=>hl,NL=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ly(Cd)?Js(Cd):void 0,arrayMethodsPlugin_:Ly(zy)?Js(zy):void 0});function Fy(e,t){t&&(e.patchPlugin_=Js(Dh),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Th(e){Ih(e),e.drafts_.forEach(kL),e.drafts_=null}function Ih(e){e===hl&&(hl=e.parent_)}var By=e=>hl=NL(hl,e);function kL(e){const t=e[Cr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Wy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Cr].modified_&&(Th(t),vn(4)),Cn(e)&&(e=Uy(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[Cr].base_,e,t)}else e=Uy(t,r);return SL(t,e,!0),Th(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ES?e:void 0}function Uy(e,t){if(pf(t))return t;const r=t[Cr];if(!r)return _d(t,e.handledSet_,e);if(!gf(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);$S(r,e)}return r.copy_}function SL(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ug(t,r)}function IS(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gf=(e,t)=>e.scope_===t,CL=[];function RS(e,t,r,n){const s=la(e),i=e.type_;if(n!==void 0&&Eh(s,n,i)===t){Sd(s,n,r,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;uf(s,(c,d)=>{if(wa(d)){const u=l.get(d)||[];u.push(c),l.set(d,u)}})}const o=e.draftLocations_.get(t)??CL;for(const l of o)Sd(s,l,r,i)}function _L(e,t,r){e.callbacks_.push(function(s){var l;const i=t;if(!i||!gf(i,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(i);const o=Wg(i);RS(e,i.draft_??i,o,r),$S(i,s)})}function $S(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)}IS(e)}}function OL(e,t,r){const{scope_:n}=e;if(wa(r)){const s=r[Cr];gf(s,n)&&s.callbacks_.push(function(){od(e);const o=Wg(s);RS(e,r,o,t)})}else Cn(r)&&e.callbacks_.push(function(){const i=la(e);e.type_===3?i.has(r)&&_d(r,n.handledSet_,n):Eh(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&_d(Eh(e.copy_,t,e.type_),n.handledSet_,n)})}function _d(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||wa(e)||t.has(e)||!Cn(e)||pf(e)||(t.add(e),uf(e,(n,s)=>{if(wa(s)){const i=s[Cr];if(gf(i,r)){const o=Wg(i);Sd(e,n,o,e.type_),IS(i)}}else Cn(s)&&_d(s,t,r)})),e}function PL(e,t){const r=ff(e),n={type_:r?1:0,scope_:t?t.scope_:TS(),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=Od;r&&(s=[n],i=pl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,[l,n]}var Od={get(e,t){if(t===Cr)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=la(e);if(!$y(s,t,e.type_))return ML(e,s,t);const i=s[t];if(e.finalized_||!Cn(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&wL(t))return i;if(i===$m(e.base_,t)){od(e);const o=e.type_===1?+t:t,l=$h(e.scope_,i,e,o);return e.copy_[o]=l}return i},has(e,t){return t in la(e)},ownKeys(e){return Reflect.ownKeys(la(e))},set(e,t,r){const n=zS(la(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=$m(la(e),t),i=s==null?void 0:s[Cr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(bL(r,s)&&(r!==void 0||$y(e.base_,t,e.type_)))return!0;od(e),Rh(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),OL(e,t,r)),!0},deleteProperty(e,t){return od(e),$m(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Rh(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=la(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[id]:!0,[Mh]:e.type_!==1||t!=="length",[kd]:n[kd],[ml]:r[t]}},defineProperty(){vn(11)},getPrototypeOf(e){return Ui(e.base_)},setPrototypeOf(){vn(12)}},pl={};for(let e in Od){let t=Od[e];pl[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}pl.deleteProperty=function(e,t){return pl.set.call(this,e,t,void 0)};pl.set=function(e,t,r){return Od.set.call(this,e[0],t,r,e[0])};function $m(e,t){const r=e[Cr];return(r?la(r):e)[t]}function ML(e,t,r){var s;const n=zS(t,r);return n?ml in n?n[ml]:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function zS(e,t){if(!(t in e))return;let r=Ui(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ui(r)}}function Rh(e){e.modified_||(e.modified_=!0,e.parent_&&Rh(e.parent_))}function od(e){e.copy_||(e.assigned_=new Map,e.copy_=Ah(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var EL=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,s)=>{if(ki(r)&&!ki(n)){const o=n;n=r;const l=this;return function(d=o,...u){return l.produce(d,f=>n.call(this,f,...u))}}ki(n)||vn(6),s!==void 0&&!ki(s)&&vn(7);let i;if(Cn(r)){const o=By(this),l=$h(o,r,void 0);let c=!0;try{i=n(l),c=!1}finally{c?Th(o):Ih(o)}return Fy(o,s),Wy(i,o)}else if(!r||!Bg(r)){if(i=n(r),i===void 0&&(i=r),i===ES&&(i=void 0),this.autoFreeze_&&Ug(i,!0),s){const o=[],l=[];Js(Dh).generateReplacementPatches_(r,i,{patches_:o,inversePatches_:l}),s(o,l)}return i}else vn(1,r)},this.produceWithPatches=(r,n)=>{if(ki(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]},Rm(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Rm(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Rm(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Cn(t)||vn(8),wa(t)&&(t=Nn(t));const r=By(this),n=$h(r,t,void 0);return n[Cr].isManual_=!0,Ih(r),n}finishDraft(t,r){const n=t&&t[Cr];(!n||!n.isManual_)&&vn(9);const{scope_:s}=n;return Fy(s,r),Wy(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=Js(Dh).applyPatches_;return wa(t)?s(t,r):this.produce(t,i=>s(i,r))}};function $h(e,t,r,n){const[s,i]=mf(t)?Js(Cd).proxyMap_(t,r):hf(t)?Js(Cd).proxySet_(t,r):PL(t,r);return((r==null?void 0:r.scope_)??TS()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?_L(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 Nn(e){return wa(e)||vn(10,e),LS(e)}function LS(e){if(!Cn(e)||pf(e))return e;const t=e[Cr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ah(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ah(e,!0);return uf(r,(s,i)=>{Sd(r,s,LS(i))},n),t&&(t.finalized_=!1),r}var AL=new EL,FS=AL.produce;function BS(e){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,e):s(i)}var DL=BS(),TL=BS,IL=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jd:jd.apply(null,arguments)};function cn(e,t){function r(...n){if(t){let s=t(...n);if(!s)throw new Error(Kr(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=>MS(n)&&n.type===e,r}var WS=class Jo extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Jo.prototype)}static get[Symbol.species](){return Jo}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Jo(...t[0].concat(this)):new Jo(...t.concat(this))}};function qy(e){return Cn(e)?FS(e,()=>{}):e}function Lc(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function RL(e){return typeof e=="boolean"}var $L=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new WS;return r&&(RL(r)?o.push(DL):o.push(TL(r.extraArgument))),o},US="RTK_autoBatch",ht=()=>e=>({payload:e,meta:{[US]:!0}}),Hy=e=>t=>{setTimeout(t,e)},qS=(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:Hy(10):e.type==="callback"?e.queueNotification:Hy(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[US]),i=!s,i&&(o||(o=!0,c(d))),n.dispatch(u)}finally{s=!0}}})},zL=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new WS(e);return n&&s.push(qS(typeof n=="object"?n:void 0)),s};function LL(e){const t=$L(),{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(Fg(r))l=PS(r);else throw new Error(Kr(1));let c;typeof n=="function"?c=n(t):c=t();let d=jd;s&&(d=IL({trace:!1,...typeof s=="object"&&s}));const u=vL(...c),f=zL(u);let m=typeof o=="function"?o(f):f();const p=d(...m);return OS(l,i,p)}function HS(e){const t={},r=[];let n;const s={addCase(i,o){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(Kr(28));if(l in t)throw new Error(Kr(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 FL(e){return typeof e=="function"}function BL(e,t){let[r,n,s]=HS(t),i;if(FL(e))i=()=>qy(e());else{const l=qy(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(wa(u)){const p=f(u,c);return p===void 0?u:p}else{if(Cn(u))return FS(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 WL="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",UL=(e=21)=>{let t="",r=e;for(;r--;)t+=WL[Math.random()*64|0];return t},qL=Symbol.for("rtk-slice-createasyncthunk");function HL(e,t){return`${e}/${t}`}function KL({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[qL];return function(s){const{name:i,reducerPath:o=i}=s;if(!i)throw new Error(Kr(11));const l=(typeof s.reducers=="function"?s.reducers(GL()):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(Kr(12));if(b in d.sliceCaseReducersByType)throw new Error(Kr(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:HL(i,j),createNotation:typeof s.reducers=="function"};XL(k)?ZL(b,k,u,t):VL(b,k,u)});function f(){const[j={},k=[],b=void 0]=typeof s.extraReducers=="function"?HS(s.extraReducers):[s.extraReducers],C={...j,...d.sliceCaseReducersByType};return BL(s.initialState,S=>{for(let _ in C)S.addCase(_,C[_]);for(let _ of d.sliceMatchers)S.addMatcher(_.matcher,_.reducer);for(let _ of k)S.addMatcher(_.matcher,_.reducer);b&&S.addDefaultCase(b)})}const m=j=>j,p=new Map,g=new WeakMap;let x;function v(j,k){return x||(x=f()),x(j,k)}function y(){return x||(x=f()),x.getInitialState()}function w(j,k=!1){function b(S){let _=S[j];return typeof _>"u"&&k&&(_=Lc(g,b,y)),_}function C(S=m){const _=Lc(p,k,()=>new WeakMap);return Lc(_,S,()=>{const A={};for(const[M,P]of Object.entries(s.selectors??{}))A[M]=YL(P,S,()=>Lc(g,S,y),k);return A})}return{reducerPath:j,getSelectors:C,get selectors(){return C(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 C=k??o;return j.inject({reducerPath:C,reducer:v},b),{...N,...w(C,!0)}}};return N}}function YL(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 Fr=KL();function GL(){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 VL({type:e,reducerName:t,createNotation:r},n,s){let i,o;if("reducer"in n){if(r&&!QL(n))throw new Error(Kr(17));i=n.reducer,o=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,o?cn(e,o):cn(e))}function XL(e){return e._reducerDefinitionType==="asyncThunk"}function QL(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ZL({type:e,reducerName:t},r,n,s){if(!s)throw new Error(Kr(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||Fc,pending:l||Fc,rejected:c||Fc,settled:d||Fc})}function Fc(){}var JL="task",KS="listener",YS="completed",qg="cancelled",eF=`task-${qg}`,tF=`task-${YS}`,zh=`${KS}-${qg}`,rF=`${KS}-${YS}`,xf=class{constructor(e){am(this,"name","TaskAbortError");am(this,"message");this.code=e,this.message=`${JL} ${qg} (reason: ${e})`}},Hg=(e,t)=>{if(typeof e!="function")throw new TypeError(Kr(32))},Pd=()=>{},GS=(e,t=Pd)=>(e.catch(t),e),VS=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Rs=e=>{if(e.aborted)throw new xf(e.reason)};function XS(e,t){let r=Pd;return new Promise((n,s)=>{const i=()=>s(new xf(e.reason));if(e.aborted){i();return}r=VS(e,i),t.finally(()=>r()).then(n,s)}).finally(()=>{r=Pd})}var nF=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof xf?"cancelled":"rejected",error:r}}finally{t==null||t()}},Md=e=>t=>GS(XS(e,t).then(r=>(Rs(e),r))),QS=e=>{const t=Md(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Ai}=Object,Ky={},vf="listenerMiddleware",aF=(e,t)=>{const r=n=>VS(e,()=>n.abort(e.reason));return(n,s)=>{Hg(n);const i=new AbortController;r(i);const o=nF(async()=>{Rs(e),Rs(i.signal);const l=await n({pause:Md(i.signal),delay:QS(i.signal),signal:i.signal});return Rs(i.signal),l},()=>i.abort(tF));return s!=null&&s.autoJoin&&t.push(o.catch(Pd)),{result:Md(e)(o),cancel(){i.abort(eF)}}}},sF=(e,t)=>{const r=async(n,s)=>{Rs(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 XS(t,Promise.race(l));return Rs(t),c}finally{i()}};return(n,s)=>GS(r(n,s))},ZS=e=>{let{type:t,actionCreator:r,matcher:n,predicate:s,effect:i}=e;if(t)s=cn(t).match;else if(r)t=r.type,s=r.match;else if(n)s=n;else if(!s)throw new Error(Kr(21));return Hg(i),{predicate:s,type:t,effect:i}},JS=Ai(e=>{const{type:t,predicate:r,effect:n}=ZS(e);return{id:UL(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Kr(22))}}},{withTypes:()=>JS}),Yy=(e,t)=>{const{type:r,effect:n,predicate:s}=ZS(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===n)},Lh=e=>{e.pending.forEach(t=>{t.abort(zh)})},iF=(e,t)=>()=>{for(const r of t.keys())Lh(r);e.clear()},Gy=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},e2=Ai(cn(`${vf}/add`),{withTypes:()=>e2}),oF=cn(`${vf}/removeAll`),t2=Ai(cn(`${vf}/remove`),{withTypes:()=>t2}),lF=(...e)=>{console.error(`${vf}/error`,...e)},sc=(e={})=>{const t=new Map,r=new Map,n=p=>{const g=r.get(p)??0;r.set(p,g+1)},s=p=>{const g=r.get(p)??1;g===1?r.delete(p):r.set(p,g-1)},{extra:i,onError:o=lF}=e;Hg(o);const l=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),g=>{p.unsubscribe(),g!=null&&g.cancelActive&&Lh(p)}),c=p=>{const g=Yy(t,p)??JS(p);return l(g)};Ai(c,{withTypes:()=>c});const d=p=>{const g=Yy(t,p);return g&&(g.unsubscribe(),p.cancelActive&&Lh(g)),!!g};Ai(d,{withTypes:()=>d});const u=async(p,g,x,v)=>{const y=new AbortController,w=sF(c,y.signal),N=[];try{p.pending.add(y),n(p),await Promise.resolve(p.effect(g,Ai({},x,{getOriginalState:v,condition:(j,k)=>w(j,k).then(Boolean),take:w,delay:QS(y.signal),pause:Md(y.signal),extra:i,signal:y.signal,fork:aF(y.signal,N),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((j,k,b)=>{j!==y&&(j.abort(zh),b.delete(j))})},cancel:()=>{y.abort(zh),p.pending.delete(y)},throwIfCancelled:()=>{Rs(y.signal)}})))}catch(j){j instanceof xf||Gy(o,j,{raisedBy:"effect"})}finally{await Promise.all(N),y.abort(rF),s(p),p.pending.delete(y)}},f=iF(t,r);return{middleware:p=>g=>x=>{if(!MS(x))return g(x);if(e2.match(x))return c(x.payload);if(oF.match(x)){f();return}if(t2.match(x))return d(x.payload);let v=p.getState();const y=()=>{if(v===Ky)throw new Error(Kr(23));return v};let w;try{if(w=g(x),t.size>0){const N=p.getState(),j=Array.from(t.values());for(const k of j){let b=!1;try{b=k.predicate(x,N,v)}catch(C){b=!1,Gy(o,C,{raisedBy:"predicate"})}b&&u(k,x,p,y)}}}finally{v=Ky}return w},startListening:c,stopListening:d,clearListeners:f}};function Kr(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 cF={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},r2=Fr({name:"chartLayout",initialState:cF,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:dF,setLayout:uF,setChartSize:fF,setScale:mF}=r2.actions,hF=r2.reducer;function n2(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function qe(e){return Number.isFinite(e)}function Yn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Vy(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 Ci(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vy(Object(r),!0).forEach(function(n){pF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pF(e,t,r){return(t=gF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gF(e){var t=xF(e,"string");return typeof t=="symbol"?t:t+""}function xF(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 lr(e,t,r){return Gt(e)||Gt(t)?r:Kn(t)?Wi(e,t,r):typeof t=="function"?t(e):r}var vF=(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"&&ke(e[i]))return Ci(Ci({},e),{},{[i]:e[i]+(n||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&o!=="middle"&&ke(e[o]))return Ci(Ci({},e),{},{[o]:e[o]+(s||0)})}return e},us=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",a2=(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},s2=(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 g=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,x=s==="category"&&o.bandwidth?o.bandwidth()/g:0;if(x=p==="angleAxis"&&i&&i.length>=2?Ar(i[0]-i[1])*2*x:x,f||m){var v=(f||m||[]).map((y,w)=>{var N=n?n.indexOf(y):y,j=o.map(N);return qe(j)?{coordinate:j+x,value:y,offset:x,index:w}:null}).filter(Dr);return v}return c&&d?d.map((y,w)=>{var N=o.map(y);return qe(N)?{coordinate:N+x,value:y,index:w,offset:x}:null}).filter(Dr):o.ticks&&u!=null?o.ticks(u).map((y,w)=>{var N=o.map(y);return qe(N)?{coordinate:N+x,value:y,index:w,offset:x}:null}).filter(Dr):o.domain().map((y,w)=>{var N=o.map(y);return qe(N)?{coordinate:N+x,value:n?n[y]:y,index:w,offset:x}:null}).filter(Dr)},yF=(e,t)=>{if(!t||t.length!==2||!ke(t[0])||!ke(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(!ke(e[0])||e[0]<r)&&(s[0]=r),(!ke(e[1])||e[1]>n)&&(s[1]=n),s[0]>n&&(s[0]=n),s[1]<r&&(s[1]=r),s},bF=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=Hn(u)?f:u;m>=0?(d[0]=i,i+=m,d[1]=i):(d[0]=o,o+=m,d[1]=o)}}}},wF=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=Hn(c[1])?c[0]:c[1];d>=0?(c[0]=i,i+=d,c[1]=i):(c[0]=0,c[1]=0)}}}},jF={sign:bF,expand:_z,none:Qs,silhouette:Oz,wiggle:Pz,positive:wF},NF=(e,t,r)=>{var n,s=(n=jF[r])!==null&&n!==void 0?n:Qs,i=Cz().keys(t).value((l,c)=>Number(lr(l,c,0))).order(Oh).offset(s),o=i(e);return o.forEach((l,c)=>{l.forEach((d,u)=>{var f=lr(e[u],t[c],0);Array.isArray(f)&&f.length===2&&ke(f[0])&&ke(f[1])&&(d[0]=f[0],d[1]=f[1])})}),o};function kF(e){return e==null?void 0:String(e)}var Xy=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=lr(i,t.dataKey,t.scale.domain()[o]);if(Gt(l))return null;var c=t.scale.map(l);return ke(c)?c-s/2+n:null},SF=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]},CF=e=>{var t=e.flat(2).filter(ke);return[Math.min(...t),Math.max(...t)]},_F=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],OF=(e,t,r)=>{if(e!=null)return _F(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=n2(d,t,r),f=CF(u);return!qe(f[0])||!qe(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]))},Qy=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zy=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ed=(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=cf(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 Jy(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:s,name:i}=e;return Ci(Ci({},t),{},{dataKey:r,payload:n,value:s,name:i})}function i2(e,t){if(e)return String(e);if(typeof t=="string")return t}var PF=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},MF=(e,t)=>t==="centric"?e.angle:e.radius,Ia=e=>e.layout.width,Ra=e=>e.layout.height,EF=e=>e.layout.scale,o2=e=>e.layout.margin,yf=Y(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),bf=Y(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),AF="data-recharts-item-index",DF="data-recharts-item-id",ic=60;function eb(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 Bc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eb(Object(r),!0).forEach(function(n){TF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TF(e,t,r){return(t=IF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IF(e){var t=RF(e,"string");return typeof t=="symbol"?t:t+""}function RF(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 $F=e=>e.brush.height;function zF(e){var t=bf(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:ic;return r+s}return r},0)}function LF(e){var t=bf(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var s=typeof n.width=="number"?n.width:ic;return r+s}return r},0)}function FF(e){var t=yf(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function BF(e){var t=yf(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Xt=Y([Ia,Ra,o2,$F,zF,LF,FF,BF,_S,fL],(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=Bc(Bc({},f),u),p=m.bottom;m.bottom+=n,m=vF(m,c,d);var g=e-m.left-m.right,x=t-m.top-m.bottom;return Bc(Bc({brushBottom:p},m),{},{width:Math.max(g,0),height:Math.max(x,0)})}),WF=Y(Xt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Kg=Y(Ia,Ra,(e,t)=>({x:0,y:0,width:e,height:t})),UF=h.createContext(null),Br=()=>h.useContext(UF)!=null,wf=e=>e.brush,jf=Y([wf,Xt,o2],(e,t,r)=>({height:e.height,x:ke(e.x)?e.x:t.left,y:ke(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:ke(e.width)?e.width:t.width})),l2={},c2={},d2={};(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(),x()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},n)},g=()=>{m!==null&&(clearTimeout(m),m=null)},x=()=>{g(),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=x,y.flush=v,s==null||s.addEventListener("abort",x,{once:!0}),y}e.debounce=t})(d2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d2;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(...x){u=n.apply(this,x),f=null},s,{edges:d}),p=function(...x){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,x),f=Date.now(),m.cancel(),m.schedule(),u):(m.apply(this,x),u)},g=()=>(m.flush(),u);return p.cancel=m.cancel,p.flush=g,p}e.debounce=r})(c2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c2;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})(l2);var qF=l2.throttle;const HF=Oa(qF);var Ad=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++]))}},Bn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},u2=(e,t,r)=>{var{width:n=Bn.width,height:s=Bn.height,aspect:i,maxHeight:o}=r,l=Zs(n)?e:Number(n),c=Zs(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}},KF={width:0,height:0,overflow:"visible"},YF={width:0,overflowX:"visible"},GF={height:0,overflowY:"visible"},VF={},XF=e=>{var{width:t,height:r}=e,n=Zs(t),s=Zs(r);return n&&s?KF:n?YF:s?GF:VF};function QF(e){var{width:t,height:r,aspect:n}=e,s=t,i=r;return s===void 0&&i===void 0?(s=Bn.width,i=Bn.height):s===void 0?s=n&&n>0?void 0:Bn.width:i===void 0&&(i=n&&n>0?void 0:Bn.height),{width:s,height:i}}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 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){ZF(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 ZF(e,t,r){return(t=JF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JF(e){var t=e8(e,"string");return typeof t=="symbol"?t:t+""}function e8(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 f2=h.createContext(Bn.initialDimension);function t8(e){return Yn(e.width)&&Yn(e.height)}function m2(e){var{children:t,width:r,height:n}=e,s=h.useMemo(()=>({width:r,height:n}),[r,n]);return t8(s)?h.createElement(f2.Provider,{value:s},t):null}var Yg=()=>h.useContext(f2),r8=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=Bn.initialDimension,width:s,height:i,minWidth:o=Bn.minWidth,minHeight:l,maxHeight:c,children:d,debounce:u=Bn.debounce,id:f,className:m,onResize:p,style:g={}}=e,x=h.useRef(null),v=h.useRef();v.current=p,h.useImperativeHandle(t,()=>x.current);var[y,w]=h.useState({containerWidth:n.width,containerHeight:n.height}),N=h.useCallback((S,_)=>{w(A=>{var M=Math.round(S),P=Math.round(_);return A.containerWidth===M&&A.containerHeight===P?A:{containerWidth:M,containerHeight:P}})},[]);h.useEffect(()=>{if(x.current==null||typeof ResizeObserver>"u")return po;var S=P=>{var T,D=P[0];if(D!=null){var{width:B,height:E}=D.contentRect;N(B,E),(T=v.current)===null||T===void 0||T.call(v,B,E)}};u>0&&(S=HF(S,u,{trailing:!0,leading:!1}));var _=new ResizeObserver(S),{width:A,height:M}=x.current.getBoundingClientRect();return N(A,M),_.observe(x.current),()=>{_.disconnect()}},[N,u]);var{containerWidth:j,containerHeight:k}=y;Ad(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:b,calculatedHeight:C}=u2(j,k,{width:s,height:i,aspect:r,maxHeight:c});return Ad(b!=null&&b>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
548
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
549
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
550
|
-
height and width.`,b,C,s,i,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:st("recharts-responsive-container",m),style:rb(rb({},g),{},{width:s,height:i,minWidth:o,minHeight:l,maxHeight:c}),ref:x},h.createElement("div",{style:XF({width:s,height:i})},h.createElement(m2,{width:b,height:C},d)))}),Dd=h.forwardRef((e,t)=>{var r=Yg();if(Yn(r.width)&&Yn(r.height))return e.children;var{width:n,height:s}=QF({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:o}=u2(void 0,void 0,{width:n,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return ke(i)&&ke(o)?h.createElement(m2,{width:i,height:o},e.children):h.createElement(r8,Fh({},e,{width:n,height:s,ref:t}))});function Gg(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 Nf=()=>{var e,t=Br(),r=Ee(WF),n=Ee(jf),s=(e=Ee(wf))===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}},n8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},h2=()=>{var e;return(e=Ee(Xt))!==null&&e!==void 0?e:n8},p2=()=>Ee(Ia),g2=()=>Ee(Ra),it=e=>e.layout.layoutType,go=()=>Ee(it),x2=()=>{var e=go();if(e==="horizontal"||e==="vertical")return e},v2=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},a8=()=>{var e=go();return e!==void 0},oc=e=>{var t=Mt(),r=Br(),{width:n,height:s}=e,i=Yg(),o=n,l=s;return i&&(o=i.width>0?i.width:n,l=i.height>0?i.height:s),h.useEffect(()=>{!r&&Yn(o)&&Yn(l)&&t(fF({width:o,height:l}))},[t,r,o,l]),null},y2=Symbol.for("immer-nothing"),nb=Symbol.for("immer-draftable"),Vr=Symbol.for("immer-state");function yn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var gl=Object.getPrototypeOf;function qi(e){return!!e&&!!e[Vr]}function ei(e){var t;return e?b2(e)||Array.isArray(e)||!!e[nb]||!!((t=e.constructor)!=null&&t[nb])||lc(e)||Sf(e):!1}var s8=Object.prototype.constructor.toString(),ab=new WeakMap;function b2(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=ab.get(r);return n===void 0&&(n=Function.toString.call(r),ab.set(r,n)),n===s8}function Td(e,t,r=!0){kf(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 kf(e){const t=e[Vr];return t?t.type_:Array.isArray(e)?1:lc(e)?2:Sf(e)?3:0}function Bh(e,t){return kf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function w2(e,t,r){const n=kf(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function i8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function lc(e){return e instanceof Map}function Sf(e){return e instanceof Set}function ws(e){return e.copy_||e.base_}function Wh(e,t){if(lc(e))return new Map(e);if(Sf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=b2(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Vr];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(gl(e),n)}else{const n=gl(e);if(n!==null&&r)return{...e};const s=Object.create(n);return Object.assign(s,e)}}function Vg(e,t=!1){return Cf(e)||qi(e)||!ei(e)||(kf(e)>1&&Object.defineProperties(e,{set:Wc,add:Wc,clear:Wc,delete:Wc}),Object.freeze(e),t&&Object.values(e).forEach(r=>Vg(r,!0))),e}function o8(){yn(2)}var Wc={value:o8};function Cf(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var l8={};function ti(e){const t=l8[e];return t||yn(0,e),t}var xl;function j2(){return xl}function c8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function sb(e,t){t&&(ti("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Uh(e){qh(e),e.drafts_.forEach(d8),e.drafts_=null}function qh(e){e===xl&&(xl=e.parent_)}function ib(e){return xl=c8(xl,e)}function d8(e){const t=e[Vr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ob(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Vr].modified_&&(Uh(t),yn(4)),ei(e)&&(e=Id(t,e),t.parent_||Rd(t,e)),t.patches_&&ti("Patches").generateReplacementPatches_(r[Vr].base_,e,t.patches_,t.inversePatches_)):e=Id(t,r,[]),Uh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==y2?e:void 0}function Id(e,t,r){if(Cf(t))return t;const n=e.immer_.shouldUseStrictIteration(),s=t[Vr];if(!s)return Td(t,(i,o)=>lb(e,s,t,i,o,r),n),t;if(s.scope_!==e)return t;if(!s.modified_)return Rd(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),Td(o,(c,d)=>lb(e,s,i,c,d,r,l),n),Rd(e,i,!1),r&&e.patches_&&ti("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function lb(e,t,r,n,s,i,o){if(s==null||typeof s!="object"&&!o)return;const l=Cf(s);if(!(l&&!o)){if(qi(s)){const c=i&&t&&t.type_!==3&&!Bh(t.assigned_,n)?i.concat(n):void 0,d=Id(e,s,c);if(w2(r,n,d),qi(d))e.canAutoFreeze_=!1;else return}else o&&r.add(s);if(ei(s)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===s&&l)return;Id(e,s),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(lc(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Rd(e,s)}}}function Rd(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Vg(t,r)}function u8(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:j2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,i=Xg;r&&(s=[n],i=vl);const{revoke:o,proxy:l}=Proxy.revocable(s,i);return n.draft_=l,n.revoke_=o,l}var Xg={get(e,t){if(t===Vr)return e;const r=ws(e);if(!Bh(r,t))return f8(e,r,t);const n=r[t];return e.finalized_||!ei(n)?n:n===zm(e.base_,t)?(Lm(e),e.copy_[t]=Kh(n,e)):n},has(e,t){return t in ws(e)},ownKeys(e){return Reflect.ownKeys(ws(e))},set(e,t,r){const n=N2(ws(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const s=zm(ws(e),t),i=s==null?void 0:s[Vr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(i8(r,s)&&(r!==void 0||Bh(e.base_,t)))return!0;Lm(e),Hh(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 zm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Lm(e),Hh(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ws(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){yn(11)},getPrototypeOf(e){return gl(e.base_)},setPrototypeOf(){yn(12)}},vl={};Td(Xg,(e,t)=>{vl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});vl.deleteProperty=function(e,t){return vl.set.call(this,e,t,void 0)};vl.set=function(e,t,r){return Xg.set.call(this,e[0],t,r,e[0])};function zm(e,t){const r=e[Vr];return(r?ws(r):e)[t]}function f8(e,t,r){var s;const n=N2(t,r);return n?"value"in n?n.value:(s=n.get)==null?void 0:s.call(e.draft_):void 0}function N2(e,t){if(!(t in e))return;let r=gl(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=gl(r)}}function Hh(e){e.modified_||(e.modified_=!0,e.parent_&&Hh(e.parent_))}function Lm(e){e.copy_||(e.copy_=Wh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var m8=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"&&yn(6),n!==void 0&&typeof n!="function"&&yn(7);let s;if(ei(t)){const i=ib(this),o=Kh(t,void 0);let l=!0;try{s=r(o),l=!1}finally{l?Uh(i):qh(i)}return sb(i,n),ob(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===y2&&(s=void 0),this.autoFreeze_&&Vg(s,!0),n){const i=[],o=[];ti("Patches").generateReplacementPatches_(t,s,i,o),n(i,o)}return s}else yn(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){ei(e)||yn(8),qi(e)&&(e=h8(e));const t=ib(this),r=Kh(e,void 0);return r[Vr].isManual_=!0,qh(t),r}finishDraft(e,t){const r=e&&e[Vr];(!r||!r.isManual_)&&yn(9);const{scope_:n}=r;return sb(n,t),ob(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=ti("Patches").applyPatches_;return qi(e)?n(e,t):this.produce(e,s=>n(s,t))}};function Kh(e,t){const r=lc(e)?ti("MapSet").proxyMap_(e,t):Sf(e)?ti("MapSet").proxySet_(e,t):u8(e,t);return(t?t.scope_:j2()).drafts_.push(r),r}function h8(e){return qi(e)||yn(10,e),k2(e)}function k2(e){if(!ei(e)||Cf(e))return e;const t=e[Vr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Wh(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Wh(e,!0);return Td(r,(s,i)=>{w2(r,s,k2(i))},n),t&&(t.finalized_=!1),r}var p8=new m8;p8.produce;var g8={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},S2=Fr({name:"legend",initialState:g8,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:ht()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Nn(e).payload.indexOf(r);s>-1&&(e.payload[s]=n)},prepare:ht()},removeLegendPayload:{reducer(e,t){var r=Nn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:ht()}}}),{setLegendSize:Gee,setLegendSettings:Vee,addLegendPayload:x8,replaceLegendPayload:v8,removeLegendPayload:y8}=S2.actions,b8=S2.reducer;function Yh(){return Yh=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},Yh.apply(null,arguments)}function cb(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 Bo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cb(Object(r),!0).forEach(function(n){w8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w8(e,t,r){return(t=j8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j8(e){var t=N8(e,"string");return typeof t=="symbol"?t:t+""}function N8(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 k8(e){return Array.isArray(e)&&Kn(e[0])&&Kn(e[1])?e.join(" ~ "):e}var vi={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},S8=e=>{var{separator:t=vi.separator,contentStyle:r,itemStyle:n,labelStyle:s=vi.labelStyle,payload:i,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:m=vi.accessibilityLayer}=e,p=()=>{if(i&&i.length){var k={padding:0,margin:0},b=(l?cf(i,l):i).map((C,S)=>{if(C.type==="none")return null;var _=C.formatter||o||k8,{value:A,name:M}=C,P=A,T=M;if(_){var D=_(A,M,C,S,i);if(Array.isArray(D))[P,T]=D;else if(D!=null)P=D;else return null}var B=Bo(Bo({},vi.itemStyle),{},{color:C.color||vi.itemStyle.color},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(S),style:B},Kn(T)?h.createElement("span",{className:"recharts-tooltip-item-name"},T):null,Kn(T)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},P),h.createElement("span",{className:"recharts-tooltip-item-unit"},C.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:k},b)}return null},g=Bo(Bo({},vi.contentStyle),r),x=Bo({margin:0},s),v=!Gt(u),y=v?u:"",w=st("recharts-default-tooltip",c),N=st("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",Yh({className:w,style:g},j),h.createElement("p",{className:N,style:x},h.isValidElement(y)?y:"".concat(y)),p())},Wo="recharts-tooltip-wrapper",C8={visibility:"hidden"};function _8(e){var{coordinate:t,translateX:r,translateY:n}=e;return st(Wo,{["".concat(Wo,"-right")]:ke(r)&&t&&ke(t.x)&&r>=t.x,["".concat(Wo,"-left")]:ke(r)&&t&&ke(t.x)&&r<t.x,["".concat(Wo,"-bottom")]:ke(n)&&t&&ke(t.y)&&n>=t.y,["".concat(Wo,"-top")]:ke(n)&&t&&ke(t.y)&&n<t.y})}function db(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offset:s,position:i,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(i&&ke(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,g=m;return p<g?Math.max(f,m):Math.max(u,m)}if(d==null)return 0;var x=f+l,v=m+d;return x>v?Math.max(u,m):Math.max(f,m)}function O8(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 P8(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=db({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),m=db({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),u=O8({translateX:f,translateY:m,useTranslate3d:c})):u=C8,{cssProperties:u,cssClasses:_8({translateX:f,translateY:m,coordinate:r})}}function ub(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 Uc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ub(Object(r),!0).forEach(function(n){Gh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ub(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gh(e,t,r){return(t=M8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M8(e){var t=E8(e,"string");return typeof t=="symbol"?t:t+""}function E8(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 A8 extends h.PureComponent{constructor(){super(...arguments),Gh(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Gh(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:g,lastBoundingBox:x,innerRef:v,hasPortalFromProps:y}=this.props,w=typeof d=="number"?d:d.x,N=typeof d=="number"?d:d.y,{cssClasses:j,cssProperties:k}=P8({allowEscapeViewBox:r,coordinate:o,offsetLeft:w,offsetTop:N,position:u,reverseDirection:f,tooltipBox:{height:x.height,width:x.width},useTranslate3d:m,viewBox:p}),b=y?{}:Uc(Uc({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}),C=Uc(Uc({},b),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},g);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:C,ref:v},i)}}var C2=()=>{var e;return(e=Ee(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Vh(){return Vh=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},Vh.apply(null,arguments)}function fb(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 mb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fb(Object(r),!0).forEach(function(n){D8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fb(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 hb={curveBasisClosed:pz,curveBasisOpen:gz,curveBasis:hz,curveBumpX:ez,curveBumpY:tz,curveLinearClosed:xz,curveLinear:tf,curveMonotoneX:vz,curveMonotoneY:yz,curveNatural:bz,curveStep:wz,curveStepAfter:Nz,curveStepBefore:jz},$d=e=>qe(e.x)&&qe(e.y),pb=e=>e.base!=null&&$d(e.base)&&$d(e),Uo=e=>e.x,qo=e=>e.y,R8=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(nc(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=hb["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return hb[r]||tf},gb={connectNulls:!1,type:"linear"},$8=e=>{var{type:t=gb.type,points:r=[],baseLine:n,layout:s,connectNulls:i=gb.connectNulls}=e,o=R8(t,s),l=i?r.filter($d):r;if(Array.isArray(n)){var c,d=r.map((g,x)=>mb(mb({},g),{},{base:n[x]}));s==="vertical"?c=Ic().y(qo).x1(Uo).x0(g=>g.base.x):c=Ic().x(Uo).y1(qo).y0(g=>g.base.y);var u=c.defined(pb).curve(o),f=i?d.filter(pb):d;return u(f)}var m;s==="vertical"&&ke(n)?m=Ic().y(qo).x1(Uo).x0(n):ke(n)?m=Ic().x(Uo).y1(qo).y0(n):m=Fk().x(Uo).y(qo);var p=m.defined($d).curve(o);return p(l)},_2=e=>{var{className:t,points:r,path:n,pathRef:s}=e,i=go();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?$8(o):n;return h.createElement("path",Vh({},ya(e),qz(e),{className:st("recharts-curve",t),d:l===null?void 0:l,ref:s}))},z8=["x","y","top","left","width","height","className"];function Xh(){return Xh=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},Xh.apply(null,arguments)}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 L8(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){F8(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 F8(e,t,r){return(t=B8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B8(e){var t=W8(e,"string");return typeof t=="symbol"?t:t+""}function W8(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 U8(e,t){if(e==null)return{};var r,n,s=q8(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 q8(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 H8=(e,t,r,n,s,i)=>"M".concat(e,",").concat(s,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),K8=e=>{var{x:t=0,y:r=0,top:n=0,left:s=0,width:i=0,height:o=0,className:l}=e,c=U8(e,z8),d=L8({x:t,y:r,top:n,left:s,width:i,height:o},c);return!ke(t)||!ke(r)||!ke(i)||!ke(o)||!ke(n)||!ke(s)?null:h.createElement("path",Xh({},ln(d),{className:st("recharts-cross",l),d:H8(t,r,i,o,n,s)}))};function Y8(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 vb(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 yb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vb(Object(r),!0).forEach(function(n){G8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function G8(e,t,r){return(t=V8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function V8(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)}var Q8=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),O2=(e,t,r)=>e.map(n=>"".concat(Q8(n)," ").concat(t,"ms ").concat(r)).join(","),Z8=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(s=>n.includes(s))),yl=(e,t)=>Object.keys(t).reduce((r,n)=>yb(yb({},r),{},{[n]:e(n,t[n])}),{});function bb(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 zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bb(Object(r),!0).forEach(function(n){J8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J8(e,t,r){return(t=eB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eB(e){var t=tB(e,"string");return typeof t=="symbol"?t:t+""}function tB(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 zd=(e,t,r)=>e+(t-e)*r,Qh=e=>{var{from:t,to:r}=e;return t!==r},P2=(e,t,r)=>{var n=yl((s,i)=>{if(Qh(i)){var[o,l]=e(i.from,i.to,i.velocity);return zt(zt({},i),{},{from:o,velocity:l})}return i},t);return r<1?yl((s,i)=>Qh(i)&&n[s]!=null?zt(zt({},i),{},{velocity:zd(i.velocity,n[s].velocity,r),from:zd(i.from,n[s].from,r)}):i,t):P2(e,n,r-1)};function rB(e,t,r,n,s,i){var o,l=n.reduce((m,p)=>zt(zt({},m),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),c=()=>yl((m,p)=>p.from,l),d=()=>!Object.values(l).filter(Qh).length,u=null,f=m=>{o||(o=m);var p=m-o,g=p/r.dt;l=P2(r,l,g),s(zt(zt(zt({},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 nB(e,t,r,n,s,i,o){var l=null,c=s.reduce((f,m)=>{var p=e[m],g=t[m];return p==null||g==null?f:zt(zt({},f),{},{[m]:[p,g]})},{}),d,u=f=>{d||(d=f);var m=(f-d)/n,p=yl((x,v)=>zd(...v,r(m)),c);if(i(zt(zt(zt({},e),t),p)),m<1)l=o.setTimeout(u);else{var g=yl((x,v)=>zd(...v,r(1)),c);i(zt(zt(zt({},e),t),g))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const aB=(e,t,r,n,s,i)=>{var o=Z8(e,t);return r==null?()=>(s(zt(zt({},e),t)),()=>{}):r.isStepper===!0?rB(e,t,r,o,s,i):nB(e,t,r,n,o,s,i)};var Ld=1e-4,M2=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],E2=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),wb=(e,t)=>r=>{var n=M2(e,t);return E2(n,r)},sB=(e,t)=>r=>{var n=M2(e,t),s=[...n.map((i,o)=>i*o).slice(1),0];return E2(s,r)},iB=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]]},oB=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=iB(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},lB=(e,t,r,n)=>{var s=wb(e,r),i=wb(t,n),o=sB(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,g=o(f);if(Math.abs(p-u)<Ld||g<Ld)return i(f);f=l(f-p/g)}return i(f)};return c.isStepper=!1,c},jb=function(){return lB(...oB(...arguments))},cB=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)<Ld&&Math.abs(f)<Ld?[l,0]:[m,f]};return i.isStepper=!0,i.dt=s,i},dB=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return jb(e);case"spring":return cB();default:if(e.split("(")[0]==="cubic-bezier")return jb(e)}return typeof e=="function"?e:null};function uB(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 fB{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 mB(){return uB(new fB)}var hB=h.createContext(mB);function pB(e,t){var r=h.useContext(hB);return h.useMemo(()=>t??r(e),[e,t,r])}var gB=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),_f={isSsr:gB()},xB={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Nb={t:0},Fm={t:1};function Qg(e){var t=Zr(e,xB),{isActive:r,canBegin:n,duration:s,easing:i,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=r==="auto"?!_f.isSsr:r,f=pB(t.animationId,t.animationManager),[m,p]=h.useState(u?Nb:Fm),g=h.useRef(null);return h.useEffect(()=>{u||p(Fm)},[u]),h.useEffect(()=>{if(!u||!n)return po;var x=aB(Nb,Fm,dB(i),s,p,f.getTimeoutController()),v=()=>{g.current=x()};return f.start([c,o,v,s,l]),()=>{f.stop(),g.current&&g.current(),l()}},[u,n,s,i,o,c,l,f]),d(m.t)}function Zg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(fl(t)),n=h.useRef(e);return n.current!==e&&(r.current=fl(t),n.current=e),r.current}var vB=["radius"],yB=["radius"],kb,Sb,Cb,_b,Ob,Pb,Mb,Eb,Ab,Db;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 Ib(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){bB(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 bB(e,t,r){return(t=wB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wB(e){var t=jB(e,"string");return typeof t=="symbol"?t:t+""}function jB(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 Fd(){return Fd=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},Fd.apply(null,arguments)}function Rb(e,t){if(e==null)return{};var r,n,s=NB(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 NB(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 Tn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $b=(e,t,r,n,s)=>{var i=Va(r),o=Va(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,g=4;p<g;p++){var x,v=(x=s[p])!==null&&x!==void 0?x:0;m[p]=v>l?l:v}f=Nt(kb||(kb=Tn(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Nt(Sb||(Sb=Tn(["A ",",",",0,0,",",",",",""])),m[0],m[0],u,e+d*m[0],t)),f+=Nt(Cb||(Cb=Tn(["L ",",",""])),e+r-d*m[1],t),m[1]>0&&(f+=Nt(_b||(_b=Tn(["A ",",",",0,0,",`,
|
|
551
|
-
`,",",""])),m[1],m[1],u,e+r,t+c*m[1])),f+=Nt(Ob||(Ob=Tn(["L ",",",""])),e+r,t+n-c*m[2]),m[2]>0&&(f+=Nt(Pb||(Pb=Tn(["A ",",",",0,0,",`,
|
|
552
|
-
`,",",""])),m[2],m[2],u,e+r-d*m[2],t+n)),f+=Nt(Mb||(Mb=Tn(["L ",",",""])),e+d*m[3],t+n),m[3]>0&&(f+=Nt(Eb||(Eb=Tn(["A ",",",",0,0,",`,
|
|
553
|
-
`,",",""])),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=Nt(Ab||(Ab=Tn(["M ",",",`
|
|
554
|
-
A `,",",",0,0,",",",",",`
|
|
555
|
-
L `,",",`
|
|
556
|
-
A `,",",",0,0,",",",",",`
|
|
557
|
-
L `,",",`
|
|
558
|
-
A `,",",",0,0,",",",",",`
|
|
559
|
-
L `,",",`
|
|
560
|
-
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=Nt(Db||(Db=Tn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},zb={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},A2=e=>{var t=Zr(e,zb),r=h.useRef(null),[n,s]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var z=r.current.getTotalLength();z&&s(z)}catch{}},[]);var{x:i,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:m,animationBegin:p,isAnimationActive:g,isUpdateAnimationActive:x}=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=Zg(j,"rectangle-");if(i!==+i||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var b=st("recharts-rectangle",u);if(!x){var C=ln(t),{radius:S}=C,_=Rb(C,vB);return h.createElement("path",Fd({},_,{x:Va(i),y:Va(o),width:Va(l),height:Va(c),radius:typeof d=="number"?d:void 0,className:b,d:$b(i,o,l,c,d)}))}var A=v.current,M=y.current,P=w.current,T=N.current,D="0px ".concat(n===-1?1:n,"px"),B="".concat(n,"px 0px"),E=O2(["strokeDasharray"],m,typeof f=="string"?f:zb.animationEasing);return h.createElement(Qg,{animationId:k,key:k,canBegin:n>0,duration:m,easing:f,isActive:x,begin:p},z=>{var Q=sr(A,l,z),K=sr(M,c,z),se=sr(P,i,z),te=sr(T,o,z);r.current&&(v.current=Q,y.current=K,w.current=se,N.current=te);var U;g?z>0?U={transition:E,strokeDasharray:B}:U={strokeDasharray:D}:U={strokeDasharray:B};var G=ln(t),{radius:J}=G,X=Rb(G,yB);return h.createElement("path",Fd({},X,{radius:typeof d=="number"?d:void 0,className:b,d:$b(se,te,Q,K,d),ref:r,style:Ib(Ib({},U),t.style)}))})};function Lb(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 Fb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lb(Object(r),!0).forEach(function(n){kB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kB(e,t,r){return(t=SB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SB(e){var t=CB(e,"string");return typeof t=="symbol"?t:t+""}function CB(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 Bd=Math.PI/180,_B=e=>e*180/Math.PI,or=(e,t,r,n)=>({x:e+Math.cos(-Bd*n)*r,y:t+Math.sin(-Bd*n)*r}),OB=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},PB=(e,t)=>{var{x:r,y:n}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(n-i)**2)},MB=(e,t)=>{var{x:r,y:n}=e,{cx:s,cy:i}=t,o=PB({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:_B(c),angleInRadian:c}},EB=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}},AB=(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},DB=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:s,angle:i}=MB({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(s<o||s>l||s===0)return null;var{startAngle:c,endAngle:d}=EB(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?Fb(Fb({},t),{},{radius:s,angle:AB(u,t)}):null};function D2(e){var{cx:t,cy:r,radius:n,startAngle:s,endAngle:i}=e,o=or(t,r,n,s),l=or(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:s,endAngle:i}}var Bb,Wb,Ub,qb,Hb,Kb,Yb;function Zh(){return Zh=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},Zh.apply(null,arguments)}function Ms(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var TB=(e,t)=>{var r=Ar(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},qc=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)/Bd,f=c?s:s+i*u,m=or(t,r,d,f),p=or(t,r,n,f),g=c?s-i*u:s,x=or(t,r,d*Math.cos(u*Bd),g);return{center:m,circleTangency:p,lineTangency:x,theta:u}},T2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:i,endAngle:o}=e,l=TB(i,o),c=i+l,d=or(t,r,s,i),u=or(t,r,s,c),f=Nt(Bb||(Bb=Ms(["M ",",",`
|
|
561
|
-
A `,",",`,0,
|
|
562
|
-
`,",",`,
|
|
563
|
-
`,",",`
|
|
564
|
-
`])),d.x,d.y,s,s,+(Math.abs(l)>180),+(i>c),u.x,u.y);if(n>0){var m=or(t,r,n,i),p=or(t,r,n,c);f+=Nt(Wb||(Wb=Ms(["L ",",",`
|
|
565
|
-
A `,",",`,0,
|
|
566
|
-
`,",",`,
|
|
567
|
-
`,","," Z"])),p.x,p.y,n,n,+(Math.abs(l)>180),+(i<=c),m.x,m.y)}else f+=Nt(Ub||(Ub=Ms(["L ",","," Z"])),t,r);return f},IB=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:s,cornerRadius:i,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Ar(d-c),{circleTangency:f,lineTangency:m,theta:p}=qc({cx:t,cy:r,radius:s,angle:c,sign:u,cornerRadius:i,cornerIsExternal:l}),{circleTangency:g,lineTangency:x,theta:v}=qc({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?Nt(qb||(qb=Ms(["M ",",",`
|
|
568
|
-
a`,",",",0,0,1,",`,0
|
|
569
|
-
a`,",",",0,0,1,",`,0
|
|
570
|
-
`])),m.x,m.y,i,i,i*2,i,i,-i*2):T2({cx:t,cy:r,innerRadius:n,outerRadius:s,startAngle:c,endAngle:d});var w=Nt(Hb||(Hb=Ms(["M ",",",`
|
|
571
|
-
A`,",",",0,0,",",",",",`
|
|
572
|
-
A`,",",",0,",",",",",",",`
|
|
573
|
-
A`,",",",0,0,",",",",",`
|
|
574
|
-
`])),m.x,m.y,i,i,+(u<0),f.x,f.y,s,s,+(y>180),+(u<0),g.x,g.y,i,i,+(u<0),x.x,x.y);if(n>0){var{circleTangency:N,lineTangency:j,theta:k}=qc({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:b,lineTangency:C,theta:S}=qc({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),_=l?Math.abs(c-d):Math.abs(c-d)-k-S;if(_<0&&i===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=Nt(Kb||(Kb=Ms(["L",",",`
|
|
575
|
-
A`,",",",0,0,",",",",",`
|
|
576
|
-
A`,",",",0,",",",",",",",`
|
|
577
|
-
A`,",",",0,0,",",",",","Z"])),C.x,C.y,i,i,+(u<0),b.x,b.y,n,n,+(_>180),+(u>0),N.x,N.y,i,i,+(u<0),j.x,j.y)}else w+=Nt(Yb||(Yb=Ms(["L",",","Z"])),t,r);return w},RB={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},I2=e=>{var t=Zr(e,RB),{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=st("recharts-sector",f),p=i-s,g=Sn(o,p,0,!0),x;return g>0&&Math.abs(d-u)<360?x=IB({cx:r,cy:n,innerRadius:s,outerRadius:i,cornerRadius:Math.min(g,p/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):x=T2({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:d,endAngle:u}),h.createElement("path",Zh({},ln(t),{className:m,d:x}))};function $B(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(rS(t)){if(e==="centric"){var{cx:n,cy:s,innerRadius:i,outerRadius:o,angle:l}=t,c=or(n,s,i,l),d=or(n,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return D2(t)}}var R2={},$2={},z2={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zg;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(z2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=z2;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})($2);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lg,r=$2;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})(R2);var zB=R2.range;const L2=Oa(zB);function es(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function LB(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Jg(e){let t,r,n;e.length!==2?(t=es,r=(l,c)=>es(e(l),c),n=(l,c)=>e(l)-c):(t=e===es||e===LB?e:FB,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 FB(){return 0}function F2(e){return e===null?NaN:+e}function*BB(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const WB=Jg(es),cc=WB.right;Jg(F2).center;class Gb extends Map{constructor(t,r=HB){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(Vb(this,t))}has(t){return super.has(Vb(this,t))}set(t,r){return super.set(UB(this,t),r)}delete(t){return super.delete(qB(this,t))}}function Vb({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function UB({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function qB({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function HB(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KB(e=es){if(e===es)return B2;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 B2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const YB=Math.sqrt(50),GB=Math.sqrt(10),VB=Math.sqrt(2);function Wd(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>=YB?10:i>=GB?5:i>=VB?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?Wd(e,t,r*2):[l,c,d]}function Jh(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?Wd(t,e,r):Wd(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 ep(e,t,r){return t=+t,e=+e,r=+r,Wd(e,t,r)[2]}function tp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,s=n?ep(t,e,r):ep(e,t,r);return(n?-1:1)*(s<0?1/-s:s)}function Xb(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Qb(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function W2(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?B2:KB(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)),g=Math.min(n,Math.floor(t+(c-d)*f/c+m));W2(e,t,p,g,s)}const i=e[t];let o=r,l=n;for(Ho(e,r,t),s(e[n],i)>0&&Ho(e,r,n);o<l;){for(Ho(e,o,l),++o,--l;s(e[o],i)<0;)++o;for(;s(e[l],i)>0;)--l}s(e[r],i)===0?Ho(e,r,l):(++l,Ho(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Ho(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function XB(e,t,r){if(e=Float64Array.from(BB(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Qb(e);if(t>=1)return Xb(e);var n,s=(n-1)*t,i=Math.floor(s),o=Xb(W2(e,i).subarray(0,i+1)),l=Qb(e.subarray(i+1));return o+(l-o)*(s-i)}}function QB(e,t,r=F2){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 ZB(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 un(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function $a(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 rp=Symbol("implicit");function ex(){var e=new Gb,t=[],r=[],n=rp;function s(i){let o=e.get(i);if(o===void 0){if(n!==rp)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 Gb;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 ex(t,r).unknown(n)},un.apply(s,arguments),s}function tx(){var e=ex().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,g=p?s:n,x=p?n:s;i=(x-g)/Math.max(1,m-c+d*2),l&&(i=Math.floor(i)),g+=(x-g-i*(m-c))*u,o=i*(1-c),l&&(g=Math.round(g),o=Math.round(o));var v=ZB(m).map(function(y){return g+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 tx(t(),[n,s]).round(l).paddingInner(c).paddingOuter(d).align(u)},un.apply(f(),arguments)}function U2(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return U2(t())},e}function JB(){return U2(tx.apply(null,arguments).paddingInner(1))}function rx(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function q2(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function dc(){}var bl=.7,Ud=1/bl,Di="\\s*([+-]?\\d+)\\s*",wl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eW=/^#([0-9a-f]{3,8})$/,tW=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),rW=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),nW=new RegExp(`^rgba\\(${Di},${Di},${Di},${wl}\\)$`),aW=new RegExp(`^rgba\\(${Un},${Un},${Un},${wl}\\)$`),sW=new RegExp(`^hsl\\(${wl},${Un},${Un}\\)$`),iW=new RegExp(`^hsla\\(${wl},${Un},${Un},${wl}\\)$`),Zb={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};rx(dc,jl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Jb,formatHex:Jb,formatHex8:oW,formatHsl:lW,formatRgb:e0,toString:e0});function Jb(){return this.rgb().formatHex()}function oW(){return this.rgb().formatHex8()}function lW(){return H2(this).formatHsl()}function e0(){return this.rgb().formatRgb()}function jl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=eW.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?t0(t):r===3?new Tr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Hc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Hc(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=tW.exec(e))?new Tr(t[1],t[2],t[3],1):(t=rW.exec(e))?new Tr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nW.exec(e))?Hc(t[1],t[2],t[3],t[4]):(t=aW.exec(e))?Hc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sW.exec(e))?a0(t[1],t[2]/100,t[3]/100,1):(t=iW.exec(e))?a0(t[1],t[2]/100,t[3]/100,t[4]):Zb.hasOwnProperty(e)?t0(Zb[e]):e==="transparent"?new Tr(NaN,NaN,NaN,0):null}function t0(e){return new Tr(e>>16&255,e>>8&255,e&255,1)}function Hc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Tr(e,t,r,n)}function cW(e){return e instanceof dc||(e=jl(e)),e?(e=e.rgb(),new Tr(e.r,e.g,e.b,e.opacity)):new Tr}function np(e,t,r,n){return arguments.length===1?cW(e):new Tr(e,t,r,n??1)}function Tr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}rx(Tr,np,q2(dc,{brighter(e){return e=e==null?Ud:Math.pow(Ud,e),new Tr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bl:Math.pow(bl,e),new Tr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Tr($s(this.r),$s(this.g),$s(this.b),qd(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:r0,formatHex:r0,formatHex8:dW,formatRgb:n0,toString:n0}));function r0(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function dW(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function n0(){const e=qd(this.opacity);return`${e===1?"rgb(":"rgba("}${$s(this.r)}, ${$s(this.g)}, ${$s(this.b)}${e===1?")":`, ${e})`}`}function qd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $s(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Es(e){return e=$s(e),(e<16?"0":"")+e.toString(16)}function a0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new bn(e,t,r,n)}function H2(e){if(e instanceof bn)return new bn(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=jl(e)),!e)return new bn;if(e instanceof bn)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 bn(o,l,c,e.opacity)}function uW(e,t,r,n){return arguments.length===1?H2(e):new bn(e,t,r,n??1)}function bn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}rx(bn,uW,q2(dc,{brighter(e){return e=e==null?Ud:Math.pow(Ud,e),new bn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bl:Math.pow(bl,e),new bn(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 Tr(Bm(e>=240?e-240:e+120,s,n),Bm(e,s,n),Bm(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new bn(s0(this.h),Kc(this.s),Kc(this.l),qd(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=qd(this.opacity);return`${e===1?"hsl(":"hsla("}${s0(this.h)}, ${Kc(this.s)*100}%, ${Kc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function s0(e){return e=(e||0)%360,e<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Bm(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 nx=e=>()=>e;function fW(e,t){return function(r){return e+r*t}}function mW(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 hW(e){return(e=+e)==1?K2:function(t,r){return r-t?mW(t,r,e):nx(isNaN(t)?r:t)}}function K2(e,t){var r=t-e;return r?fW(e,r):nx(isNaN(e)?t:e)}const i0=function e(t){var r=hW(t);function n(s,i){var o=r((s=np(s)).r,(i=np(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),d=K2(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 pW(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 gW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function xW(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]=xo(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 vW(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Hd(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function yW(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]=xo(e[s],t[s]):n[s]=t[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var ap=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wm=new RegExp(ap.source,"g");function bW(e){return function(){return e}}function wW(e){return function(t){return e(t)+""}}function jW(e,t){var r=ap.lastIndex=Wm.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=ap.exec(e))&&(s=Wm.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:Hd(n,s)})),r=Wm.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?wW(c[0].x):bW(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 xo(e,t){var r=typeof t,n;return t==null||r==="boolean"?nx(t):(r==="number"?Hd:r==="string"?(n=jl(t))?(t=n,i0):jW:t instanceof jl?i0:t instanceof Date?vW:gW(t)?pW:Array.isArray(t)?xW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yW:Hd)(e,t)}function ax(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function NW(e,t){t===void 0&&(t=e,e=xo);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 kW(e){return function(){return e}}function Kd(e){return+e}var o0=[0,1];function wr(e){return e}function sp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:kW(isNaN(t)?NaN:.5)}function SW(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function CW(e,t,r){var n=e[0],s=e[1],i=t[0],o=t[1];return s<n?(n=sp(s,n),i=r(o,i)):(n=sp(n,s),i=r(i,o)),function(l){return i(n(l))}}function _W(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]=sp(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=cc(e,l,1,n)-1;return i[c](s[c](l))}}function uc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Of(){var e=o0,t=o0,r=xo,n,s,i,o=wr,l,c,d;function u(){var m=Math.min(e.length,t.length);return o!==wr&&(o=SW(e[0],e[m-1])),l=m>2?_W:CW,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),Hd)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,Kd),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=ax,u()},f.clamp=function(m){return arguments.length?(o=m?!0:wr,u()):o!==wr},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 sx(){return Of()(wr,wr)}function OW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Yd(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 Hi(e){return e=Yd(Math.abs(e)),e?e[1]:NaN}function PW(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 MW(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var EW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nl(e){if(!(t=EW.exec(e)))throw new Error("invalid format: "+e);var t;return new ix({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]})}Nl.prototype=ix.prototype;function ix(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+""}ix.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 AW(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 Gd;function DW(e,t){var r=Yd(e,t);if(!r)return Gd=void 0,e.toPrecision(t);var n=r[0],s=r[1],i=s-(Gd=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")+Yd(e,Math.max(0,t+i-1))[0]}function l0(e,t){var r=Yd(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 c0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OW,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)=>l0(e*100,t),r:l0,s:DW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function d0(e){return e}var u0=Array.prototype.map,f0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function TW(e){var t=e.grouping===void 0||e.thousands===void 0?d0:PW(u0.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?d0:MW(u0.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=Nl(f);var p=f.fill,g=f.align,x=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"):c0[b]||(j===void 0&&(j=12),k=!0,b="g"),(y||p==="0"&&g==="=")&&(y=!0,p="0",g="=");var C=(m&&m.prefix!==void 0?m.prefix:"")+(v==="$"?r:v==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),S=(v==="$"?n:/[%p]/.test(b)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),_=c0[b],A=/[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 M(P){var T=C,D=S,B,E,z;if(b==="c")D=_(P)+D,P="";else{P=+P;var Q=P<0||1/P<0;if(P=isNaN(P)?c:_(Math.abs(P),j),k&&(P=AW(P)),Q&&+P==0&&x!=="+"&&(Q=!1),T=(Q?x==="("?x:l:x==="-"||x==="("?"":x)+T,D=(b==="s"&&!isNaN(P)&&Gd!==void 0?f0[8+Gd/3]:"")+D+(Q&&x==="("?")":""),A){for(B=-1,E=P.length;++B<E;)if(z=P.charCodeAt(B),48>z||z>57){D=(z===46?s+P.slice(B+1):P.slice(B))+D,P=P.slice(0,B);break}}}N&&!y&&(P=t(P,1/0));var K=T.length+P.length+D.length,se=K<w?new Array(w-K+1).join(p):"";switch(N&&y&&(P=t(se+P,se.length?w-D.length:1/0),se=""),g){case"<":P=T+P+D+se;break;case"=":P=T+se+P+D;break;case"^":P=se.slice(0,K=se.length>>1)+T+P+D+se.slice(K);break;default:P=se+T+P+D;break}return i(P)}return M.toString=function(){return f+""},M}function u(f,m){var p=Math.max(-8,Math.min(8,Math.floor(Hi(m)/3)))*3,g=Math.pow(10,-p),x=d((f=Nl(f),f.type="f",f),{suffix:f0[8+p/3]});return function(v){return x(g*v)}}return{format:d,formatPrefix:u}}var Yc,ox,Y2;IW({thousands:",",grouping:[3],currency:["$",""]});function IW(e){return Yc=TW(e),ox=Yc.format,Y2=Yc.formatPrefix,Yc}function RW(e){return Math.max(0,-Hi(Math.abs(e)))}function $W(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hi(t)/3)))*3-Hi(Math.abs(e)))}function zW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hi(t)-Hi(e))+1}function G2(e,t,r,n){var s=tp(e,t,r),i;switch(n=Nl(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=$W(s,o))&&(n.precision=i),Y2(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=zW(s,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=RW(s))&&(n.precision=i-(n.type==="%")*2);break}}return ox(n)}function fs(e){var t=e.domain;return e.ticks=function(r){var n=t();return Jh(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var s=t();return G2(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=ep(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 V2(){var e=sx();return e.copy=function(){return uc(e,V2())},un.apply(e,arguments),fs(e)}function X2(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,Kd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return X2(e).unknown(t)},e=arguments.length?Array.from(e,Kd):[0,1],fs(r)}function Q2(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 m0(e){return Math.log(e)}function h0(e){return Math.exp(e)}function LW(e){return-Math.log(-e)}function FW(e){return-Math.exp(-e)}function BW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function WW(e){return e===10?BW:e===Math.E?Math.exp:t=>Math.pow(e,t)}function UW(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 p0(e){return(t,r)=>-e(-t,r)}function lx(e){const t=e(m0,h0),r=t.domain;let n=10,s,i;function o(){return s=UW(n),i=WW(n),r()[0]<0?(s=p0(s),i=p0(i),e(LW,FW)):e(m0,h0),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),g,x;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(g=1;g<n;++g)if(x=m<0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}}else for(;m<=p;++m)for(g=n-1;g>=1;--g)if(x=m>0?g/i(-m):g*i(m),!(x<d)){if(x>u)break;y.push(x)}y.length*2<v&&(y=Jh(d,u,v))}else y=Jh(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=Nl(c)).precision==null&&(c.trim=!0),c=ox(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(Q2(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),t}function Z2(){const e=lx(Of()).domain([1,10]);return e.copy=()=>uc(e,Z2()).base(e.base()),un.apply(e,arguments),e}function g0(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function x0(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function cx(e){var t=1,r=e(g0(t),x0(t));return r.constant=function(n){return arguments.length?e(g0(t=+n),x0(t)):t},fs(r)}function J2(){var e=cx(Of());return e.copy=function(){return uc(e,J2()).constant(e.constant())},un.apply(e,arguments)}function v0(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function HW(e){return e<0?-e*e:e*e}function dx(e){var t=e(wr,wr),r=1;function n(){return r===1?e(wr,wr):r===.5?e(qW,HW):e(v0(r),v0(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,n()):r},fs(t)}function ux(){var e=dx(Of());return e.copy=function(){return uc(e,ux()).exponent(e.exponent())},un.apply(e,arguments),e}function KW(){return ux.apply(null,arguments).exponent(.5)}function y0(e){return Math.sign(e)*e*e}function YW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eC(){var e=sx(),t=[0,1],r=!1,n;function s(i){var o=YW(e(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return e.invert(y0(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,Kd)).map(y0)),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 eC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},un.apply(s,arguments),fs(s)}function tC(){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]=QB(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[cc(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(es),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 tC().domain(e).range(t).unknown(n)},un.apply(i,arguments)}function rC(){var e=0,t=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[cc(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 rC().domain([e,t]).range(s).unknown(i)},un.apply(fs(o),arguments)}function nC(){var e=[.5],t=[0,1],r,n=1;function s(i){return i!=null&&i<=i?t[cc(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 nC().domain(e).range(t).unknown(r)},un.apply(s,arguments)}const Um=new Date,qm=new Date;function Wt(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=>Wt(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)=>(Um.setTime(+i),qm.setTime(+o),e(Um),e(qm),Math.floor(r(Um,qm))),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 Vd=Wt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Vd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Wt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Vd);Vd.range;const ma=1e3,an=ma*60,ha=an*60,ja=ha*24,fx=ja*7,b0=ja*30,Hm=ja*365,As=Wt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ma)},(e,t)=>(t-e)/ma,e=>e.getUTCSeconds());As.range;const mx=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ma)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getMinutes());mx.range;const hx=Wt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getUTCMinutes());hx.range;const px=Wt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ma-e.getMinutes()*an)},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getHours());px.range;const gx=Wt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getUTCHours());gx.range;const fc=Wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*an)/ja,e=>e.getDate()-1);fc.range;const Pf=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ja,e=>e.getUTCDate()-1);Pf.range;const aC=Wt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ja,e=>Math.floor(e/ja));aC.range;function ui(e){return Wt(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())*an)/fx)}const Mf=ui(0),Xd=ui(1),GW=ui(2),VW=ui(3),Ki=ui(4),XW=ui(5),QW=ui(6);Mf.range;Xd.range;GW.range;VW.range;Ki.range;XW.range;QW.range;function fi(e){return Wt(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)/fx)}const Ef=fi(0),Qd=fi(1),ZW=fi(2),JW=fi(3),Yi=fi(4),e7=fi(5),t7=fi(6);Ef.range;Qd.range;ZW.range;JW.range;Yi.range;e7.range;t7.range;const xx=Wt(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());xx.range;const vx=Wt(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());vx.range;const Na=Wt(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());Na.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});Na.range;const ka=Wt(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());ka.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Wt(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)});ka.range;function sC(e,t,r,n,s,i){const o=[[As,1,ma],[As,5,5*ma],[As,15,15*ma],[As,30,30*ma],[i,1,an],[i,5,5*an],[i,15,15*an],[i,30,30*an],[s,1,ha],[s,3,3*ha],[s,6,6*ha],[s,12,12*ha],[n,1,ja],[n,2,2*ja],[r,1,fx],[t,1,b0],[t,3,3*b0],[e,1,Hm]];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),g=p?p.range(d,+u+1):[];return m?g.reverse():g}function c(d,u,f){const m=Math.abs(u-d)/f,p=Jg(([,,v])=>v).right(o,m);if(p===o.length)return e.every(tp(d/Hm,u/Hm,f));if(p===0)return Vd.every(Math.max(tp(d,u,f),1));const[g,x]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return g.every(x)}return[l,c]}const[r7,n7]=sC(ka,vx,Ef,aC,gx,hx),[a7,s7]=sC(Na,xx,Mf,fc,px,mx);function Km(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 Ym(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 Ko(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function i7(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=Yo(s),u=Go(s),f=Yo(i),m=Go(i),p=Yo(o),g=Go(o),x=Yo(l),v=Go(l),y=Yo(c),w=Go(c),N={a:z,A:Q,b:K,B:se,c:null,d:C0,e:C0,f:P7,g:L7,G:B7,H:C7,I:_7,j:O7,L:iC,m:M7,M:E7,p:te,q:U,Q:P0,s:M0,S:A7,u:D7,U:T7,V:I7,w:R7,W:$7,x:null,X:null,y:z7,Y:F7,Z:W7,"%":O0},j={a:G,A:J,b:X,B:O,c:null,d:_0,e:_0,f:K7,g:r9,G:a9,H:U7,I:q7,j:H7,L:lC,m:Y7,M:G7,p:F,q:ae,Q:P0,s:M0,S:V7,u:X7,U:Q7,V:Z7,w:J7,W:e9,x:null,X:null,y:t9,Y:n9,Z:s9,"%":O0},k={a:A,A:M,b:P,B:T,c:D,d:k0,e:k0,f:j7,g:N0,G:j0,H:S0,I:S0,j:v7,L:w7,m:x7,M:y7,p:_,q:g7,Q:k7,s:S7,S:b7,u:u7,U:f7,V:m7,w:d7,W:h7,x:B,X:E,y:N0,Y:j0,Z:p7,"%":N7};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(W,q){return function(le){var Z=[],de=-1,V=0,oe=W.length,pe,we,_e;for(le instanceof Date||(le=new Date(+le));++de<oe;)W.charCodeAt(de)===37&&(Z.push(W.slice(V,de)),(we=w0[pe=W.charAt(++de)])!=null?pe=W.charAt(++de):we=pe==="e"?" ":"0",(_e=q[pe])&&(pe=_e(le,we)),Z.push(pe),V=de+1);return Z.push(W.slice(V,de)),Z.join("")}}function C(W,q){return function(le){var Z=Ko(1900,void 0,1),de=S(Z,W,le+="",0),V,oe;if(de!=le.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(q&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(V=Ym(Ko(Z.y,0,1)),oe=V.getUTCDay(),V=oe>4||oe===0?Qd.ceil(V):Qd(V),V=Pf.offset(V,(Z.V-1)*7),Z.y=V.getUTCFullYear(),Z.m=V.getUTCMonth(),Z.d=V.getUTCDate()+(Z.w+6)%7):(V=Km(Ko(Z.y,0,1)),oe=V.getDay(),V=oe>4||oe===0?Xd.ceil(V):Xd(V),V=fc.offset(V,(Z.V-1)*7),Z.y=V.getFullYear(),Z.m=V.getMonth(),Z.d=V.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),oe="Z"in Z?Ym(Ko(Z.y,0,1)).getUTCDay():Km(Ko(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(oe+5)%7:Z.w+Z.U*7-(oe+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,Ym(Z)):Km(Z)}}function S(W,q,le,Z){for(var de=0,V=q.length,oe=le.length,pe,we;de<V;){if(Z>=oe)return-1;if(pe=q.charCodeAt(de++),pe===37){if(pe=q.charAt(de++),we=k[pe in w0?q.charAt(de++):pe],!we||(Z=we(W,le,Z))<0)return-1}else if(pe!=le.charCodeAt(Z++))return-1}return Z}function _(W,q,le){var Z=d.exec(q.slice(le));return Z?(W.p=u.get(Z[0].toLowerCase()),le+Z[0].length):-1}function A(W,q,le){var Z=p.exec(q.slice(le));return Z?(W.w=g.get(Z[0].toLowerCase()),le+Z[0].length):-1}function M(W,q,le){var Z=f.exec(q.slice(le));return Z?(W.w=m.get(Z[0].toLowerCase()),le+Z[0].length):-1}function P(W,q,le){var Z=y.exec(q.slice(le));return Z?(W.m=w.get(Z[0].toLowerCase()),le+Z[0].length):-1}function T(W,q,le){var Z=x.exec(q.slice(le));return Z?(W.m=v.get(Z[0].toLowerCase()),le+Z[0].length):-1}function D(W,q,le){return S(W,t,q,le)}function B(W,q,le){return S(W,r,q,le)}function E(W,q,le){return S(W,n,q,le)}function z(W){return o[W.getDay()]}function Q(W){return i[W.getDay()]}function K(W){return c[W.getMonth()]}function se(W){return l[W.getMonth()]}function te(W){return s[+(W.getHours()>=12)]}function U(W){return 1+~~(W.getMonth()/3)}function G(W){return o[W.getUTCDay()]}function J(W){return i[W.getUTCDay()]}function X(W){return c[W.getUTCMonth()]}function O(W){return l[W.getUTCMonth()]}function F(W){return s[+(W.getUTCHours()>=12)]}function ae(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var q=b(W+="",N);return q.toString=function(){return W},q},parse:function(W){var q=C(W+="",!1);return q.toString=function(){return W},q},utcFormat:function(W){var q=b(W+="",j);return q.toString=function(){return W},q},utcParse:function(W){var q=C(W+="",!0);return q.toString=function(){return W},q}}}var w0={"-":"",_:" ",0:"0"},Qt=/^\s*\d+/,o7=/^%/,l7=/[\\^$*+?|[\]().{}]/g;function Xe(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 c7(e){return e.replace(l7,"\\$&")}function Yo(e){return new RegExp("^(?:"+e.map(c7).join("|")+")","i")}function Go(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function d7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function u7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function f7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function m7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function h7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function j0(e,t,r){var n=Qt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function N0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function p7(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 g7(e,t,r){var n=Qt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function x7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function k0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function v7(e,t,r){var n=Qt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function S0(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function y7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function b7(e,t,r){var n=Qt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function w7(e,t,r){var n=Qt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function j7(e,t,r){var n=Qt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function N7(e,t,r){var n=o7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function k7(e,t,r){var n=Qt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function S7(e,t,r){var n=Qt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function C0(e,t){return Xe(e.getDate(),t,2)}function C7(e,t){return Xe(e.getHours(),t,2)}function _7(e,t){return Xe(e.getHours()%12||12,t,2)}function O7(e,t){return Xe(1+fc.count(Na(e),e),t,3)}function iC(e,t){return Xe(e.getMilliseconds(),t,3)}function P7(e,t){return iC(e,t)+"000"}function M7(e,t){return Xe(e.getMonth()+1,t,2)}function E7(e,t){return Xe(e.getMinutes(),t,2)}function A7(e,t){return Xe(e.getSeconds(),t,2)}function D7(e){var t=e.getDay();return t===0?7:t}function T7(e,t){return Xe(Mf.count(Na(e)-1,e),t,2)}function oC(e){var t=e.getDay();return t>=4||t===0?Ki(e):Ki.ceil(e)}function I7(e,t){return e=oC(e),Xe(Ki.count(Na(e),e)+(Na(e).getDay()===4),t,2)}function R7(e){return e.getDay()}function $7(e,t){return Xe(Xd.count(Na(e)-1,e),t,2)}function z7(e,t){return Xe(e.getFullYear()%100,t,2)}function L7(e,t){return e=oC(e),Xe(e.getFullYear()%100,t,2)}function F7(e,t){return Xe(e.getFullYear()%1e4,t,4)}function B7(e,t){var r=e.getDay();return e=r>=4||r===0?Ki(e):Ki.ceil(e),Xe(e.getFullYear()%1e4,t,4)}function W7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Xe(t/60|0,"0",2)+Xe(t%60,"0",2)}function _0(e,t){return Xe(e.getUTCDate(),t,2)}function U7(e,t){return Xe(e.getUTCHours(),t,2)}function q7(e,t){return Xe(e.getUTCHours()%12||12,t,2)}function H7(e,t){return Xe(1+Pf.count(ka(e),e),t,3)}function lC(e,t){return Xe(e.getUTCMilliseconds(),t,3)}function K7(e,t){return lC(e,t)+"000"}function Y7(e,t){return Xe(e.getUTCMonth()+1,t,2)}function G7(e,t){return Xe(e.getUTCMinutes(),t,2)}function V7(e,t){return Xe(e.getUTCSeconds(),t,2)}function X7(e){var t=e.getUTCDay();return t===0?7:t}function Q7(e,t){return Xe(Ef.count(ka(e)-1,e),t,2)}function cC(e){var t=e.getUTCDay();return t>=4||t===0?Yi(e):Yi.ceil(e)}function Z7(e,t){return e=cC(e),Xe(Yi.count(ka(e),e)+(ka(e).getUTCDay()===4),t,2)}function J7(e){return e.getUTCDay()}function e9(e,t){return Xe(Qd.count(ka(e)-1,e),t,2)}function t9(e,t){return Xe(e.getUTCFullYear()%100,t,2)}function r9(e,t){return e=cC(e),Xe(e.getUTCFullYear()%100,t,2)}function n9(e,t){return Xe(e.getUTCFullYear()%1e4,t,4)}function a9(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Yi(e):Yi.ceil(e),Xe(e.getUTCFullYear()%1e4,t,4)}function s9(){return"+0000"}function O0(){return"%"}function P0(e){return+e}function M0(e){return Math.floor(+e/1e3)}var yi,dC,uC;i9({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 i9(e){return yi=i7(e),dC=yi.format,yi.parse,uC=yi.utcFormat,yi.utcParse,yi}function o9(e){return new Date(e)}function l9(e){return e instanceof Date?+e:+new Date(+e)}function yx(e,t,r,n,s,i,o,l,c,d){var u=sx(),f=u.invert,m=u.domain,p=d(".%L"),g=d(":%S"),x=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?g:o(b)<b?x: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,l9)):m().map(o9)},u.ticks=function(b){var C=m();return e(C[0],C[C.length-1],b??10)},u.tickFormat=function(b,C){return C==null?k:d(C)},u.nice=function(b){var C=m();return(!b||typeof b.range!="function")&&(b=t(C[0],C[C.length-1],b??10)),b?m(Q2(C,b)):u},u.copy=function(){return uc(u,yx(e,t,r,n,s,i,o,l,c,d))},u}function c9(){return un.apply(yx(a7,s7,Na,xx,Mf,fc,px,mx,As,dC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function d9(){return un.apply(yx(r7,n7,ka,vx,Ef,Pf,gx,hx,As,uC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Af(){var e=0,t=1,r,n,s,i,o=wr,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,g;return arguments.length?([p,g]=m,o=f(p,g),d):[o(0),o(1)]}}return d.range=u(xo),d.rangeRound=u(ax),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 ms(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function fC(){var e=fs(Af()(wr));return e.copy=function(){return ms(e,fC())},$a.apply(e,arguments)}function mC(){var e=lx(Af()).domain([1,10]);return e.copy=function(){return ms(e,mC()).base(e.base())},$a.apply(e,arguments)}function hC(){var e=cx(Af());return e.copy=function(){return ms(e,hC()).constant(e.constant())},$a.apply(e,arguments)}function bx(){var e=dx(Af());return e.copy=function(){return ms(e,bx()).exponent(e.exponent())},$a.apply(e,arguments)}function u9(){return bx.apply(null,arguments).exponent(.5)}function pC(){var e=[],t=wr;function r(n){if(n!=null&&!isNaN(n=+n))return t((cc(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(es),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)=>XB(e,i/n))},r.copy=function(){return pC(t).domain(e)},$a.apply(r,arguments)}function Df(){var e=0,t=.5,r=1,n=1,s,i,o,l,c,d=wr,u,f=!1,m;function p(x){return isNaN(x=+x)?m:(x=.5+((x=+u(x))-i)*(n*x<n*i?l:c),d(f?Math.max(0,Math.min(1,x)):x))}p.domain=function(x){return arguments.length?([e,t,r]=x,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(x){return arguments.length?(f=!!x,p):f},p.interpolator=function(x){return arguments.length?(d=x,p):d};function g(x){return function(v){var y,w,N;return arguments.length?([y,w,N]=v,d=NW(x,[y,w,N]),p):[d(0),d(.5),d(1)]}}return p.range=g(xo),p.rangeRound=g(ax),p.unknown=function(x){return arguments.length?(m=x,p):m},function(x){return u=x,s=x(e),i=x(t),o=x(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p}}function gC(){var e=fs(Df()(wr));return e.copy=function(){return ms(e,gC())},$a.apply(e,arguments)}function xC(){var e=lx(Df()).domain([.1,1,10]);return e.copy=function(){return ms(e,xC()).base(e.base())},$a.apply(e,arguments)}function vC(){var e=cx(Df());return e.copy=function(){return ms(e,vC()).constant(e.constant())},$a.apply(e,arguments)}function wx(){var e=dx(Df());return e.copy=function(){return ms(e,wx()).exponent(e.exponent())},$a.apply(e,arguments)}function f9(){return wx.apply(null,arguments).exponent(.5)}const el=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:tx,scaleDiverging:gC,scaleDivergingLog:xC,scaleDivergingPow:wx,scaleDivergingSqrt:f9,scaleDivergingSymlog:vC,scaleIdentity:X2,scaleImplicit:rp,scaleLinear:V2,scaleLog:Z2,scaleOrdinal:ex,scalePoint:JB,scalePow:ux,scaleQuantile:tC,scaleQuantize:rC,scaleRadial:eC,scaleSequential:fC,scaleSequentialLog:mC,scaleSequentialPow:bx,scaleSequentialQuantile:pC,scaleSequentialSqrt:u9,scaleSequentialSymlog:hC,scaleSqrt:KW,scaleSymlog:J2,scaleThreshold:nC,scaleTime:c9,scaleUtc:d9,tickFormat:G2},Symbol.toStringTag,{value:"Module"}));var za=e=>e.chartData,yC=Y([za],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),bC=(e,t,r,n)=>n?yC(e):za(e),m9=(e,t,r)=>r?yC(e):za(e);function Sa(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(qe(t)&&qe(r))return!0}return!1}function E0(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function wC(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,s,i;if(qe(r))s=r;else if(typeof r=="function")return;if(qe(n))i=n;else if(typeof n=="function")return;var o=[s,i];if(Sa(o))return o}}function h9(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Sa(n))return E0(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(ke(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"&&Qy.test(s)){var c=Qy.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(ke(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"&&Zy.test(i)){var u=Zy.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(Sa(m))return t==null?m:E0(m,t,r)}}}var vo=1e9,p9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Nx,pt=!0,dn="[DecimalError] ",zs=dn+"Invalid argument: ",jx=dn+"Exponent out of range: ",yo=Math.floor,js=Math.pow,g9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ur,Yt=1e7,ft=7,jC=9007199254740991,Zd=yo(jC/ft),xe={};xe.absoluteValue=xe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};xe.comparedTo=xe.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};xe.decimalPlaces=xe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ft;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};xe.dividedBy=xe.div=function(e){return xa(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.idiv=function(e){var t=this,r=t.constructor;return nt(xa(t,new r(e),0,1),r.precision)};xe.equals=xe.eq=function(e){return!this.cmp(e)};xe.exponent=function(){return It(this)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){return this.cmp(e)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.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(Ur))throw Error(dn+"NaN");if(r.s<1)throw Error(dn+(r.s?"NaN":"-Infinity"));return r.eq(Ur)?new n(0):(pt=!1,t=xa(kl(r,i),kl(e,i),i),pt=!0,nt(t,s))};xe.minus=xe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?SC(t,e):NC(t,(e.s=-e.s,e))};xe.modulo=xe.mod=function(e){var t,r=this,n=r.constructor,s=n.precision;if(e=new n(e),!e.s)throw Error(dn+"NaN");return r.s?(pt=!1,t=xa(r,e,0,1).times(e),pt=!0,r.minus(t)):nt(new n(r),s)};xe.naturalExponential=xe.exp=function(){return kC(this)};xe.naturalLogarithm=xe.ln=function(){return kl(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xe.plus=xe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?NC(t,e):SC(t,(e.s=-e.s,e))};xe.precision=xe.sd=function(e){var t,r,n,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zs+e);if(t=It(s)+1,n=s.d.length-1,r=n*ft+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};xe.squareRoot=xe.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(dn+"NaN")}for(e=It(l),pt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Wn(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=yo((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(xa(l,i,o+2)).times(.5),Wn(i.d).slice(0,o)===(t=Wn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(nt(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return pt=!0,nt(n,r)};xe.times=xe.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%Yt|0,t=l/Yt|0;i[s]=(i[s]+t)%Yt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,pt?nt(e,f.precision):e};xe.toDecimalPlaces=xe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Gn(e,0,vo),t===void 0?t=n.rounding:Gn(t,0,8),nt(r,e+It(r)+1,t))};xe.toExponential=function(e,t){var r,n=this,s=n.constructor;return e===void 0?r=ri(n,!0):(Gn(e,0,vo),t===void 0?t=s.rounding:Gn(t,0,8),n=nt(new s(n),e+1,t),r=ri(n,!0,e+1)),r};xe.toFixed=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?ri(s):(Gn(e,0,vo),t===void 0?t=i.rounding:Gn(t,0,8),n=nt(new i(s),e+It(s)+1,t),r=ri(n.abs(),!1,e+It(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};xe.toInteger=xe.toint=function(){var e=this,t=e.constructor;return nt(new t(e),It(e)+1,t.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.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(Ur);if(l=new c(l),!l.s){if(e.s<1)throw Error(dn+"Infinity");return l}if(l.eq(Ur))return l;if(n=c.precision,e.eq(Ur))return nt(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=u<0?-u:u)<=jC){for(s=new c(Ur),t=Math.ceil(n/ft+4),pt=!1;r%2&&(s=s.times(l),D0(s.d,t)),r=yo(r/2),r!==0;)l=l.times(l),D0(l.d,t);return pt=!0,e.s<0?new c(Ur).div(s):nt(s,n)}}else if(i<0)throw Error(dn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,pt=!1,s=e.times(kl(l,n+d)),pt=!0,s=kC(s),s.s=i,s};xe.toPrecision=function(e,t){var r,n,s=this,i=s.constructor;return e===void 0?(r=It(s),n=ri(s,r<=i.toExpNeg||r>=i.toExpPos)):(Gn(e,1,vo),t===void 0?t=i.rounding:Gn(t,0,8),s=nt(new i(s),e,t),r=It(s),n=ri(s,e<=r||r<=i.toExpNeg,e)),n};xe.toSignificantDigits=xe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Gn(e,1,vo),t===void 0?t=n.rounding:Gn(t,0,8)),nt(new n(r),e,t)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=It(e),r=e.constructor;return ri(e,t<=r.toExpNeg||t>=r.toExpPos)};function NC(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)),pt?nt(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/ft),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)/Yt|0,c[i]%=Yt;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,pt?nt(t,f):t}function Gn(e,t,r){if(e!==~~e||e<t||e>r)throw Error(zs+e)}function Wn(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=ft-n.length,r&&(i+=Ka(r)),i+=n;o=e[t],n=o+"",r=ft-n.length,r&&(i+=Ka(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var xa=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%Yt|0,o=i/Yt|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*Yt+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,g,x,v,y,w,N,j,k,b,C,S,_=n.constructor,A=n.s==s.s?1:-1,M=n.d,P=s.d;if(!n.s)return new _(n);if(!s.s)throw Error(dn+"Division by zero");for(c=n.e-s.e,C=P.length,k=M.length,p=new _(A),g=p.d=[],d=0;P[d]==(M[d]||0);)++d;if(P[d]>(M[d]||0)&&--c,i==null?w=i=_.precision:o?w=i+(It(n)-It(s))+1:w=i,w<0)return new _(0);if(w=w/ft+2|0,d=0,C==1)for(u=0,P=P[0],w++;(d<k||u)&&w--;d++)N=u*Yt+(M[d]||0),g[d]=N/P|0,u=N%P|0;else{for(u=Yt/(P[0]+1)|0,u>1&&(P=e(P,u),M=e(M,u),C=P.length,k=M.length),j=C,x=M.slice(0,C),v=x.length;v<C;)x[v++]=0;S=P.slice(),S.unshift(0),b=P[0],P[1]>=Yt/2&&++b;do u=0,l=t(P,x,C,v),l<0?(y=x[0],C!=v&&(y=y*Yt+(x[1]||0)),u=y/b|0,u>1?(u>=Yt&&(u=Yt-1),f=e(P,u),m=f.length,v=x.length,l=t(f,x,m,v),l==1&&(u--,r(f,C<m?S:P,m))):(u==0&&(l=u=1),f=P.slice()),m=f.length,m<v&&f.unshift(0),r(x,f,v),l==-1&&(v=x.length,l=t(P,x,C,v),l<1&&(u++,r(x,C<v?S:P,v))),v=x.length):l===0&&(u++,x=[0]),g[d++]=u,l&&x[0]?x[v++]=M[j]||0:(x=[M[j]],v=1);while((j++<k||x[0]!==void 0)&&w--)}return g[0]||g.shift(),p.e=c,nt(p,o?i+It(p)+1:i)}}();function kC(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(jx+It(e));if(!e.s)return new u(Ur);for(pt=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(js(2,d))/Math.LN10*2+5|0,l+=n,r=s=i=new u(Ur),u.precision=l;;){if(s=nt(s.times(e),l),r=r.times(++c),o=i.plus(xa(s,r,l)),Wn(o.d).slice(0,l)===Wn(i.d).slice(0,l)){for(;d--;)i=nt(i.times(i),l);return u.precision=f,t==null?(pt=!0,nt(i,f)):i}i=o}}function It(e){for(var t=e.e*ft,r=e.d[0];r>=10;r/=10)t++;return t}function Gm(e,t,r){if(t>e.LN10.sd())throw pt=!0,r&&(e.precision=r),Error(dn+"LN10 precision limit exceeded");return nt(new e(e.LN10),t)}function Ka(e){for(var t="";e--;)t+="0";return t}function kl(e,t){var r,n,s,i,o,l,c,d,u,f=1,m=10,p=e,g=p.d,x=p.constructor,v=x.precision;if(p.s<1)throw Error(dn+(p.s?"NaN":"-Infinity"));if(p.eq(Ur))return new x(0);if(t==null?(pt=!1,d=v):d=t,p.eq(10))return t==null&&(pt=!0),Gm(x,d);if(d+=m,x.precision=d,r=Wn(g),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=Wn(p.d),n=r.charAt(0),f++;i=It(p),n>1?(p=new x("0."+r),i++):p=new x(n+"."+r.slice(1))}else return c=Gm(x,d+2,v).times(i+""),p=kl(new x(n+"."+r.slice(1)),d-m).plus(c),x.precision=v,t==null?(pt=!0,nt(p,v)):p;for(l=o=p=xa(p.minus(Ur),p.plus(Ur),d),u=nt(p.times(p),d),s=3;;){if(o=nt(o.times(u),d),c=l.plus(xa(o,new x(s),d)),Wn(c.d).slice(0,d)===Wn(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(Gm(x,d+2,v).times(i+""))),l=xa(l,new x(f),d),x.precision=v,t==null?(pt=!0,nt(l,v)):l;l=c,s+=2}}function A0(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=yo(r/ft),e.d=[],n=(r+1)%ft,r<0&&(n+=ft),n<s){for(n&&e.d.push(+t.slice(0,n)),s-=ft;n<s;)e.d.push(+t.slice(n,n+=ft));t=t.slice(n),n=ft-t.length}else n-=s;for(;n--;)t+="0";if(e.d.push(+t),pt&&(e.e>Zd||e.e<-Zd))throw Error(jx+r)}else e.s=0,e.e=0,e.d=[0];return e}function nt(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+=ft,s=t,d=f[u=0];else{if(u=Math.ceil((n+1)/ft),i=f.length,u>=i)return e;for(d=i=f[u],o=1;i>=10;i/=10)o++;n%=ft,s=n-ft+o}if(r!==void 0&&(i=js(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/js(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]=js(10,(ft-t%ft)%ft),e.e=yo(-t/ft)||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=js(10,ft-n),f[u]=s>0?(d/js(10,o-s)%js(10,s)|0)*i:0),c)for(;;)if(u==0){(f[0]+=i)==Yt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Yt)break;f[u--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(pt&&(e.e>Zd||e.e<-Zd))throw Error(jx+It(e));return e}function SC(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),pt?nt(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/ft),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]=Yt-1;--c[i],c[s]+=Yt}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,pt?nt(t,p):t):new m(0)}function ri(e,t,r){var n,s=It(e),i=Wn(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ka(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Ka(-s-1)+i,r&&(n=r-o)>0&&(i+=Ka(n))):s>=o?(i+=Ka(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Ka(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Ka(n))),e.s<0?"-"+i:i}function D0(e,t){if(e.length>t)return e.length=t,!0}function CC(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(zs+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 A0(o,i.toString())}else if(typeof i!="string")throw Error(zs+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,g9.test(i))A0(o,i);else throw Error(zs+i)}if(s.prototype=xe,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=CC,s.config=s.set=x9,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 x9(e){if(!e||typeof e!="object")throw Error(dn+"Object expected");var t,r,n,s=["precision",1,vo,"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(yo(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(zs+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(zs+r+": "+n);return this}var Nx=CC(p9);Ur=new Nx(1);const et=Nx;function _C(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function OC(e,t,r){for(var n=new et(e),s=0,i=[];n.lt(t)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var PC=e=>{var[t,r]=e,[n,s]=[t,r];return t>r&&([n,s]=[r,t]),[n,s]},MC=(e,t,r)=>{if(e.lte(0))return new et(0);var n=_C(e.toNumber()),s=new et(10).pow(n),i=e.div(s),o=n!==1?.05:.1,l=new et(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return t?new et(c.toNumber()):new et(Math.ceil(c.toNumber()))},v9=(e,t,r)=>{var n=new et(1),s=new et(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(n=new et(10).pow(_C(e)-1),s=new et(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new et(Math.floor(e)))}else e===0?s=new et(Math.floor((t-1)/2)):r||(s=new et(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(s.add(new et(c-o).mul(n)).toNumber());return l},EC=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 et(0),tickMin:new et(0),tickMax:new et(0)};var o=MC(new et(r).sub(t).div(n-1),s,i),l;t<=0&&r>=0?l=new et(0):(l=new et(t).add(r).div(2),l=l.sub(new et(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new et(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?EC(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 et(c).mul(o)),tickMax:l.add(new et(d).mul(o))})},y9=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]=PC([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 v9(l,s,i);var{step:u,tickMin:f,tickMax:m}=EC(l,c,o,i,0),p=OC(f,m.add(new et(.1).mul(u)),u);return r>n?p.reverse():p},b9=function(t,r){var[n,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=PC([n,s]);if(o===-1/0||l===1/0)return[n,s];if(o===l)return[o];var c=Math.max(r,2),d=MC(new et(l).sub(o).div(c-1),i,0),u=[...OC(new et(o),new et(l),d),l];return i===!1&&(u=u.map(f=>Math.round(f))),n>s?u.reverse():u},AC=e=>e.rootProps.maxBarSize,w9=e=>e.rootProps.barGap,DC=e=>e.rootProps.barCategoryGap,j9=e=>e.rootProps.barSize,Tf=e=>e.rootProps.stackOffset,TC=e=>e.rootProps.reverseStackOrder,kx=e=>e.options.chartName,Sx=e=>e.rootProps.syncId,IC=e=>e.rootProps.syncMethod,Cx=e=>e.options.eventEmitter,jr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},vs={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},In={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},If=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Rf(e,t,r){if(r!=="auto")return r;if(e!=null)return us(e,t)?"category":"number"}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 Jd(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){N9(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 N9(e,t,r){return(t=k9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k9(e){var t=S9(e,"string");return typeof t=="symbol"?t:t+""}function S9(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 I0={allowDataOverflow:vs.allowDataOverflow,allowDecimals:vs.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:vs.angleAxisId,includeHidden:!1,name:void 0,reversed:vs.reversed,scale:vs.scale,tick:vs.tick,tickCount:void 0,ticks:void 0,type:vs.type,unit:void 0},R0={allowDataOverflow:In.allowDataOverflow,allowDecimals:In.allowDecimals,allowDuplicatedCategory:In.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:In.radiusAxisId,includeHidden:In.includeHidden,name:void 0,reversed:In.reversed,scale:In.scale,tick:In.tick,tickCount:In.tickCount,ticks:void 0,type:In.type,unit:void 0},C9=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},_x=Y([C9,v2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Rf(t,"angleAxis",I0.type))!==null&&r!==void 0?r:"category";return Jd(Jd({},I0),{},{type:n})}),_9=(e,t)=>e.polarAxis.radiusAxis[t],Ox=Y([_9,v2],(e,t)=>{var r;if(e!=null)return e;var n=(r=Rf(t,"radiusAxis",R0.type))!==null&&r!==void 0?r:"category";return Jd(Jd({},R0),{},{type:n})}),$f=e=>e.polarOptions,Px=Y([Ia,Ra,Xt],OB),RC=Y([$f,Px],(e,t)=>{if(e!=null)return Sn(e.innerRadius,t,0)}),$C=Y([$f,Px],(e,t)=>{if(e!=null)return Sn(e.outerRadius,t,t*.8)}),O9=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},zC=Y([$f],O9);Y([_x,zC],If);var LC=Y([Px,RC,$C],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Y([Ox,LC],If);var FC=Y([it,$f,RC,$C,Ia,Ra],(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:Sn(o,s,s/2),cy:Sn(l,i,i/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Zt=(e,t)=>t,zf=(e,t,r)=>r;function Mx(e){return e==null?void 0:e.id}function BC(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=Mx(l);d.forEach((f,m)=>{var p=i==null||s?m:String(lr(f,i,null)),g=lr(f,l.dataKey,0),x;o.has(p)?x=o.get(p):x={},Object.assign(x,{[u]:g}),o.set(p,x)})}}),Array.from(o.values())}function Lf(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ff=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Bf(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function P9(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 Jt=e=>{var t=it(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},bo=e=>e.tooltip.settings.axisId;function M9(e){if(e in el)return el[e]();var t="scale".concat(nc(e));if(t in el)return el[t]()}function $0(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 z0(e,t,r){if(typeof e=="function")return $0(e.copy().domain(t).range(r));if(e!=null){var n=M9(e);if(n!=null)return n.domain(t).range(r),$0(n)}}var E9=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Sa(t)){for(var r,n,s=0;s<t.length;s++){var i=t[s];qe(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 L0(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 eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L0(Object(r),!0).forEach(function(n){A9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A9(e,t,r){return(t=D9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D9(e){var t=T9(e,"string");return typeof t=="symbol"?t:t+""}function T9(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 ip=[0,"auto"],Ht={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},WC=(e,t)=>e.cartesianAxis.xAxis[t],La=(e,t)=>{var r=WC(e,t);return r??Ht},Kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:ip,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:ic},UC=(e,t)=>e.cartesianAxis.yAxis[t],Fa=(e,t)=>{var r=UC(e,t);return r??Kt},I9={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:""},Ex=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??I9},_r=(e,t,r)=>{switch(t){case"xAxis":return La(e,r);case"yAxis":return Fa(e,r);case"zAxis":return Ex(e,r);case"angleAxis":return _x(e,r);case"radiusAxis":return Ox(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},R9=(e,t,r)=>{switch(t){case"xAxis":return La(e,r);case"yAxis":return Fa(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},mc=(e,t,r)=>{switch(t){case"xAxis":return La(e,r);case"yAxis":return Fa(e,r);case"angleAxis":return _x(e,r);case"radiusAxis":return Ox(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},qC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function HC(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 Ax=e=>e.graphicalItems.cartesianItems,$9=Y([Zt,zf],HC),KC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),hc=Y([Ax,_r,$9],KC,{memoizeOptions:{resultEqualityCheck:Bf}}),YC=Y([hc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Lf)),GC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),z9=Y([hc],GC),VC=e=>e.map(t=>t.data).filter(Boolean).flat(1),L9=Y([hc],VC,{memoizeOptions:{resultEqualityCheck:Bf}}),XC=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:s}=t;return e.length>0?e:r.slice(n,s+1)},Dx=Y([L9,bC],XC),QC=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:lr(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(s=>({value:lr(s,n)}))):e.map(n=>({value:n})),Wf=Y([Dx,_r,hc],QC);function ZC(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function ld(e){if(Kn(e)||e instanceof Date){var t=Number(e);if(qe(t))return t}}function F0(e){if(Array.isArray(e)){var t=[ld(e[0]),ld(e[1])];return Sa(t)?t:void 0}var r=ld(e);if(r!=null)return[r,r]}function Ca(e){return e.map(ld).filter(Dr)}function F9(e,t,r){return!r||typeof t!="number"||Hn(t)?[]:r.length?Ca(r.flatMap(n=>{var s=lr(e,n.dataKey),i,o;if(Array.isArray(s)?[i,o]=s:i=o=s,!(!qe(i)||!qe(o)))return[t-i,t+o]})):[]}var Ut=e=>{var t=Jt(e),r=bo(e);return mc(e,t,r)},pc=Y([Ut],e=>e==null?void 0:e.dataKey),B9=Y([YC,bC,Ut],BC),JC=(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(Mx);return[l,{stackedData:NF(e,u,r),graphicalItems:d}]}))},op=Y([B9,YC,Tf,TC],JC),e_=(e,t,r,n)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var o=OF(e,s,i);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},W9=Y([_r],e=>e.allowDataOverflow),Tx=e=>{var t;if(e==null||!("domain"in e))return ip;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ca(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:ip},t_=Y([_r],Tx),r_=Y([t_,W9],wC),U9=Y([op,za,Zt,r_],e_,{memoizeOptions:{resultEqualityCheck:Ff}}),Ix=e=>e.errorBars,q9=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>ZC(r,n)),tu=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]}},n_=(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=>ZC(s,y)),m=lr(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),p=F9(l,m,f);if(p.length>=2){var g=Math.min(...p),x=Math.max(...p);(i==null||g<i)&&(i=g),(o==null||x>o)&&(o=x)}var v=F0(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=F0(lr(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]))}),qe(i)&&qe(o))return[i,o]},H9=Y([Dx,_r,z9,Ix,Zt],n_,{memoizeOptions:{resultEqualityCheck:Ff}});function K9(e){var{value:t}=e;if(Kn(t)||t instanceof Date)return t}var Y9=(e,t,r)=>{var n=e.map(K9).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Jk(n))?L2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},a_=e=>e.referenceElements.dots,wo=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),G9=Y([a_,Zt,zf],wo),s_=e=>e.referenceElements.areas,V9=Y([s_,Zt,zf],wo),i_=e=>e.referenceElements.lines,X9=Y([i_,Zt,zf],wo),o_=(e,t)=>{if(e!=null){var r=Ca(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Q9=Y(G9,Zt,o_),l_=(e,t)=>{if(e!=null){var r=Ca(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)]}},Z9=Y([V9,Zt],l_);function J9(e){var t;if(e.x!=null)return Ca([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ca(r)}function eU(e){var t;if(e.y!=null)return Ca([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ca(r)}var c_=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?J9(n):eU(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},tU=Y([X9,Zt],c_),rU=Y(Q9,tU,Z9,(e,t,r)=>tu(e,r,t)),d_=(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?tu(n,i,s):tu(i,s);return h9(t,d,e.allowDataOverflow)},nU=Y([_r,t_,r_,U9,H9,rU,it,Zt],d_,{memoizeOptions:{resultEqualityCheck:Ff}}),aU=[0,1],u_=(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=us(t,i);if(d&&l==null){var u;return L2(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?Y9(n,e,d):s==="expand"?aU:o}},Rx=Y([_r,it,Dx,Wf,Tf,Zt,nU],u_);function sU(e){return e in el}var f_=(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(nc(n));return sU(i)?i:"point"}}},jo=Y([_r,qC,kx],f_);function $x(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?z0(e.scale,r,n):z0(t,r,n)}var m_=(e,t,r)=>{var n=Tx(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Sa(e))return y9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Sa(e))return b9(e,t.tickCount,t.allowDecimals)}},zx=Y([Rx,mc,jo],m_),h_=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Sa(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},iU=Y([_r,Rx,zx,Zt],h_),oU=Y(Wf,_r,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ca(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}}),p_=Y(oU,it,DC,Xt,(e,t,r,n,s)=>s,(e,t,r,n,s)=>{if(!qe(e))return 0;var i=t==="vertical"?n.height:n.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var o=Sn(r,e*i),l=e*i/2;return l-o-(l-o)/i*o}return 0}),lU=(e,t,r)=>{var n=La(e,t);return n==null||typeof n.padding!="string"?0:p_(e,"xAxis",t,r,n.padding)},cU=(e,t,r)=>{var n=Fa(e,t);return n==null||typeof n.padding!="string"?0:p_(e,"yAxis",t,r,n.padding)},dU=Y(La,lU,(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}}),uU=Y(Fa,cU,(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}}),fU=Y([Xt,dU,jf,wf,(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]}),mU=Y([Xt,it,uU,jf,wf,(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]}),gc=(e,t,r,n)=>{var s;switch(t){case"xAxis":return fU(e,r,n);case"yAxis":return mU(e,r,n);case"zAxis":return(s=Ex(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return zC(e);case"radiusAxis":return LC(e,r);default:return}},g_=Y([_r,gc],If),hU=Y([jo,iU],E9),Uf=Y([_r,jo,hU,g_],$x);Y([hc,Ix,Zt],q9);function x_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var qf=(e,t)=>t,Hf=(e,t,r)=>r,pU=Y(yf,qf,Hf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(x_)),gU=Y(bf,qf,Hf,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(x_)),v_=(e,t)=>({width:e.width,height:t.height}),xU=(e,t)=>{var r=typeof t.width=="number"?t.width:ic;return{width:r,height:e.height}},y_=Y(Xt,La,v_),vU=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},yU=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},bU=Y(Ra,Xt,pU,qf,Hf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=v_(t,l);o==null&&(o=vU(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}),wU=Y(Ia,Xt,gU,qf,Hf,(e,t,r,n,s)=>{var i={},o;return r.forEach(l=>{var c=xU(t,l);o==null&&(o=yU(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}),jU=(e,t)=>{var r=La(e,t);if(r!=null)return bU(e,r.orientation,r.mirror)},NU=Y([Xt,La,jU,(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}}}),kU=(e,t)=>{var r=Fa(e,t);if(r!=null)return wU(e,r.orientation,r.mirror)},SU=Y([Xt,Fa,kU,(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}}}),b_=Y(Xt,Fa,(e,t)=>{var r=typeof t.width=="number"?t.width:ic;return{width:r,height:e.height}}),B0=(e,t,r)=>{switch(t){case"xAxis":return y_(e,r).width;case"yAxis":return b_(e,r).height;default:return}},w_=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:o}=r,l=us(e,n),c=t.map(d=>d.value);if(o&&l&&i==="category"&&s&&Jk(c))return c}},Lx=Y([it,Wf,_r,Zt],w_),j_=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,o=us(e,n);if(o&&(s==="number"||i!=="auto"))return t.map(l=>l.value)}},Fx=Y([it,Wf,mc,Zt],j_),W0=Y([it,R9,jo,Uf,Lx,Fx,gc,zx,Zt],(e,t,r,n,s,i,o,l,c)=>{if(t!=null){var d=us(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}}}),CU=(e,t,r,n,s,i,o,l,c)=>{if(!(t==null||n==null)){var d=us(e,c),{type:u,ticks:f,tickCount:m}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,g=u==="category"&&n.bandwidth?n.bandwidth()/p:0;g=c==="angleAxis"&&i!=null&&i.length>=2?Ar(i[0]-i[1])*2*g:g;var x=f||s;return x?x.map((v,y)=>{var w=o?o.indexOf(v):v,N=n.map(w);return qe(N)?{index:y,coordinate:N+g,value:v,offset:g}:null}).filter(Dr):d&&l?l.map((v,y)=>{var w=n.map(v);return qe(w)?{coordinate:w+g,value:v,index:y,offset:g}:null}).filter(Dr):n.ticks?n.ticks(m).map((v,y)=>{var w=n.map(v);return qe(w)?{coordinate:w+g,value:v,index:y,offset:g}:null}).filter(Dr):n.domain().map((v,y)=>{var w=n.map(v);return qe(w)?{coordinate:w+g,value:o?o[v]:v,index:y,offset:g}:null}).filter(Dr)}},N_=Y([it,mc,jo,Uf,zx,gc,Lx,Fx,Zt],CU),_U=(e,t,r,n,s,i,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=us(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Ar(n[0]-n[1])*2*d:d,l&&i?i.map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Dr):r.ticks?r.ticks(c).map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:u,index:f,offset:d}:null}).filter(Dr):r.domain().map((u,f)=>{var m=r.map(u);return qe(m)?{coordinate:m+d,value:s?s[u]:u,index:f,offset:d}:null}).filter(Dr)}},Gi=Y([it,mc,Uf,gc,Lx,Fx,Zt],_U),Vi=Y(_r,Uf,(e,t)=>{if(!(e==null||t==null))return eu(eu({},e),{},{scale:t})}),OU=Y([_r,jo,Rx,g_],$x);Y((e,t,r)=>Ex(e,r),OU,(e,t)=>{if(!(e==null||t==null))return eu(eu({},e),{},{scale:t})});var PU=Y([it,yf,bf],(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}}),k_=e=>e.options.defaultTooltipEventType,S_=e=>e.options.validateTooltipEventTypes;function C_(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Bx(e,t){var r=k_(e),n=S_(e);return C_(t,r,n)}function MU(e){return Ee(t=>Bx(t,e))}var __=(e,t)=>{var r,n=Number(t);if(!(Hn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},EU=e=>e.tooltip.settings,Ga={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},AU={itemInteraction:{click:Ga,hover:Ga},axisInteraction:{click:Ga,hover:Ga},keyboardInteraction:Ga,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}},O_=Fr({name:"tooltip",initialState:AU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:ht()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Nn(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=n)},prepare:ht()},removeTooltipEntrySettings:{reducer(e,t){var r=Nn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:ht()},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:DU,replaceTooltipEntrySettings:TU,removeTooltipEntrySettings:IU,setTooltipSettingsState:RU,setActiveMouseOverItemIndex:P_,mouseLeaveItem:$U,mouseLeaveChart:M_,setActiveClickItemIndex:zU,setMouseOverAxisIndex:E_,setMouseClickAxisIndex:LU,setSyncInteraction:lp,setKeyboardInteraction:cp}=O_.actions,FU=O_.reducer;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 Gc(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){BU(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 BU(e,t,r){return(t=WU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WU(e){var t=UU(e,"string");return typeof t=="symbol"?t:t+""}function UU(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 qU(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function HU(e){return e.index!=null}var A_=(e,t,r,n)=>{if(t==null)return Ga;var s=qU(e,t,r);if(s==null)return Ga;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(HU(s)){if(i)return Gc(Gc({},s),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Gc(Gc({},Ga),{},{coordinate:s.coordinate})};function KU(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 YU(e,t){var r=KU(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 GU(e,t,r){if(r==null||t==null)return!0;var n=lr(e,t);return n==null||!Sa(r)?!0:YU(n,r)}var Wx=(e,t,r,n)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!qe(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||GU(d,r,n)?String(c):null},D_=(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}}}},T_=(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})},I_=e=>e.options.tooltipPayloadSearcher,No=e=>e.tooltip;function q0(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 H0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q0(Object(r),!0).forEach(function(n){VU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VU(e,t,r){return(t=XU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XU(e){var t=QU(e,"string");return typeof t=="symbol"?t:t+""}function QU(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 ZU(e,t){return e??t}var R_=(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 g,{dataDefinedOnItem:x,settings:v}=p,y=ZU(x,l),w=Array.isArray(y)?n2(y,d,u):y,N=(g=v==null?void 0:v.dataKey)!==null&&g!==void 0?g:n,j=v==null?void 0:v.nameKey,k;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&o==="axis"?k=Dz(w,n,s):k=i(w,t,c,j),Array.isArray(k))k.forEach(C=>{var S=H0(H0({},v),{},{name:C.name,unit:C.unit,color:void 0,fill:void 0});m.push(Jy({tooltipEntrySettings:S,dataKey:C.dataKey,payload:C.payload,value:lr(C.payload,C.dataKey),name:C.name}))});else{var b;m.push(Jy({tooltipEntrySettings:v,dataKey:N,payload:k,value:lr(k,N),name:(b=lr(k,j))!==null&&b!==void 0?b:v==null?void 0:v.name}))}return m},f)}},Ux=Y([Ut,qC,kx],f_),JU=Y([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),eq=Y([Jt,bo],HC),ko=Y([JU,Ut,eq],KC,{memoizeOptions:{resultEqualityCheck:Bf}}),tq=Y([ko],e=>e.filter(Lf)),rq=Y([ko],VC,{memoizeOptions:{resultEqualityCheck:Bf}}),So=Y([rq,za],XC),nq=Y([tq,za,Ut],BC),qx=Y([So,Ut,ko],QC),$_=Y([Ut],Tx),aq=Y([Ut],e=>e.allowDataOverflow),z_=Y([$_,aq],wC),sq=Y([ko],e=>e.filter(Lf)),iq=Y([nq,sq,Tf,TC],JC),oq=Y([iq,za,Jt,z_],e_),lq=Y([ko],GC),cq=Y([So,Ut,lq,Ix,Jt],n_,{memoizeOptions:{resultEqualityCheck:Ff}}),dq=Y([a_,Jt,bo],wo),uq=Y([dq,Jt],o_),fq=Y([s_,Jt,bo],wo),mq=Y([fq,Jt],l_),hq=Y([i_,Jt,bo],wo),pq=Y([hq,Jt],c_),gq=Y([uq,pq,mq],tu),xq=Y([Ut,$_,z_,oq,cq,gq,it,Jt],d_),xc=Y([Ut,it,So,qx,Tf,Jt,xq],u_),vq=Y([xc,Ut,Ux],m_),yq=Y([Ut,xc,vq,Jt],h_),L_=e=>{var t=Jt(e),r=bo(e),n=!1;return gc(e,t,r,n)},F_=Y([Ut,L_],If),B_=Y([Ut,Ux,yq,F_],$x),bq=Y([it,qx,Ut,Jt],w_),wq=Y([it,qx,Ut,Jt],j_),jq=(e,t,r,n,s,i,o,l)=>{if(t){var{type:c}=t,d=us(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?Ar(s[0]-s[1])*2*f:f,d&&o?o.map((m,p)=>{var g=n.map(m);return qe(g)?{coordinate:g+f,value:m,index:p,offset:f}:null}).filter(Dr):n.domain().map((m,p)=>{var g=n.map(m);return qe(g)?{coordinate:g+f,value:i?i[m]:m,index:p,offset:f}:null}).filter(Dr)}}},Ba=Y([it,Ut,Ux,B_,L_,bq,wq,Jt],jq),Hx=Y([k_,S_,EU],(e,t,r)=>C_(r.shared,e,t)),W_=e=>e.tooltip.settings.trigger,Kx=e=>e.tooltip.settings.defaultIndex,vc=Y([No,Hx,W_,Kx],A_),Xi=Y([vc,So,pc,xc],Wx),U_=Y([Ba,Xi],__),q_=Y([vc],e=>{if(e)return e.dataKey});Y([vc],e=>{if(e)return e.graphicalItemId});var H_=Y([No,Hx,W_,Kx],T_),Nq=Y([Ia,Ra,it,Xt,Ba,Kx,H_],D_),kq=Y([vc,Nq],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Sq=Y([vc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Cq=Y([H_,Xi,za,pc,U_,I_,Hx],R_);Y([Cq],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function K0(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 Y0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K0(Object(r),!0).forEach(function(n){_q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _q(e,t,r){return(t=Oq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oq(e){var t=Pq(e,"string");return typeof t=="symbol"?t:t+""}function Pq(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 Mq=()=>Ee(Ut),Eq=()=>{var e=Mq(),t=Ee(Ba),r=Ee(B_);return Ed(!e||!r?void 0:Y0(Y0({},e),{},{scale:r}),t)};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 bi(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){Aq(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 Aq(e,t,r){return(t=Dq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dq(e){var t=Tq(e,"string");return typeof t=="symbol"?t:t+""}function Tq(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 Iq=(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}},Rq=(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 bi(bi(bi({},n),or(n.cx,n.cy,o,i)),{},{angle:i,radius:o})}var l=s.coordinate,{angle:c}=n;return bi(bi(bi({},n),or(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 $q(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 K_=(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,g=(u=r[l])===null||u===void 0?void 0:u.coordinate,x=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||g==null||x==null))if(Ar(g-p)!==Ar(x-g)){var y=[];if(Ar(x-g)===Ar(s[1]-s[0])){v=x;var w=g+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=x+s[1]-s[0];y[0]=Math.min(g,(N+g)/2),y[1]=Math.max(g,(N+g)/2)}var j=[Math.min(g,(v+g)/2),Math.max(g,(v+g)/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,x),C=Math.max(p,x);if(e>(b+g)/2&&e<=(C+g)/2){var S;return(S=r[l])===null||S===void 0?void 0:S.index}}}else if(t)for(var _=0;_<o;_++){var A=t[_];if(A!=null){var M=t[_+1],P=t[_-1];if(_===0&&M!=null&&e<=(A.coordinate+M.coordinate)/2||_===o-1&&P!=null&&e>(A.coordinate+P.coordinate)/2||_>0&&_<o-1&&P!=null&&M!=null&&e>(A.coordinate+P.coordinate)/2&&e<=(A.coordinate+M.coordinate)/2)return A.index}}return-1},zq=()=>Ee(kx),Yx=(e,t)=>t,Y_=(e,t,r)=>r,Gx=(e,t,r,n)=>n,Lq=Y(Ba,e=>cf(e,t=>t.coordinate)),Vx=Y([No,Yx,Y_,Gx],A_),Xx=Y([Vx,So,pc,xc],Wx),Fq=(e,t,r)=>{if(t!=null){var n=No(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},G_=Y([No,Yx,Y_,Gx],T_),ru=Y([Ia,Ra,it,Xt,Ba,Gx,G_],D_),Bq=Y([Vx,ru],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),V_=Y([Ba,Xx],__),Wq=Y([G_,Xx,za,pc,V_,I_,Yx],R_),Uq=Y([Vx,Xx],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qq=(e,t,r,n,s,i,o)=>{if(!(!e||!r||!n||!s)&&$q(e,o)){var l=PF(e,t),c=K_(l,i,s,r,n),d=Iq(t,s,c,e);return{activeIndex:String(c),activeCoordinate:d}}},Hq=(e,t,r,n,s,i,o)=>{if(!(!e||!n||!s||!i||!r)){var l=DB(e,r);if(l){var c=MF(l,t),d=K_(c,o,i,n,s),u=Rq(t,i,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},Kq=(e,t,r,n,s,i,o,l)=>{if(!(!e||!t||!n||!s||!i))return t==="horizontal"||t==="vertical"?qq(e,t,n,s,i,o,l):Hq(e,t,r,n,s,i,o)},Yq=Y(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}}),Gq=Y(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(jr)),r=Array.from(new Set(t));return r.sort((n,s)=>n-s)},{memoizeOptions:{resultEqualityCheck:P9}});function V0(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 X0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V0(Object(r),!0).forEach(function(n){Vq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V0(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)}var Zq={},Jq={zIndexMap:Object.values(jr).reduce((e,t)=>X0(X0({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Zq)},eH=new Set(Object.values(jr));function tH(e){return eH.has(e)}var X_=Fr({name:"zIndex",initialState:Jq,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:ht()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!tH(r)&&delete e.zIndexMap[r])},prepare:ht()},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:ht()},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:ht()}}}),{registerZIndexPortal:rH,unregisterZIndexPortal:nH,registerZIndexPortalElement:aH,unregisterZIndexPortalElement:sH}=X_.actions,iH=X_.reducer;function Wa(e){var{zIndex:t,children:r}=e,n=a8(),s=n&&t!==void 0&&t!==0,i=Br(),o=Mt();h.useLayoutEffect(()=>s?(o(rH({zIndex:t})),()=>{o(nH({zIndex:t}))}):po,[o,t,s]);var l=Ee(c=>Yq(c,t,i));return s?l?Op.createPortal(r,l):null:r}function dp(){return dp=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},dp.apply(null,arguments)}function Q0(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 Vc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q0(Object(r),!0).forEach(function(n){oH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oH(e,t,r){return(t=lH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lH(e){var t=cH(e,"string");return typeof t=="symbol"?t:t+""}function cH(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 dH(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return h.isValidElement(t)?h.cloneElement(t,n):h.createElement(r,n)}function uH(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 g,x,v;if(u==="ScatterChart")g=f,x=K8,v=jr.cursorLine;else if(u==="BarChart")g=Y8(l,f,i,o),x=A2,v=jr.cursorRectangle;else if(l==="radial"&&rS(f)){var{cx:y,cy:w,radius:N,startAngle:j,endAngle:k}=D2(f);g={cx:y,cy:w,startAngle:j,endAngle:k,innerRadius:N,outerRadius:N},x=I2,v=jr.cursorLine}else g={points:$B(l,f,i)},x=_2,v=jr.cursorLine;var b=typeof c=="object"&&"className"in c?c.className:void 0,C=Vc(Vc(Vc(Vc({stroke:"#ccc",pointerEvents:"none"},i),g),Ng(c)),{},{payload:m,payloadIndex:p,className:st("recharts-tooltip-cursor",b)});return h.createElement(Wa,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:v},h.createElement(dH,{cursor:c,cursorComp:x,cursorProps:C}))}function fH(e){var t=Eq(),r=h2(),n=go(),s=zq();return t==null||r==null||n==null||s==null?null:h.createElement(uH,dp({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:s}))}var Q_=h.createContext(null),mH=()=>h.useContext(Q_),Z_={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),g=r?r+d:d;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=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,g=new Array(p);m<p;m++)g[m]=f[m].fn;return g},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,g){var x=r?r+d:d;if(!this._events[x])return!1;var v=this._events[x],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,g),!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 g=this._events[p];if(g.fn)g.fn===u&&(!m||g.once)&&(!f||g.context===f)&&o(this,p);else{for(var x=0,v=[],y=g.length;x<y;x++)(g[x].fn!==u||m&&!g[x].once||f&&g[x].context!==f)&&v.push(g[x]);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})(Z_);var hH=Z_.exports;const pH=Oa(hH);var Sl=new pH,up="recharts.syncEvent.tooltip",Z0="recharts.syncEvent.brush",gH=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Hn(r))return e[r]}},xH={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},J_=Fr({name:"options",initialState:xH,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),vH=J_.reducer,{createEventEmitter:yH}=J_.actions;function bH(e){return e.tooltip.syncInteraction}var wH={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},eO=Fr({name:"chartData",initialState:wH,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:J0,setDataStartEndIndexes:jH,setComputedData:Xee}=eO.actions,NH=eO.reducer,kH=["x","y"];function ew(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?ew(Object(r),!0).forEach(function(n){SH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ew(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SH(e,t,r){return(t=CH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CH(e){var t=_H(e,"string");return typeof t=="symbol"?t:t+""}function _H(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 OH(e,t){if(e==null)return{};var r,n,s=PH(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 PH(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 MH(){var e=Ee(Sx),t=Ee(Cx),r=Mt(),n=Ee(IC),s=Ee(Ba),i=go(),o=Nf(),l=Ee(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return po;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:g,y:x}=p,v=OH(p,kH),{x:y,y:w,width:N,height:j}=u.payload.sourceViewBox,k=wi(wi({},v),{},{x:o.x+(N?(g-y)/N:0)*o.width,y:o.y+(j?(x-w)/j:0)*o.height});r(wi(wi({},u),{},{payload:wi(wi({},u.payload),{},{coordinate:k})}))}else r(u);return}if(s!=null){var b;if(typeof n=="function"){var C={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},S=n(s,C);b=s[S]}else n==="value"&&(b=s.find(E=>String(E.value)===u.payload.label));var{coordinate:_}=u.payload;if(b==null||u.payload.active===!1||_==null||o==null){r(lp({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:A,y:M}=_,P=Math.min(A,o.x+o.width),T=Math.min(M,o.y+o.height),D={x:i==="horizontal"?b.coordinate:P,y:i==="horizontal"?T:b.coordinate},B=lp({active:u.payload.active,coordinate:D,dataKey:u.payload.dataKey,index:String(b.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox,graphicalItemId:u.payload.graphicalItemId});r(B)}}};return Sl.on(up,c),()=>{Sl.off(up,c)}},[l,r,t,e,n,s,i,o])}function EH(){var e=Ee(Sx),t=Ee(Cx),r=Mt();h.useEffect(()=>{if(e==null)return po;var n=(s,i,o)=>{t!==o&&e===s&&r(jH(i))};return Sl.on(Z0,n),()=>{Sl.off(Z0,n)}},[r,t,e])}function AH(){var e=Mt();h.useEffect(()=>{e(yH())},[e]),MH(),EH()}function DH(e,t,r,n,s,i){var o=Ee(p=>Fq(p,e,t)),l=Ee(Cx),c=Ee(Sx),d=Ee(IC),u=Ee(bH),f=u==null?void 0:u.active,m=Nf();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var p=lp({active:i,coordinate:r,dataKey:o,index:s,label:typeof n=="number"?String(n):n,sourceViewBox:m,graphicalItemId:void 0});Sl.emit(up,c,p,l)}},[f,r,o,s,n,l,c,d,i,m])}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 rw(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){TH(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 TH(e,t,r){return(t=IH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IH(e){var t=RH(e,"string");return typeof t=="symbol"?t:t+""}function RH(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 $H(e){return e.dataKey}function zH(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(S8,t)}var nw=[],LH={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 nu(e){var t,r,n=Zr(e,LH),{active:s,allowEscapeViewBox:i,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:m,position:p,reverseDirection:g,useTranslate3d:x,wrapperStyle:v,cursor:y,shared:w,trigger:N,defaultIndex:j,portal:k,axisId:b}=n,C=Mt(),S=typeof j=="number"?String(j):j;h.useEffect(()=>{C(RU({shared:w,trigger:N,axisId:b,active:s,defaultIndex:S}))},[C,w,N,b,s,S]);var _=Nf(),A=C2(),M=MU(w),{activeIndex:P,isActive:T}=(t=Ee(F=>Uq(F,M,N,S)))!==null&&t!==void 0?t:{},D=Ee(F=>Wq(F,M,N,S)),B=Ee(F=>V_(F,M,N,S)),E=Ee(F=>Bq(F,M,N,S)),z=D,Q=mH(),K=(r=s??T)!==null&&r!==void 0?r:!1,[se,te]=hL([z,K]),U=M==="axis"?B:void 0;DH(M,N,E,U,P,K);var G=k??Q;if(G==null||_==null||M==null)return null;var J=z??nw;K||(J=nw),d&&J.length&&(J=Qz(J.filter(F=>F.value!=null&&(F.hide!==!0||n.includeHidden)),m,$H));var X=J.length>0,O=h.createElement(A8,{allowEscapeViewBox:i,animationDuration:o,animationEasing:l,isAnimationActive:u,active:K,coordinate:E,hasPayload:X,offset:f,position:p,reverseDirection:g,useTranslate3d:x,viewBox:_,wrapperStyle:v,lastBoundingBox:se,innerRef:te,hasPortalFromProps:!!k},zH(c,rw(rw({},n),{},{payload:J,label:U,active:K,activeIndex:P,coordinate:E,accessibilityLayer:A})));return h.createElement(h.Fragment,null,Op.createPortal(O,G),K&&h.createElement(fH,{cursor:y,tooltipEventType:M,coordinate:E,payload:J,index:P}))}var tO=e=>null;tO.displayName="Cell";function FH(e,t,r){return(t=BH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BH(e){var t=WH(e,"string");return typeof t=="symbol"?t:t+""}function WH(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 UH{constructor(t){FH(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 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 qH(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){HH(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 HH(e,t,r){return(t=KH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KH(e){var t=YH(e,"string");return typeof t=="symbol"?t:t+""}function YH(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 GH={cacheSize:2e3,enableCache:!0},rO=qH({},GH),sw=new UH(rO.cacheSize),VH={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},iw="recharts_measurement_span";function XH(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 ow=(e,t)=>{try{var r=document.getElementById(iw);r||(r=document.createElement("span"),r.setAttribute("id",iw),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,VH,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},il=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||_f.isSsr)return{width:0,height:0};if(!rO.enableCache)return ow(t,r);var n=XH(t,r),s=sw.get(n);if(s)return s;var i=ow(t,r);return sw.set(n,i),i},nO;function QH(e,t,r){return(t=ZH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZH(e){var t=JH(e,"string");return typeof t=="symbol"?t:t+""}function JH(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 lw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,cw=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,eK=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,tK=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,rK={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},nK=["cm","mm","pt","pc","in","Q","px"];function aK(e){return nK.includes(e)}var _i="NaN";function sK(e,t){return e*rK[t]}class ar{static parse(t){var r,[,n,s]=(r=tK.exec(t))!==null&&r!==void 0?r:[];return n==null?ar.NaN:new ar(parseFloat(n),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Hn(t)&&(this.unit=""),r!==""&&!eK.test(r)&&(this.num=NaN,this.unit=""),aK(r)&&(this.num=sK(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new ar(NaN,""):new ar(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new ar(NaN,""):new ar(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ar(NaN,""):new ar(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new ar(NaN,""):new ar(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Hn(this.num)}}nO=ar;QH(ar,"NaN",new nO(NaN,""));function aO(e){if(e==null||e.includes(_i))return _i;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,s,i]=(r=lw.exec(t))!==null&&r!==void 0?r:[],o=ar.parse(n??""),l=ar.parse(i??""),c=s==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return _i;t=t.replace(lw,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,m]=(d=cw.exec(t))!==null&&d!==void 0?d:[],p=ar.parse(u??""),g=ar.parse(m??""),x=f==="+"?p.add(g):p.subtract(g);if(x.isNaN())return _i;t=t.replace(cw,x.toString())}return t}var dw=/\(([^()]*)\)/;function iK(e){for(var t=e,r;(r=dw.exec(t))!=null;){var[,n]=r;t=t.replace(dw,aO(n))}return t}function oK(e){var t=e.replace(/\s+/g,"");return t=iK(t),t=aO(t),t}function lK(e){try{return oK(e)}catch{return _i}}function Vm(e){var t=lK(e.slice(5,-1));return t===_i?"":t}var cK=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],dK=["dx","dy","angle","className","breakAll"];function fp(){return fp=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},fp.apply(null,arguments)}function uw(e,t){if(e==null)return{};var r,n,s=uK(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 uK(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 sO=/[ \f\n\r\t\v\u2028\u2029]+/,iO=e=>{var{children:t,breakAll:r,style:n}=e;try{var s=[];Gt(t)||(r?s=t.toString().split(""):s=t.toString().split(sO));var i=s.map(l=>({word:l,width:il(l,n).width})),o=r?0:il(" ",n).width;return{wordsWithComputedWidth:i,spaceWidth:o}}catch{return null}};function fK(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var oO=(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},[]),lO=e=>e.reduce((t,r)=>t.width>r.width?t:r),mK="…",fw=(e,t,r,n,s,i,o,l)=>{var c=e.slice(0,t),d=iO({breakAll:r,style:n,children:c+mK});if(!d)return[!1,[]];var u=oO(d.wordsWithComputedWidth,i,o,l),f=u.length>s||lO(u).width>Number(i);return[f,u]},hK=(e,t,r,n,s)=>{var{maxLines:i,children:o,style:l,breakAll:c}=e,d=ke(i),u=String(o),f=oO(t,n,r,s);if(!d||s)return f;var m=f.length>i||lO(f).width>Number(n);if(!m)return f;for(var p=0,g=u.length-1,x=0,v;p<=g&&x<=u.length-1;){var y=Math.floor((p+g)/2),w=y-1,[N,j]=fw(u,w,c,l,i,n,r,s),[k]=fw(u,y,c,l,i,n,r,s);if(!N&&!k&&(p=y+1),N&&k&&(g=y-1),!N&&k){v=j;break}x++}return v||f},mw=e=>{var t=Gt(e)?[]:e.toString().split(sO);return[{words:t,width:void 0}]},pK=e=>{var{width:t,scaleToFit:r,children:n,style:s,breakAll:i,maxLines:o}=e;if((t||r)&&!_f.isSsr){var l,c,d=iO({breakAll:i,children:n,style:s});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return mw(n);return hK({breakAll:i,children:n,maxLines:o,style:s},l,c,t,!!r)}return mw(n)},cO="#808080",gK={angle:0,breakAll:!1,capHeight:"0.71em",fill:cO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Qx=h.forwardRef((e,t)=>{var r=Zr(e,gK),{x:n,y:s,lineHeight:i,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=uw(r,cK),m=h.useMemo(()=>pK({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:g,angle:x,className:v,breakAll:y}=f,w=uw(f,dK);if(!Kn(n)||!Kn(s)||m.length===0)return null;var N=Number(n)+(ke(p)?p:0),j=Number(s)+(ke(g)?g:0);if(!qe(N)||!qe(j))return null;var k;switch(u){case"start":k=Vm("calc(".concat(o,")"));break;case"middle":k=Vm("calc(".concat((m.length-1)/2," * -").concat(i," + (").concat(o," / 2))"));break;default:k=Vm("calc(".concat(m.length-1," * -").concat(i,")"));break}var b=[],C=m[0];if(c&&C!=null){var S=C.width,{width:_}=f;b.push("scale(".concat(ke(_)&&ke(S)?_/S:1,")"))}return x&&b.push("rotate(".concat(x,", ").concat(N,", ").concat(j,")")),b.length&&(w.transform=b.join(" ")),h.createElement("text",fp({},ln(w),{ref:t,x:N,y:j,className:st("recharts-text",v),textAnchor:d,fill:l.includes("url")?cO:l}),m.map((A,M)=>{var P=A.words.join(y?"":" ");return h.createElement("tspan",{x:N,dy:M===0?k:i,key:"".concat(P,"-").concat(M)},P)}))});Qx.displayName="Text";function hw(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 Rn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hw(Object(r),!0).forEach(function(n){xK(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xK(e,t,r){return(t=vK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vK(e){var t=yK(e,"string");return typeof t=="symbol"?t:t+""}function yK(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 bK=e=>{var{viewBox:t,position:r,offset:n=0,parentViewBox:s}=e,{x:i,y:o,height:l,upperWidth:c,lowerWidth:d}=Gg(t),u=i,f=i+(c-d)/2,m=(u+f)/2,p=(c+d)/2,g=u+c/2,x=l>=0?1:-1,v=x*n,y=x>0?"end":"start",w=x>0?"start":"end",N=c>=0?1:-1,j=N*n,k=N>0?"end":"start",b=N>0?"start":"end",C=s;if(r==="top"){var S={x:u+c/2,y:o-v,horizontalAnchor:"middle",verticalAnchor:y};return C&&(S.height=Math.max(o-C.y,0),S.width=c),S}if(r==="bottom"){var _={x:f+d/2,y:o+l+v,horizontalAnchor:"middle",verticalAnchor:w};return C&&(_.height=Math.max(C.y+C.height-(o+l),0),_.width=d),_}if(r==="left"){var A={x:m-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return C&&(A.width=Math.max(A.x-C.x,0),A.height=l),A}if(r==="right"){var M={x:m+p+j,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"};return C&&(M.width=Math.max(C.x+C.width-M.x,0),M.height=l),M}var P=C?{width:p,height:l}:{};return r==="insideLeft"?Rn({x:m+j,y:o+l/2,horizontalAnchor:b,verticalAnchor:"middle"},P):r==="insideRight"?Rn({x:m+p-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},P):r==="insideTop"?Rn({x:u+c/2,y:o+v,horizontalAnchor:"middle",verticalAnchor:w},P):r==="insideBottom"?Rn({x:f+d/2,y:o+l-v,horizontalAnchor:"middle",verticalAnchor:y},P):r==="insideTopLeft"?Rn({x:u+j,y:o+v,horizontalAnchor:b,verticalAnchor:w},P):r==="insideTopRight"?Rn({x:u+c-j,y:o+v,horizontalAnchor:k,verticalAnchor:w},P):r==="insideBottomLeft"?Rn({x:f+j,y:o+l-v,horizontalAnchor:b,verticalAnchor:y},P):r==="insideBottomRight"?Rn({x:f+d-j,y:o+l-v,horizontalAnchor:k,verticalAnchor:y},P):r&&typeof r=="object"&&(ke(r.x)||Zs(r.x))&&(ke(r.y)||Zs(r.y))?Rn({x:i+Sn(r.x,p),y:o+Sn(r.y,l),horizontalAnchor:"end",verticalAnchor:"end"},P):Rn({x:g,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},wK=["labelRef"],jK=["content"];function pw(e,t){if(e==null)return{};var r,n,s=NK(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 NK(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 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 tl(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){kK(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 kK(e,t,r){return(t=SK(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SK(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 ca(){return ca=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},ca.apply(null,arguments)}var dO=h.createContext(null),_K=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(dO.Provider,{value:c},l)},uO=()=>{var e=h.useContext(dO),t=Nf();return e||(t?Gg(t):void 0)},OK=h.createContext(null),PK=()=>{var e=h.useContext(OK),t=Ee(FC);return e||t},MK=e=>{var{value:t,formatter:r}=e,n=Gt(e.children)?t:e.children;return typeof r=="function"?r(n):n},Zx=e=>e!=null&&typeof e=="function",EK=(e,t)=>{var r=Ar(t-e),n=Math.min(Math.abs(t-e),360);return r*n},AK=(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,g=(d+u)/2,x=EK(f,m),v=x>=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=x<=0?w:!w;var N=or(l,c,g,y),j=or(l,c,g,y+(w?1:-1)*359),k="M".concat(N.x,",").concat(N.y,`
|
|
578
|
-
A`).concat(g,",").concat(g,",0,1,").concat(w?0:1,`,
|
|
579
|
-
`).concat(j.x,",").concat(j.y),b=Gt(e.id)?fl("recharts-radial-line-"):e.id;return h.createElement("text",ca({},n,{dominantBaseline:"central",className:st("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},DK=(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}=or(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:g}=or(n,s,m,d);return{x:p,y:g,textAnchor:"middle",verticalAnchor:"middle"}},cd=e=>e!=null&&"cx"in e&&ke(e.cx),TK={angle:0,offset:5,zIndex:jr.label,position:"middle",textBreakAll:!1};function IK(e){if(!cd(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 Ya(e){var t=Zr(e,TK),{viewBox:r,parentViewBox:n,position:s,value:i,children:o,content:l,className:c="",textBreakAll:d,labelRef:u}=t,f=PK(),m=uO(),p=s==="center"?m:f??m,g,x,v;r==null?g=p:cd(r)?g=r:g=Gg(r);var y=IK(g);if(!g||Gt(i)&&Gt(o)&&!h.isValidElement(l)&&typeof l!="function")return null;var w=tl(tl({},t),{},{viewBox:g});if(h.isValidElement(l)){var{labelRef:N}=w,j=pw(w,wK);return h.cloneElement(l,j)}if(typeof l=="function"){var{content:k}=w,b=pw(w,jK);if(x=h.createElement(l,b),h.isValidElement(x))return x}else x=MK(t);var C=ln(t);if(cd(g)){if(s==="insideStart"||s==="insideEnd"||s==="end")return AK(t,s,x,C,g);v=DK(g,t.offset,t.position)}else{if(!y)return null;var S=bK({viewBox:y,position:s,offset:t.offset,parentViewBox:cd(n)?void 0:n});v=tl(tl({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width!==void 0?{width:S.width}:{}),S.height!==void 0?{height:S.height}:{})}return h.createElement(Wa,{zIndex:t.zIndex},h.createElement(Qx,ca({ref:u,className:st("recharts-label",c)},C,v,{textAnchor:fK(C.textAnchor)?C.textAnchor:v.textAnchor,breakAll:d}),x))}Ya.displayName="Label";var RK=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(Ya,ca({key:"label-implicit"},n)):Kn(e)?h.createElement(Ya,ca({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===Ya?h.cloneElement(e,tl({key:"label-implicit"},n)):h.createElement(Ya,ca({key:"label-implicit",content:e},n)):Zx(e)?h.createElement(Ya,ca({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(Ya,ca({},e,{key:"label-implicit"},n)):null};function $K(e){var{label:t,labelRef:r}=e,n=uO();return RK(t,n,r)||null}var fO={},mO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(mO);var hO={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(hO);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mO,r=hO,n=of;function s(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(fO);var zK=fO.last;const LK=Oa(zK);var FK=["valueAccessor"],BK=["dataKey","clockWise","id","textBreakAll","zIndex"];function au(){return au=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},au.apply(null,arguments)}function xw(e,t){if(e==null)return{};var r,n,s=WK(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 WK(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 UK=e=>Array.isArray(e.value)?LK(e.value):e.value,pO=h.createContext(void 0),qK=pO.Provider,gO=h.createContext(void 0);gO.Provider;function HK(){return h.useContext(pO)}function KK(){return h.useContext(gO)}function dd(e){var{valueAccessor:t=UK}=e,r=xw(e,FK),{dataKey:n,clockWise:s,id:i,textBreakAll:o,zIndex:l}=r,c=xw(r,BK),d=HK(),u=KK(),f=d||u;return!f||!f.length?null:h.createElement(Wa,{zIndex:l??jr.label},h.createElement(ba,{className:"recharts-label-list"},f.map((m,p)=>{var g,x=Gt(n)?t(m,p):lr(m.payload,n),v=Gt(i)?{}:{id:"".concat(i,"-").concat(p)};return h.createElement(Ya,au({key:"label-".concat(p)},ln(m),c,v,{fill:(g=r.fill)!==null&&g!==void 0?g:m.fill,parentViewBox:m.parentViewBox,value:x,textBreakAll:o,viewBox:m.viewBox,index:p,zIndex:0}))})))}dd.displayName="LabelList";function YK(e){var{label:t}=e;return t?t===!0?h.createElement(dd,{key:"labelList-implicit"}):h.isValidElement(t)||Zx(t)?h.createElement(dd,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(dd,au({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var GK={radiusAxis:{},angleAxis:{}},xO=Fr({name:"polarAxis",initialState:GK,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:Qee,removeRadiusAxis:Zee,addAngleAxis:Jee,removeAngleAxis:ete}=xO.actions,VK=xO.reducer;function XK(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var vO={exports:{}},ot={};/**
|
|
580
|
-
* @license React
|
|
581
|
-
* react-is.production.js
|
|
582
|
-
*
|
|
583
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
584
|
-
*
|
|
585
|
-
* This source code is licensed under the MIT license found in the
|
|
586
|
-
* LICENSE file in the root directory of this source tree.
|
|
587
|
-
*/var Jx=Symbol.for("react.transitional.element"),ev=Symbol.for("react.portal"),Kf=Symbol.for("react.fragment"),Yf=Symbol.for("react.strict_mode"),Gf=Symbol.for("react.profiler"),Vf=Symbol.for("react.consumer"),Xf=Symbol.for("react.context"),Qf=Symbol.for("react.forward_ref"),Zf=Symbol.for("react.suspense"),Jf=Symbol.for("react.suspense_list"),em=Symbol.for("react.memo"),tm=Symbol.for("react.lazy"),QK=Symbol.for("react.view_transition"),ZK=Symbol.for("react.client.reference");function fn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Jx:switch(e=e.type,e){case Kf:case Gf:case Yf:case Zf:case Jf:case QK:return e;default:switch(e=e&&e.$$typeof,e){case Xf:case Qf:case tm:case em:return e;case Vf:return e;default:return t}}case ev:return t}}}ot.ContextConsumer=Vf;ot.ContextProvider=Xf;ot.Element=Jx;ot.ForwardRef=Qf;ot.Fragment=Kf;ot.Lazy=tm;ot.Memo=em;ot.Portal=ev;ot.Profiler=Gf;ot.StrictMode=Yf;ot.Suspense=Zf;ot.SuspenseList=Jf;ot.isContextConsumer=function(e){return fn(e)===Vf};ot.isContextProvider=function(e){return fn(e)===Xf};ot.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jx};ot.isForwardRef=function(e){return fn(e)===Qf};ot.isFragment=function(e){return fn(e)===Kf};ot.isLazy=function(e){return fn(e)===tm};ot.isMemo=function(e){return fn(e)===em};ot.isPortal=function(e){return fn(e)===ev};ot.isProfiler=function(e){return fn(e)===Gf};ot.isStrictMode=function(e){return fn(e)===Yf};ot.isSuspense=function(e){return fn(e)===Zf};ot.isSuspenseList=function(e){return fn(e)===Jf};ot.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kf||e===Gf||e===Yf||e===Zf||e===Jf||typeof e=="object"&&e!==null&&(e.$$typeof===tm||e.$$typeof===em||e.$$typeof===Xf||e.$$typeof===Vf||e.$$typeof===Qf||e.$$typeof===ZK||e.getModuleId!==void 0)};ot.typeOf=fn;vO.exports=ot;var JK=vO.exports,vw=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",yw=null,Xm=null,yO=e=>{if(e===yw&&Array.isArray(Xm))return Xm;var t=[];return h.Children.forEach(e,r=>{Gt(r)||(JK.isFragment(r)?t=t.concat(yO(r.props.children)):t.push(r))}),Xm=t,yw=e,t};function eY(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(s=>vw(s)):n=[vw(t)],yO(e).forEach(s=>{var i=Wi(s,"type.displayName")||Wi(s,"type.name");i&&n.indexOf(i)!==-1&&r.push(s)}),r}var bO={};(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})(bO);var tY=bO.isPlainObject;const rY=Oa(tY);var bw,ww,jw,Nw,kw;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 Cw(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){nY(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 nY(e,t,r){return(t=aY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aY(e){var t=sY(e,"string");return typeof t=="symbol"?t:t+""}function sY(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 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)}function Vo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var _w=(e,t,r,n,s)=>{var i=r-n,o;return o=Nt(bw||(bw=Vo(["M ",",",""])),e,t),o+=Nt(ww||(ww=Vo(["L ",",",""])),e+r,t),o+=Nt(jw||(jw=Vo(["L ",",",""])),e+r-i/2,t+s),o+=Nt(Nw||(Nw=Vo(["L ",",",""])),e+r-i/2-n,t+s),o+=Nt(kw||(kw=Vo(["L ",","," Z"])),e,t),o},iY={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},oY=e=>{var t=Zr(e,iY),{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,g]=h.useState(-1),x=h.useRef(s),v=h.useRef(i),y=h.useRef(o),w=h.useRef(r),N=h.useRef(n),j=Zg(e,"trapezoid-");if(h.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var D=m.current.getTotalLength();D&&g(D)}catch{}},[]),r!==+r||n!==+n||s!==+s||i!==+i||o!==+o||s===0&&i===0||o===0)return null;var k=st("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",su({},ln(t),{className:k,d:_w(r,n,s,i,o)})));var b=x.current,C=v.current,S=y.current,_=w.current,A=N.current,M="0px ".concat(p===-1?1:p,"px"),P="".concat(p,"px 0px"),T=O2(["strokeDasharray"],d,c);return h.createElement(Qg,{animationId:j,key:j,canBegin:p>0,duration:d,easing:c,isActive:f,begin:u},D=>{var B=sr(b,s,D),E=sr(C,i,D),z=sr(S,o,D),Q=sr(_,r,D),K=sr(A,n,D);m.current&&(x.current=B,v.current=E,y.current=z,w.current=Q,N.current=K);var se=D>0?{transition:T,strokeDasharray:P}:{strokeDasharray:M};return h.createElement("path",su({},ln(t),{className:k,d:_w(Q,K,B,E,z),ref:m,style:Cw(Cw({},se),t.style)}))})},lY=["option","shapeType","activeClassName"];function cY(e,t){if(e==null)return{};var r,n,s=dY(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 dY(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 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 iu(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){uY(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 uY(e,t,r){return(t=fY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fY(e){var t=mY(e,"string");return typeof t=="symbol"?t:t+""}function mY(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 hY(e,t){return iu(iu({},t),e)}function pY(e,t){return e==="symbols"}function Pw(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return h.createElement(A2,r);case"trapezoid":return h.createElement(oY,r);case"sector":return h.createElement(I2,r);case"symbols":if(pY(t))return h.createElement(tS,r);break;case"curve":return h.createElement(_2,r);default:return null}}function gY(e){return h.isValidElement(e)?e.props:e}function xY(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,s=cY(e,lY),i;if(h.isValidElement(t))i=h.cloneElement(t,iu(iu({},s),gY(t)));else if(typeof t=="function")i=t(s,s.index);else if(rY(t)&&typeof t!="boolean"){var o=hY(t,s);i=h.createElement(Pw,{shapeType:r,elementProps:o})}else{var l=s;i=h.createElement(Pw,{shapeType:r,elementProps:l})}return s.isActive?h.createElement(ba,{className:n},i):i}var wO=(e,t,r)=>{var n=Mt();return(s,i)=>o=>{e==null||e(s,i,o),n(P_({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},jO=e=>{var t=Mt();return(r,n)=>s=>{e==null||e(r,n,s),t($U())}},NO=(e,t,r)=>{var n=Mt();return(s,i)=>o=>{e==null||e(s,i,o),n(zU({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function vY(e){var{tooltipEntrySettings:t}=e,r=Mt(),n=Br(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(DU(t)):s.current!==t&&r(TU({prev:s.current,next:t})),s.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{s.current&&(r(IU(s.current)),s.current=null)},[r]),null}function yY(e){var{legendPayload:t}=e,r=Mt(),n=Br(),s=h.useRef(null);return h.useLayoutEffect(()=>{n||(s.current===null?r(x8(t)):s.current!==t&&r(v8({prev:s.current,next:t})),s.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{s.current&&(r(y8(s.current)),s.current=null)},[r]),null}var Qm,bY=()=>{var[e]=h.useState(()=>fl("uid-"));return e},wY=(Qm=eM.useId)!==null&&Qm!==void 0?Qm:bY;function jY(e,t){var r=wY();return t||(e?"".concat(e,"-").concat(r):r)}var NY=h.createContext(void 0),kY=e=>{var{id:t,type:r,children:n}=e,s=jY("recharts-".concat(r),t);return h.createElement(NY.Provider,{value:s},n(s))},SY={cartesianItems:[],polarItems:[]},kO=Fr({name:"graphicalItems",initialState:SY,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ht()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,s=Nn(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=n)},prepare:ht()},removeCartesianGraphicalItem:{reducer(e,t){var r=Nn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:ht()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ht()},removePolarGraphicalItem:{reducer(e,t){var r=Nn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:ht()}}}),{addCartesianGraphicalItem:CY,replaceCartesianGraphicalItem:_Y,removeCartesianGraphicalItem:OY,addPolarGraphicalItem:tte,removePolarGraphicalItem:rte}=kO.actions,PY=kO.reducer,MY=e=>{var t=Mt(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(CY(e)):r.current!==e&&t(_Y({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(OY(r.current)),r.current=null)},[t]),null},EY=h.memo(MY);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 Ew(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){AY(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 AY(e,t,r){return(t=DY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DY(e){var t=TY(e,"string");return typeof t=="symbol"?t:t+""}function TY(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 SO=0,IY={xAxis:{},yAxis:{},zAxis:{}},CO=Fr({name:"cartesianAxis",initialState:IY,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ht()},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:ht()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ht()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ht()},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:ht()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ht()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ht()},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:ht()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ht()},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]=Ew(Ew({},s),{},{width:n,widthHistory:l})}}}}),{addXAxis:RY,replaceXAxis:$Y,removeXAxis:zY,addYAxis:LY,replaceYAxis:FY,removeYAxis:BY,addZAxis:nte,replaceZAxis:ate,removeZAxis:ste,updateYAxisWidth:WY}=CO.actions,UY=CO.reducer,qY=Y([Xt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),HY=Y([qY,Ia,Ra],(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)}}),_O=()=>Ee(HY),Aw=(e,t,r)=>{var n=r??e;if(!Gt(n))return Sn(n,t,0)},KY=(e,t,r)=>{var n={},s=e.filter(Lf),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(x=>x.dataKey),g=Aw(t,r,(u=m[0])===null||u===void 0?void 0:u.barSize);return{stackId:f,dataKeys:p,barSize:g}}),c=i.map(d=>{var u=[d.dataKey].filter(m=>m!=null),f=Aw(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]};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 Xc(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){YY(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 YY(e,t,r){return(t=GY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GY(e){var t=VY(e,"string");return typeof t=="symbol"?t:t+""}function VY(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 XY(e,t,r,n,s){var i,o=n.length;if(!(o<1)){var l=Sn(e,r,0,!0),c,d=[];if(qe((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,g={offset:p-l,size:0};c=n.reduce((w,N)=>{var j,k={stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:g.offset+g.size+l,size:u?f:(j=N.barSize)!==null&&j!==void 0?j:0}},b=[...w,k];return g=k.position,b},d)}else{var x=Sn(t,r,0,!0);r-2*x-(o-1)*l<=0&&(l=0);var v=(r-2*x-(o-1)*l)/o;v>1&&(v>>=0);var y=qe(s)?Math.min(v,s):v;c=n.reduce((w,N,j)=>[...w,{stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:x+(v+l)*j+(v-y)/2,size:y}}],d)}return c}}var QY=(e,t,r,n,s,i,o)=>{var l=Gt(o)?t:o,c=XY(r,n,s!==i?s:i,e,l);return s!==i&&c!=null&&(c=c.map(d=>Xc(Xc({},d),{},{position:Xc(Xc({},d.position),{},{offset:d.position.offset-s/2})}))),c},ZY=(e,t)=>{var r=Mx(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)}}}},JY=(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 eG(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&qe(e.zIndex)?e.zIndex:t}var tG=e=>{var{chartData:t}=e,r=Mt(),n=Br();return h.useEffect(()=>n?()=>{}:(r(J0(t)),()=>{r(J0(void 0))}),[t,r,n]),null},Tw={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},OO=Fr({name:"brush",initialState:Tw,reducers:{setBrushSettings(e,t){return t.payload==null?Tw:t.payload}}}),{setBrushSettings:ite}=OO.actions,rG=OO.reducer;function nG(e){return(e%180+180)%180}var aG=function(t){var{width:r,height:n}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=nG(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)},sG={dots:[],areas:[],lines:[]},PO=Fr({name:"referenceElements",initialState:sG,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Nn(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=Nn(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=Nn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:ote,removeDot:lte,addArea:cte,removeArea:dte,addLine:ute,removeLine:fte}=PO.actions,iG=PO.reducer,oG=h.createContext(void 0),lG=e=>{var{children:t}=e,[r]=h.useState("".concat(fl("recharts"),"-clip")),n=_O();if(n==null)return null;var{x:s,y:i,width:o,height:l}=n;return h.createElement(oG.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 MO(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 cG(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return aG(n,r)}function dG(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 Cl(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 uG(e,t){return MO(e,t+1)}function fG(e,t,r,n,s){for(var i=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:MO(n,d)};var x=c,v,y=()=>(v===void 0&&(v=r(g,x)),v),w=g.coordinate,N=c===0||Cl(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 mG(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[x];if(j==null)return 0;var k=x,b,C=()=>(b===void 0&&(b=r(j,k)),b),S=j.coordinate,_=x===u||Cl(e,S,C,f,c);if(!_)return m=!1,1;_&&(f=S+e*(C()/2+s))},g,x=u;x<o&&(g=p(),!(g!==0&&g===1));x+=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 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 dr(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){hG(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 hG(e,t,r){return(t=pG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pG(e){var t=gG(e,"string");return typeof t=="symbol"?t:t+""}function gG(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 xG(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 g=p,x,v=()=>(x===void 0&&(x=r(p,m)),x);if(m===o-1){var y=e*(g.coordinate+e*v()/2-c);i[m]=g=dr(dr({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[m]=g=dr(dr({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var w=Cl(e,g.tickCoord,v,l,c);w&&(c=g.tickCoord-e*(v()/2+s),i[m]=dr(dr({},g),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return i}function vG(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=dr(dr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate}),u.tickCoord!=null){var p=Cl(e,u.tickCoord,()=>f,c,d);p&&(d=u.tickCoord-e*(f/2+s),o[l-1]=dr(dr({},u),{},{isShow:!0}))}}}for(var g=i?l-1:l,x=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 C=e*(j.coordinate-e*b()/2-c);o[w]=j=dr(dr({},j),{},{tickCoord:C<0?j.coordinate-C*e:j.coordinate})}else o[w]=j=dr(dr({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var S=Cl(e,j.tickCoord,b,c,d);S&&(c=j.tickCoord+e*(b()/2+s),o[w]=dr(dr({},j),{},{isShow:!0}))}},v=0;v<g;v++)x(v);return o}function tv(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(ke(c)||_f.isSsr){var m;return(m=uG(s,ke(c)?c:0))!==null&&m!==void 0?m:[]}var p=[],g=l==="top"||l==="bottom"?"width":"height",x=u&&g==="width"?il(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},v=(k,b)=>{var C=typeof d=="function"?d(k.value,b):k.value;return g==="width"?cG(il(C,{fontSize:t,letterSpacing:r}),x,f):il(C,{fontSize:t,letterSpacing:r})[g]},y=s[0],w=s[1],N=s.length>=2&&y!=null&&w!=null?Ar(w.coordinate-y.coordinate):1,j=dG(i,N,g);return c==="equidistantPreserveStart"?fG(N,j,v,s,o):c==="equidistantPreserveEnd"?mG(N,j,v,s,o):(c==="preserveStart"||c==="preserveStartEnd"?p=vG(N,j,v,s,o,c==="preserveStartEnd"):p=xG(N,j,v,s,o),p.filter(k=>k.isShow))}var yG=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},bG=["axisLine","width","height","className","hide","ticks","axisType"];function wG(e,t){if(e==null)return{};var r,n,s=jG(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 jG(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 ni(){return ni=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},ni.apply(null,arguments)}function Rw(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 jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rw(Object(r),!0).forEach(function(n){NG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NG(e,t,r){return(t=kG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kG(e){var t=SG(e,"string");return typeof t=="symbol"?t:t+""}function SG(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 va={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:jr.axis};function CG(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=jt(jt(jt({},c),ya(l)),{},{fill:"none"});if(i==="top"||i==="bottom"){var u=+(i==="top"&&!o||i==="bottom"&&o);d=jt(jt({},d),{},{x1:t,y1:r+u*s,x2:t+n,y2:r+u*s})}else{var f=+(i==="left"&&!o||i==="right"&&o);d=jt(jt({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+s})}return h.createElement("line",ni({},d,{className:st("recharts-cartesian-axis-line",Wi(l,"className"))}))}function _G(e,t,r,n,s,i,o,l,c){var d,u,f,m,p,g,x=l?-1:1,v=e.tickSize||o,y=ke(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":d=u=e.coordinate,m=r+ +!l*s,f=m-x*v,g=f-x*c,p=y;break;case"left":f=m=e.coordinate,u=t+ +!l*n,d=u-x*v,p=d-x*c,g=y;break;case"right":f=m=e.coordinate,u=t+ +l*n,d=u+x*v,p=d+x*c,g=y;break;default:d=u=e.coordinate,m=r+ +l*s,f=m+x*v,g=f+x*c,p=y;break}return{line:{x1:d,y1:f,x2:u,y2:m},tick:{x:p,y:g}}}function OG(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function PG(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function MG(e){var{option:t,tickProps:r,value:n}=e,s,i=st(r.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))s=h.cloneElement(t,jt(jt({},r),{},{className:i}));else if(typeof t=="function")s=t(jt(jt({},r),{},{className:i}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=st(o,XK(t))),s=h.createElement(Qx,ni({},r,{className:o}),n)}return s}var EG=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:g,height:x,tickSize:v,tickMargin:y,fontSize:w,letterSpacing:N,getTicksConfig:j,events:k,axisType:b}=e,C=tv(jt(jt({},j),{},{ticks:r}),w,N),S=OG(u,f),_=PG(u,f),A=ya(j),M=Ng(n),P={};typeof s=="object"&&(P=s);var T=jt(jt({},A),{},{fill:"none"},P),D=C.map(z=>jt({entry:z},_G(z,m,p,g,x,u,v,f,y))),B=D.map(z=>{var{entry:Q,line:K}=z;return h.createElement(ba,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},s&&h.createElement("line",ni({},T,K,{className:st("recharts-cartesian-axis-tick-line",Wi(s,"className"))})))}),E=D.map((z,Q)=>{var K,se,{entry:te,tick:U}=z,G=jt(jt(jt(jt({verticalAnchor:_},A),{},{textAnchor:S,stroke:"none",fill:i},U),{},{index:Q,payload:te,visibleTicksCount:C.length,tickFormatter:o,padding:c},d),{},{angle:(K=(se=d==null?void 0:d.angle)!==null&&se!==void 0?se:A.angle)!==null&&K!==void 0?K:0}),J=jt(jt({},G),M);return h.createElement(ba,ni({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},Og(k,te,Q)),n&&h.createElement(MG,{option:n,tickProps:J,value:"".concat(typeof o=="function"?o(te.value,Q):te.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(b,"-ticks")},E.length>0&&h.createElement(Wa,{zIndex:jr.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(b,"-tick-labels"),ref:t},E)),B.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(b,"-tick-lines")},B))}),AG=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:s,className:i,hide:o,ticks:l,axisType:c}=e,d=wG(e,bG),[u,f]=h.useState(""),[m,p]=h.useState(""),g=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return yG({ticks:g.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=h.useCallback(v=>{if(v){var y=v.getElementsByClassName("recharts-cartesian-axis-tick-value");g.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(Wa,{zIndex:e.zIndex},h.createElement(ba,{className:st("recharts-cartesian-axis",i)},h.createElement(CG,{x:e.x,y:e.y,width:n,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:ya(e)}),h.createElement(EG,{ref:x,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(_K,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement($K,{label:e.label,labelRef:e.labelRef}),e.children)))}),rv=h.forwardRef((e,t)=>{var r=Zr(e,va);return h.createElement(AG,ni({},r,{ref:t}))});rv.displayName="CartesianAxis";var DG=["x1","y1","x2","y2","key"],TG=["offset"],IG=["xAxisId","yAxisId"],RG=["xAxisId","yAxisId"];function $w(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 fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$w(Object(r),!0).forEach(function(n){$G(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$w(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $G(e,t,r){return(t=zG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zG(e){var t=LG(e,"string");return typeof t=="symbol"?t:t+""}function LG(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 Ds(){return Ds=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},Ds.apply(null,arguments)}function ou(e,t){if(e==null)return{};var r,n,s=FG(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 FG(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 BG=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 EO(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=ou(r,DG),f=(s=ya(u))!==null&&s!==void 0?s:{},{offset:m}=f,p=ou(f,TG);n=h.createElement("line",Ds({},p,{x1:i,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function WG(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=ou(e,IG),c=s.map((d,u)=>{var f=fr(fr({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(EO,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function UG(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=ou(e,RG),c=s.map((d,u)=>{var f=fr(fr({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(EO,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function qG(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],g=p==null,x=g?s+o-f:p-f;if(x<=0)return null;var v=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:x,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 HG(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],g=p==null,x=g?s+o-f:p-f;if(x<=0)return null;var v=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:i,width:x,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 KG=(e,t)=>{var{xAxis:r,width:n,height:s,offset:i}=e;return a2(tv(fr(fr(fr({},va),r),{},{ticks:s2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.left,i.left+i.width,t)},YG=(e,t)=>{var{yAxis:r,width:n,height:s,offset:i}=e;return a2(tv(fr(fr(fr({},va),r),{},{ticks:s2(r),viewBox:{x:0,y:0,width:n,height:s}})),i.top,i.top+i.height,t)},GG={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:jr.grid};function _l(e){var t=p2(),r=g2(),n=h2(),s=fr(fr({},Zr(e,GG)),{},{x:ke(e.x)?e.x:n.left,y:ke(e.y)?e.y:n.top,width:ke(e.width)?e.width:n.width,height:ke(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,g=Br(),x=Ee(_=>W0(_,"xAxis",i,g)),v=Ee(_=>W0(_,"yAxis",o,g));if(!Yn(d)||!Yn(u)||!ke(l)||!ke(c))return null;var y=s.verticalCoordinatesGenerator||KG,w=s.horizontalCoordinatesGenerator||YG,{horizontalPoints:N,verticalPoints:j}=s;if((!N||!N.length)&&typeof w=="function"){var k=m&&m.length,b=w({yAxis:v?fr(fr({},v),{},{ticks:k?m:v.ticks}):void 0,width:t??d,height:r??u,offset:n},k?!0:f);Ad(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 C=p&&p.length,S=y({xAxis:x?fr(fr({},x),{},{ticks:C?p:x.ticks}):void 0,width:t??d,height:r??u,offset:n},C?!0:f);Ad(Array.isArray(S),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(j=S)}return h.createElement(Wa,{zIndex:s.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(BG,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),h.createElement(qG,Ds({},s,{horizontalPoints:N})),h.createElement(HG,Ds({},s,{verticalPoints:j})),h.createElement(WG,Ds({},s,{offset:n,horizontalPoints:N,xAxis:x,yAxis:v})),h.createElement(UG,Ds({},s,{offset:n,verticalPoints:j,xAxis:x,yAxis:v}))))}_l.displayName="CartesianGrid";var VG={},AO=Fr({name:"errorBars",initialState:VG,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:mte,replaceErrorBar:hte,removeErrorBar:pte}=AO.actions,XG=AO.reducer,QG=["children"];function ZG(e,t){if(e==null)return{};var r,n,s=JG(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 JG(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 eV={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},tV=h.createContext(eV);function rV(e){var{children:t}=e,r=ZG(e,QG);return h.createElement(tV.Provider,{value:r},t)}function DO(e,t){var r,n,s=Ee(d=>La(d,e)),i=Ee(d=>Fa(d,t)),o=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Ht.allowDataOverflow,l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Kt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function nV(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,s=_O(),{needClipX:i,needClipY:o,needClip:l}=DO(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 aV={};/**
|
|
588
|
-
* @license React
|
|
589
|
-
* use-sync-external-store-with-selector.production.js
|
|
590
|
-
*
|
|
591
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
592
|
-
*
|
|
593
|
-
* This source code is licensed under the MIT license found in the
|
|
594
|
-
* LICENSE file in the root directory of this source tree.
|
|
595
|
-
*/var yc=h;function sV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iV=typeof Object.is=="function"?Object.is:sV,oV=yc.useSyncExternalStore,lV=yc.useRef,cV=yc.useEffect,dV=yc.useMemo,uV=yc.useDebugValue;aV.useSyncExternalStoreWithSelector=function(e,t,r,n,s){var i=lV(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=dV(function(){function c(p){if(!d){if(d=!0,u=p,p=n(p),s!==void 0&&o.hasValue){var g=o.value;if(s(g,p))return f=g}return f=p}if(g=f,iV(u,p))return g;var x=n(p);return s!==void 0&&s(g,x)?(u=p,g):(u=p,f=x)}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=oV(e,i[0],i[1]);return cV(function(){o.hasValue=!0,o.value=l},[l]),uV(l),l};function fV(e){e()}function mV(){let e=null,t=null;return{clear(){e=null,t=null},notify(){fV(()=>{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 zw={notify(){},get:()=>[]};function hV(e,t){let r,n=zw,s=0,i=!1;function o(x){u();const v=n.subscribe(x);let y=!1;return()=>{y||(y=!0,v(),f())}}function l(){n.notify()}function c(){g.onStateChange&&g.onStateChange()}function d(){return i}function u(){s++,r||(r=e.subscribe(c),n=mV())}function f(){s--,r&&s===0&&(r(),r=void 0,n.clear(),n=zw)}function m(){i||(i=!0,u())}function p(){i&&(i=!1,f())}const g={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:m,tryUnsubscribe:p,getListeners:()=>n};return g}var pV=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gV=pV(),xV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",vV=xV(),yV=()=>gV||vV?h.useLayoutEffect:h.useEffect,bV=yV();function Lw(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function wV(e,t){if(Lw(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])||!Lw(e[r[s]],t[r[s]]))return!1;return!0}var Zm=Symbol.for("react-redux-context"),Jm=typeof globalThis<"u"?globalThis:{};function jV(){if(!h.createContext)return{};const e=Jm[Zm]??(Jm[Zm]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var NV=jV();function kV(e){const{children:t,context:r,serverState:n,store:s}=e,i=h.useMemo(()=>{const c=hV(s);return{store:s,subscription:c,getServerState:n?()=>n:void 0}},[s,n]),o=h.useMemo(()=>s.getState(),[s]);bV(()=>{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||NV;return h.createElement(l.Provider,{value:i},t)}var SV=kV,CV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function _V(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function nv(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(CV.has(n)){if(e[n]==null&&t[n]==null)continue;if(!wV(e[n],t[n]))return!1}else if(!_V(e[n],t[n]))return!1;return!0}function mi(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:SO}function hi(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:SO}var OV="Invariant failed";function PV(e,t){throw new Error(OV)}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 lu(e){return h.createElement(xY,mp({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var MV=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,s)=>{if(ke(t))return t;var i=ke(n)||Gt(n);return i?t(n,s):(i||PV(),r)}},EV=(e,t,r)=>r,AV=(e,t)=>t,bc=Y([Ax,AV],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),DV=Y([bc],e=>e==null?void 0:e.maxBarSize),TV=(e,t,r,n)=>n,IV=Y([it,Ax,mi,hi,EV],(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")),RV=(e,t,r)=>{var n=it(e),s=mi(e,t),i=hi(e,t);if(!(s==null||i==null))return n==="horizontal"?op(e,"yAxis",i,r):op(e,"xAxis",s,r)},$V=(e,t)=>{var r=it(e),n=mi(e,t),s=hi(e,t);if(!(n==null||s==null))return r==="horizontal"?B0(e,"xAxis",n):B0(e,"yAxis",s)},zV=Y([IV,j9,$V],KY),LV=(e,t,r)=>{var n,s,i=bc(e,t);if(i==null)return 0;var o=mi(e,t),l=hi(e,t);if(o==null||l==null)return 0;var c=it(e),d=AC(e),{maxBarSize:u}=i,f=Gt(u)?d:u,m,p;return c==="horizontal"?(m=Vi(e,"xAxis",o,r),p=Gi(e,"xAxis",o,r)):(m=Vi(e,"yAxis",l,r),p=Gi(e,"yAxis",l,r)),(n=(s=Ed(m,p,!0))!==null&&s!==void 0?s:f)!==null&&n!==void 0?n:0},TO=(e,t,r)=>{var n=it(e),s=mi(e,t),i=hi(e,t);if(!(s==null||i==null)){var o,l;return n==="horizontal"?(o=Vi(e,"xAxis",s,r),l=Gi(e,"xAxis",s,r)):(o=Vi(e,"yAxis",i,r),l=Gi(e,"yAxis",i,r)),Ed(o,l)}},FV=Y([zV,AC,w9,DC,LV,TO,DV],QY),BV=(e,t,r)=>{var n=mi(e,t);if(n!=null)return Vi(e,"xAxis",n,r)},WV=(e,t,r)=>{var n=hi(e,t);if(n!=null)return Vi(e,"yAxis",n,r)},UV=(e,t,r)=>{var n=mi(e,t);if(n!=null)return Gi(e,"xAxis",n,r)},qV=(e,t,r)=>{var n=hi(e,t);if(n!=null)return Gi(e,"yAxis",n,r)},HV=Y([FV,bc],JY),KV=Y([RV,bc],ZY),YV=Y([Xt,Kg,BV,WV,UV,qV,HV,it,m9,TO,KV,bc,TV],(e,t,r,n,s,i,o,l,c,d,u,f,m)=>{var{chartData:p,dataStartIndex:g,dataEndIndex:x}=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(g,x+1),y!=null)return wX({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:g})}}),GV=["index"];function hp(){return hp=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},hp.apply(null,arguments)}function VV(e,t){if(e==null)return{};var r,n,s=XV(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 XV(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 IO=h.createContext(void 0),QV=e=>{var t=h.useContext(IO);if(t!=null)return t.stackId;if(e!=null)return kF(e)},ZV=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),JV=e=>{var t=h.useContext(IO);if(t!=null){var{stackId:r}=t;return"url(#".concat(ZV(r,e),")")}},RO=e=>{var{index:t}=e,r=VV(e,GV),n=JV(t);return h.createElement(ba,hp({className:"recharts-bar-stack-layer",clipPath:n},r))},eX=["onMouseEnter","onMouseLeave","onClick"],tX=["value","background","tooltipPosition"],rX=["id"],nX=["onMouseEnter","onClick","onMouseLeave"];function _a(){return _a=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},_a.apply(null,arguments)}function Fw(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 yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fw(Object(r),!0).forEach(function(n){aX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aX(e,t,r){return(t=sX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sX(e){var t=iX(e,"string");return typeof t=="symbol"?t:t+""}function iX(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 cu(e,t){if(e==null)return{};var r,n,s=oX(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 oX(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 lX=e=>{var{dataKey:t,name:r,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:n,value:i2(r,t),payload:e}]},cX=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:po,settings:{stroke:r,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:i2(i,t),hide:o,type:c,color:s,unit:l,graphicalItemId:d}};return h.createElement(vY,{tooltipEntrySettings:u})});function dX(e){var t=Ee(Xi),{data:r,dataKey:n,background:s,allOtherBarProps:i}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=i,d=cu(i,eX),u=wO(o,n,i.id),f=jO(l),m=NO(c,n,i.id);if(!s||r==null)return null;var p=Ng(s);return h.createElement(Wa,{zIndex:eG(s,jr.barBackground)},r.map((g,x)=>{var{value:v,background:y,tooltipPosition:w}=g,N=cu(g,tX);if(!y)return null;var j=u(g,x),k=f(g,x),b=m(g,x),C=yr(yr(yr(yr(yr({option:s,isActive:String(x)===t},N),{},{fill:"#eee"},y),p),Og(d,g,x)),{},{onMouseEnter:j,onMouseLeave:k,onClick:b,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return h.createElement(lu,_a({key:"background-bar-".concat(x)},C))}))}function uX(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 yr(yr({},o),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:o,fill:i.fill})});return h.createElement(qK,{value:t?s:void 0},r)}function fX(e){var{shape:t,activeBar:r,baseProps:n,entry:s,index:i,dataKey:o}=e,l=Ee(Xi),c=Ee(q_),d=r&&String(i)===l&&(c==null||o===c),u=d?r:t;return d?h.createElement(Wa,{zIndex:jr.activeBar},h.createElement(RO,{index:i},h.createElement(lu,_a({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o})))):h.createElement(lu,_a({},n,{name:String(n.name)},s,{isActive:d,option:u,index:i,dataKey:o}))}function mX(e){var{shape:t,baseProps:r,entry:n,index:s,dataKey:i}=e;return h.createElement(lu,_a({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:s,dataKey:i}))}function hX(e){var t,{data:r,props:n}=e,s=(t=ya(n))!==null&&t!==void 0?t:{},{id:i}=s,o=cu(s,rX),{shape:l,dataKey:c,activeBar:d}=n,{onMouseEnter:u,onClick:f,onMouseLeave:m}=n,p=cu(n,nX),g=wO(u,c,i),x=jO(m),v=NO(f,c,i);return r?h.createElement(h.Fragment,null,r.map((y,w)=>h.createElement(RO,_a({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"},Og(p,y,w),{onMouseEnter:g(y,w),onMouseLeave:x(y,w),onClick:v(y,w)}),d?h.createElement(fX,{shape:l,activeBar:d,baseProps:o,entry:y,index:w,dataKey:c}):h.createElement(mX,{shape:l,baseProps:o,entry:y,index:w,dataKey:c})))):null}function pX(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=Zg(t,"recharts-bar-"),[p,g]=h.useState(!1),x=!p,v=h.useCallback(()=>{typeof d=="function"&&d(),g(!1)},[d]),y=h.useCallback(()=>{typeof u=="function"&&u(),g(!0)},[u]);return h.createElement(uX,{showLabels:x,rects:n},h.createElement(Qg,{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 yr(yr({},j),{},{x:sr(b.x,j.x,w),y:sr(b.y,j.y,w),width:sr(b.width,j.width,w),height:sr(b.height,j.height,w)});if(s==="horizontal"){var C=sr(0,j.height,w),S=sr(j.stackedBarStart,j.y,w);return yr(yr({},j),{},{y:S,height:C})}var _=sr(0,j.width,w),A=sr(j.stackedBarStart,j.x,w);return yr(yr({},j),{},{width:_,x:A})});return w>0&&(r.current=N??null),N==null?null:h.createElement(ba,null,h.createElement(hX,{props:t,data:N}))}),h.createElement(YK,{label:t.label}),t.children)}function gX(e){var t=h.useRef(null);return h.createElement(pX,{previousRectanglesRef:t,props:e})}var $O=0,xX=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:lr(e,t)}};class vX 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=st("recharts-bar",s),f=d;return h.createElement(ba,{className:u,id:d},l&&h.createElement("defs",null,h.createElement(nV,{clipPathId:f,xAxisId:i,yAxisId:o})),h.createElement(ba,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},h.createElement(dX,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),h.createElement(gX,this.props)))}}var yX={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:$O,xAxisId:0,yAxisId:0,zIndex:jr.bar};function bX(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}=DO(t,r),m=go(),p=Br(),g=eY(e.children,tO),x=Ee(w=>YV(w,e.id,p,g));if(m!=="vertical"&&m!=="horizontal")return null;var v,y=x==null?void 0:x[0];return y==null||y.height==null||y.width==null?v=0:v=m==="vertical"?y.height/2:y.width/2,h.createElement(rV,{xAxisId:t,yAxisId:r,data:x,dataPointFormatter:xX,errorBarOffset:v},h.createElement(vX,_a({},e,{layout:m,needClip:f,data:x,xAxisId:t,yAxisId:r,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function wX(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:g,dataStartIndex:x}=e,v=t==="horizontal"?l:o,y=u?v.scale.domain():null,w=SF({numericAxis:v}),N=v.scale.map(w);return f.map((j,k)=>{var b,C,S,_,A,M;if(u){var P=u[k+x];if(P==null)return null;b=yF(P,y)}else b=lr(j,r),Array.isArray(b)||(b=[w,b]);var T=MV(n,$O)(b[1],k);if(t==="horizontal"){var D,B=l.scale.map(b[0]),E=l.scale.map(b[1]);if(B==null||E==null)return null;C=Xy({axis:o,ticks:c,bandSize:i,offset:s.offset,entry:j,index:k}),S=(D=E??B)!==null&&D!==void 0?D:void 0,_=s.size;var z=B-E;if(A=Hn(z)?0:z,M={x:C,y:m.top,width:_,height:m.height},Math.abs(T)>0&&Math.abs(A)<Math.abs(T)){var Q=Ar(A||T)*(Math.abs(T)-Math.abs(A));S-=Q,A+=Q}}else{var K=o.scale.map(b[0]),se=o.scale.map(b[1]);if(K==null||se==null)return null;if(C=K,S=Xy({axis:l,ticks:d,bandSize:i,offset:s.offset,entry:j,index:k}),_=se-K,A=s.size,M={x:m.left,y:S,width:m.width,height:A},Math.abs(T)>0&&Math.abs(_)<Math.abs(T)){var te=Ar(_||T)*(Math.abs(T)-Math.abs(_));_+=te}}if(C==null||S==null||_==null||A==null)return null;var U=yr(yr({},j),{},{stackedBarStart:N,x:C,y:S,width:_,height:A,value:u?b:b[1],payload:j,background:M,tooltipPosition:{x:C+_/2,y:S+A/2},parentViewBox:g},p&&p[k]&&p[k].props);return U}).filter(Boolean)}function jX(e){var t=Zr(e,yX),r=QV(t.stackId),n=Br();return h.createElement(kY,{id:t.id,type:"bar"},s=>h.createElement(h.Fragment,null,h.createElement(yY,{legendPayload:lX(t)}),h.createElement(cX,{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(EY,{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(Wa,{zIndex:t.zIndex},h.createElement(bX,_a({},t,{id:s})))))}var Ol=h.memo(jX,nv);Ol.displayName="Bar";var NX=["domain","range"],kX=["domain","range"];function Bw(e,t){if(e==null)return{};var r,n,s=SX(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 SX(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 Ww(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 zO(e,t){if(e===t)return!0;var{domain:r,range:n}=e,s=Bw(e,NX),{domain:i,range:o}=t,l=Bw(t,kX);return!Ww(r,i)||!Ww(n,o)?!1:nv(s,l)}var CX=["type"],_X=["dangerouslySetInnerHTML","ticks","scale"],OX=["id","scale"];function pp(){return pp=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},pp.apply(null,arguments)}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 qw(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){PX(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 PX(e,t,r){return(t=MX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MX(e){var t=EX(e,"string");return typeof t=="symbol"?t:t+""}function EX(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 gp(e,t){if(e==null)return{};var r,n,s=AX(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 AX(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 DX(e){var t=Mt(),r=h.useRef(null),n=x2(),{type:s}=e,i=gp(e,CX),o=Rf(n,"xAxis",s),l=h.useMemo(()=>{if(o!=null)return qw(qw({},i),{},{type:o})},[i,o]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(RY(l)):r.current!==l&&t($Y({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(zY(r.current)),r.current=null)},[t]),null}var TX=e=>{var{xAxisId:t,className:r}=e,n=Ee(Kg),s=Br(),i="xAxis",o=Ee(y=>N_(y,i,t,s)),l=Ee(y=>y_(y,t)),c=Ee(y=>NU(y,t)),d=Ee(y=>WC(y,t));if(l==null||c==null||d==null)return null;var{dangerouslySetInnerHTML:u,ticks:f,scale:m}=e,p=gp(e,_X),{id:g,scale:x}=d,v=gp(d,OX);return h.createElement(rv,pp({},p,v,{x:c.x,y:c.y,width:l.width,height:l.height,className:st("recharts-".concat(i," ").concat(i),r),viewBox:n,ticks:o,axisType:i}))},IX={allowDataOverflow:Ht.allowDataOverflow,allowDecimals:Ht.allowDecimals,allowDuplicatedCategory:Ht.allowDuplicatedCategory,angle:Ht.angle,axisLine:va.axisLine,height:Ht.height,hide:!1,includeHidden:Ht.includeHidden,interval:Ht.interval,label:!1,minTickGap:Ht.minTickGap,mirror:Ht.mirror,orientation:Ht.orientation,padding:Ht.padding,reversed:Ht.reversed,scale:Ht.scale,tick:Ht.tick,tickCount:Ht.tickCount,tickLine:va.tickLine,tickSize:va.tickSize,type:Ht.type,xAxisId:0},RX=e=>{var t=Zr(e,IX);return h.createElement(h.Fragment,null,h.createElement(DX,{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(TX,t))},Pl=h.memo(RX,zO);Pl.displayName="XAxis";var $X=["type"],zX=["dangerouslySetInnerHTML","ticks","scale"],LX=["id","scale"];function xp(){return xp=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},xp.apply(null,arguments)}function Hw(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 Kw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hw(Object(r),!0).forEach(function(n){FX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FX(e,t,r){return(t=BX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BX(e){var t=WX(e,"string");return typeof t=="symbol"?t:t+""}function WX(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 vp(e,t){if(e==null)return{};var r,n,s=UX(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 UX(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 qX(e){var t=Mt(),r=h.useRef(null),n=x2(),{type:s}=e,i=vp(e,$X),o=Rf(n,"yAxis",s),l=h.useMemo(()=>{if(o!=null)return Kw(Kw({},i),{},{type:o})},[o,i]);return h.useLayoutEffect(()=>{l!=null&&(r.current===null?t(LY(l)):r.current!==l&&t(FY({prev:r.current,next:l})),r.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(BY(r.current)),r.current=null)},[t]),null}function HX(e){var{yAxisId:t,className:r,width:n,label:s}=e,i=h.useRef(null),o=h.useRef(null),l=Ee(Kg),c=Br(),d=Mt(),u="yAxis",f=Ee(b=>b_(b,t)),m=Ee(b=>SU(b,t)),p=Ee(b=>N_(b,u,t,c)),g=Ee(b=>UC(b,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Zx(s)||h.isValidElement(s)||g==null)){var b=i.current;if(b){var C=b.getCalculatedWidth();Math.round(f.width)!==Math.round(C)&&d(WY({id:t,width:C}))}}},[p,f,d,s,t,n,g]),f==null||m==null||g==null)return null;var{dangerouslySetInnerHTML:x,ticks:v,scale:y}=e,w=vp(e,zX),{id:N,scale:j}=g,k=vp(g,LX);return h.createElement(rv,xp({},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:st("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:p,axisType:u}))}var KX={allowDataOverflow:Kt.allowDataOverflow,allowDecimals:Kt.allowDecimals,allowDuplicatedCategory:Kt.allowDuplicatedCategory,angle:Kt.angle,axisLine:va.axisLine,hide:!1,includeHidden:Kt.includeHidden,interval:Kt.interval,label:!1,minTickGap:Kt.minTickGap,mirror:Kt.mirror,orientation:Kt.orientation,padding:Kt.padding,reversed:Kt.reversed,scale:Kt.scale,tick:Kt.tick,tickCount:Kt.tickCount,tickLine:va.tickLine,tickSize:va.tickSize,type:Kt.type,width:Kt.width,yAxisId:0},YX=e=>{var t=Zr(e,KX);return h.createElement(h.Fragment,null,h.createElement(qX,{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(HX,t))},Ml=h.memo(YX,zO);Ml.displayName="YAxis";var GX=(e,t)=>t,av=Y([GX,it,FC,Jt,F_,Ba,Lq,Xt],Kq),sv=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)}},LO=cn("mouseClick"),FO=sc();FO.startListening({actionCreator:LO,effect:(e,t)=>{var r=e.payload,n=av(t.getState(),sv(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(LU({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var yp=cn("mouseMove"),BO=sc(),Qc=null;BO.startListening({actionCreator:yp,effect:(e,t)=>{var r=e.payload;Qc!==null&&cancelAnimationFrame(Qc);var n=sv(r);Qc=requestAnimationFrame(()=>{var s=t.getState(),i=Bx(s,s.tooltip.settings.shared);if(i==="axis"){var o=av(s,n);(o==null?void 0:o.activeIndex)!=null?t.dispatch(E_({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(M_())}Qc=null})}});function VX(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 Yw={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},WO=Fr({name:"rootProps",initialState:Yw,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:Yw.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}}}),XX=WO.reducer,{updateOptions:QX}=WO.actions,ZX=null,JX={updatePolarOptions:(e,t)=>t.payload},UO=Fr({name:"polarOptions",initialState:ZX,reducers:JX}),{updatePolarOptions:gte}=UO.actions,eQ=UO.reducer,qO=cn("keyDown"),HO=cn("focus"),iv=sc();iv.startListening({actionCreator:qO,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=Wx(s,So(r),pc(r),xc(r)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Ba(r);if(i==="Enter"){var d=ru(r,"axis","hover",String(s.index));t.dispatch(cp({active:!s.active,activeIndex:s.index,activeCoordinate:d}));return}var u=PU(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 g=ru(r,"axis","hover",String(p));t.dispatch(cp({active:!0,activeIndex:p.toString(),activeCoordinate:g}))}}}}}});iv.startListening({actionCreator:HO,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=ru(r,"axis","hover",String(i));t.dispatch(cp({active:!0,activeIndex:i,activeCoordinate:o}))}}}});var tn=cn("externalEvent"),KO=sc(),eh=new Map;KO.startListening({actionCreator:tn,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var s=n.type,i=eh.get(s);i!==void 0&&cancelAnimationFrame(i);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:kq(l),activeDataKey:q_(l),activeIndex:Xi(l),activeLabel:U_(l),activeTooltipIndex:Xi(l),isTooltipActive:Sq(l)};r(c,n)}finally{eh.delete(s)}});eh.set(s,o)}}});var tQ=Y([No],e=>e.tooltipItemPayloads),rQ=Y([tQ,(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)}}}),YO=cn("touchMove"),GO=sc();GO.startListening({actionCreator:YO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),s=Bx(n,n.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var o=av(n,sv({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(E_({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(AF),f=(l=d.getAttribute(DF))!==null&&l!==void 0?l:void 0,m=ko(n).find(x=>x.id===f);if(u==null||m==null||f==null)return;var{dataKey:p}=m,g=rQ(n,u,f);t.dispatch(P_({activeDataKey:p,activeIndex:u,activeCoordinate:g,activeGraphicalItemId:f}))}}}});var nQ=PS({brush:rG,cartesianAxis:UY,chartData:NH,errorBars:XG,graphicalItems:PY,layout:hF,legend:b8,options:vH,polarAxis:VK,polarOptions:eQ,referenceElements:iG,rootProps:XX,tooltip:FU,zIndex:iH}),aQ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return LL({reducer:nQ,preloadedState:t,middleware:n=>{var s;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([FO.middleware,BO.middleware,iv.middleware,KO.middleware,GO.middleware])},enhancers:n=>{var s=n;return typeof n=="function"&&(s=n()),s.concat(qS({type:"raf"}))},devTools:{serialize:{replacer:VX},name:"recharts-".concat(r)}})};function sQ(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,s=Br(),i=h.useRef(null);if(s)return r;i.current==null&&(i.current=aQ(t,n));var o=$g;return h.createElement(SV,{context:o,store:i.current},r)}function iQ(e){var{layout:t,margin:r}=e,n=Mt(),s=Br();return h.useEffect(()=>{s||(n(uF(t)),n(dF(r)))},[n,s,t,r]),null}var oQ=h.memo(iQ,nv);function lQ(e){var t=Mt();return h.useEffect(()=>{t(QX(e))},[t,e]),null}function Gw(e){var{zIndex:t,isPanorama:r}=e,n=h.useRef(null),s=Mt();return h.useLayoutEffect(()=>(n.current&&s(aH({zIndex:t,element:n.current,isPanorama:r})),()=>{s(sH({zIndex:t,isPanorama:r}))}),[s,t,r]),h.createElement("g",{tabIndex:-1,ref:n})}function Vw(e){var{children:t,isPanorama:r}=e,n=Ee(Gq);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(Gw,{key:o,zIndex:o,isPanorama:r})),t,i.map(o=>h.createElement(Gw,{key:o,zIndex:o,isPanorama:r})))}var cQ=["children"];function dQ(e,t){if(e==null)return{};var r,n,s=uQ(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 uQ(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 du(){return du=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},du.apply(null,arguments)}var fQ={width:"100%",height:"100%",display:"block"},mQ=h.forwardRef((e,t)=>{var r=p2(),n=g2(),s=C2();if(!Yn(r)||!Yn(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(Tk,du({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:fQ,ref:t}),i)}),hQ=e=>{var{children:t}=e,r=Ee(jf);if(!r)return null;var{width:n,height:s,y:i,x:o}=r;return h.createElement(Tk,{width:n,height:s,x:o,y:i},t)},Xw=h.forwardRef((e,t)=>{var{children:r}=e,n=dQ(e,cQ),s=Br();return s?h.createElement(hQ,null,h.createElement(Vw,{isPanorama:!0},r)):h.createElement(mQ,du({ref:t},n),h.createElement(Vw,{isPanorama:!1},r))});function pQ(){var e=Mt(),[t,r]=h.useState(null),n=Ee(EF);return h.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;qe(i)&&i!==n&&e(mF(i))}},[t,e,n]),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 gQ(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){xQ(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 xQ(e,t,r){return(t=vQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vQ(e){var t=yQ(e,"string");return typeof t=="symbol"?t:t+""}function yQ(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 ts(){return ts=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},ts.apply(null,arguments)}var bQ=()=>(AH(),null);function uu(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var wQ=h.forwardRef((e,t)=>{var r,n,s=h.useRef(null),[i,o]=h.useState({containerWidth:uu((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:uu((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=g=>{var x=g[0];if(x!=null){var{width:v,height:y}=x.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(oc,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",ts({ref:c},e)))}),jQ=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[s,i]=h.useState({containerWidth:uu(r),containerHeight:uu(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(oc,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",ts({ref:l},e)))}),NQ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(oc,{width:r,height:n}),h.createElement("div",ts({ref:t},e)))}),kQ=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?h.createElement(jQ,ts({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(NQ,ts({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(oc,{width:r,height:n}),h.createElement("div",ts({ref:t},e)))});function SQ(e){return e?wQ:kQ}var CQ=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:g,onTouchStart:x,style:v,width:y,responsive:w,dispatchTouchEvents:N=!0}=e,j=h.useRef(null),k=Mt(),[b,C]=h.useState(null),[S,_]=h.useState(null),A=pQ(),M=Yg(),P=(M==null?void 0:M.width)>0?M.width:y,T=(M==null?void 0:M.height)>0?M.height:s,D=h.useCallback(W=>{A(W),typeof t=="function"&&t(W),C(W),_(W),W!=null&&(j.current=W)},[A,t,C,_]),B=h.useCallback(W=>{k(LO(W)),k(tn({handler:i,reactEvent:W}))},[k,i]),E=h.useCallback(W=>{k(yp(W)),k(tn({handler:d,reactEvent:W}))},[k,d]),z=h.useCallback(W=>{k(M_()),k(tn({handler:u,reactEvent:W}))},[k,u]),Q=h.useCallback(W=>{k(yp(W)),k(tn({handler:f,reactEvent:W}))},[k,f]),K=h.useCallback(()=>{k(HO())},[k]),se=h.useCallback(W=>{k(qO(W.key))},[k]),te=h.useCallback(W=>{k(tn({handler:o,reactEvent:W}))},[k,o]),U=h.useCallback(W=>{k(tn({handler:l,reactEvent:W}))},[k,l]),G=h.useCallback(W=>{k(tn({handler:c,reactEvent:W}))},[k,c]),J=h.useCallback(W=>{k(tn({handler:m,reactEvent:W}))},[k,m]),X=h.useCallback(W=>{k(tn({handler:x,reactEvent:W}))},[k,x]),O=h.useCallback(W=>{N&&k(YO(W)),k(tn({handler:g,reactEvent:W}))},[k,N,g]),F=h.useCallback(W=>{k(tn({handler:p,reactEvent:W}))},[k,p]),ae=SQ(w);return h.createElement(Q_.Provider,{value:b},h.createElement(X6.Provider,{value:S},h.createElement(ae,{width:P??(v==null?void 0:v.width),height:T??(v==null?void 0:v.height),className:st("recharts-wrapper",n),style:gQ({position:"relative",cursor:"default",width:P,height:T},v),onClick:B,onContextMenu:te,onDoubleClick:U,onFocus:K,onKeyDown:se,onMouseDown:G,onMouseEnter:E,onMouseLeave:z,onMouseMove:Q,onMouseUp:J,onTouchEnd:F,onTouchMove:O,onTouchStart:X,ref:D},h.createElement(bQ,null),r)))}),_Q=["width","height","responsive","children","className","style","compact","title","desc"];function OQ(e,t){if(e==null)return{};var r,n,s=PQ(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 PQ(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 MQ=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=OQ(e,_Q),m=ya(f);return c?h.createElement(h.Fragment,null,h.createElement(oc,{width:r,height:n}),h.createElement(Xw,{otherAttributes:m,title:d,desc:u},i)):h.createElement(CQ,{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(Xw,{otherAttributes:m,title:d,desc:u,ref:t},h.createElement(lG,null,i)))});function bp(){return bp=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},bp.apply(null,arguments)}var EQ={top:5,right:5,bottom:5,left:5},AQ={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:EQ,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},DQ=h.forwardRef(function(t,r){var n,s=Zr(t.categoricalChartProps,AQ),{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(sQ,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:i},h.createElement(tG,{chartData:d.data}),h.createElement(oQ,{layout:s.layout,margin:s.margin}),h.createElement(lQ,{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(MQ,bp({},s,{ref:r})))}),TQ=["axis","item"],fu=h.forwardRef((e,t)=>h.createElement(DQ,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:TQ,tooltipPayloadSearcher:gH,categoricalChartProps:e,ref:t}));const VO={all:["reporting"],timeLogs:e=>[...VO.all,"time-logs",e]};function XO(e,t){return We({queryKey:VO.timeLogs(e),queryFn:()=>{const r=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{s&&r.set(n,s)}),re.get(`/admin/reporting/time-logs?${r}`)},enabled:(t==null?void 0:t.enabled)??(Object.values(e).some(Boolean)||!!e.workspace_id)})}function mu({value:e,onChange:t,placeholder:r="Pick a date",className:n}){return a.jsxs(Ot,{children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(ee,{variant:"outline",className:R("h-8 w-36 justify-start text-left font-normal text-xs gap-1.5",!e&&"text-muted-foreground",n),children:[a.jsx(mr,{className:"h-3.5 w-3.5 shrink-0"}),e?he(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(at,{className:"h-3 w-3"})})]})}),a.jsx(kt,{className:"w-auto p-0",align:"start",children:a.jsx(hr,{mode:"single",selected:e,onSelect:t,initialFocus:!0})})]})}function wp({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(Ot,{open:i,onOpenChange:o,children:[a.jsx(Pt,{asChild:!0,children:a.jsxs(ee,{variant:"outline",role:"combobox","aria-expanded":i,className:R("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(to,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),a.jsxs(kt,{className:"w-56 p-0",align:"start",children:[a.jsxs(Ts,{children:[a.jsx(Fu,{placeholder:"Search…",className:"h-8 text-xs"}),a.jsxs(Is,{children:[a.jsx(Bu,{className:"text-xs py-4 text-center text-muted-foreground",children:"No results."}),a.jsx(Ja,{children:e.map(u=>a.jsxs(nn,{value:u.label,onSelect:()=>l(u.value),className:"text-xs cursor-pointer",children:[a.jsx(ir,{className:R("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(ee,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs text-muted-foreground",onClick:()=>r([]),children:[a.jsx(at,{className:"h-3 w-3 mr-1"}),"Clear all"]})})]})]})}function rl(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Zw({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:rl(((n=t[0])==null?void 0:n.value)??0)})]})}function IQ({workspaceId:e}){const[t,r]=h.useState(void 0),[n,s]=h.useState(void 0),[i,o]=h.useState([]),[l,c]=h.useState([]),{workspace:d}=Ie(),u=(d==null?void 0:d.slug)??"",{data:f=[],isLoading:m}=Zl(),{data:p=[],isLoading:g}=so(),{data:x}=di(),v=t?he(t,"yyyy-MM-dd"):void 0,y=n?he(n,"yyyy-MM-dd"):void 0,w=h.useMemo(()=>new Map(p.map(D=>[D.id,D])),[p]),{data:N,isLoading:j}=XO({from:v,to:y,workspace_id:e},{enabled:!0}),k=(N==null?void 0:N.time_logs)??[],b=h.useMemo(()=>{let D=k;return g||(D=D.filter(B=>!B.project_id||w.has(B.project_id))),i.length>0&&(D=D.filter(B=>i.includes(B.user_id))),l.length>0&&(D=D.filter(B=>B.project_id&&l.includes(B.project_id))),D},[k,i,l,w,g]),C=b.reduce((D,B)=>D+(B.duration_minutes??0),0),S=h.useMemo(()=>new Set(b.map(D=>D.user_id)).size,[b]),_=h.useMemo(()=>new Set(b.map(D=>D.project_id).filter(Boolean)).size,[b]),A=h.useMemo(()=>{const D=new Map;for(const B of b)D.set(B.user_id,(D.get(B.user_id)??0)+(B.duration_minutes??0));return Array.from(D.entries()).map(([B,E])=>{var z;return{name:((z=x==null?void 0:x.get(B))==null?void 0:z.name)??"Unknown",minutes:E}}).sort((B,E)=>E.minutes-B.minutes).slice(0,8)},[b,x]),M=h.useMemo(()=>{const D=new Map;for(const B of b){const E=B.project_id??"__none__";D.set(E,(D.get(E)??0)+(B.duration_minutes??0))}return Array.from(D.entries()).map(([B,E])=>{var z;return{name:B==="__none__"?"No project":((z=w.get(B))==null?void 0:z.name)??"Unknown",minutes:E}}).sort((B,E)=>E.minutes-B.minutes).slice(0,8)},[b,w]),P=h.useMemo(()=>f.map(D=>({value:D.id,label:[D.first_name,D.last_name].filter(Boolean).join(" ")||D.email})),[f]),T=h.useMemo(()=>p.map(D=>({value:D.id,label:D.name})),[p]);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(rs,{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 items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(eo,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(mu,{value:t,onChange:r,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(mu,{value:n,onChange:s,placeholder:"To"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(da,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employees"})]}),m?a.jsx(ue,{className:"h-8 w-40"}):a.jsx(wp,{options:P,selected:i,onSelectionChange:o,placeholder:"All employees",className:"w-44"}),a.jsx("div",{className:"w-px h-5 bg-border mx-1 shrink-0"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(Rr,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Projects"})]}),g?a.jsx(ue,{className:"h-8 w-40"}):a.jsx(wp,{options:T,selected:l,onSelectionChange:c,placeholder:"All projects",className:"w-44"})]}),j?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(D=>a.jsxs("div",{className:"px-6 py-4 flex items-center gap-4",children:[a.jsx(ue,{className:"h-4 w-24"}),a.jsx(ue,{className:"h-4 w-32"}),a.jsx(ue,{className:"h-4 w-48"})]},D))}):b.length===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(Xn,{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:v||y||i.length>0||l.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:rl(C)})]}),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:S})]}),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:_})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[A.length>0&&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:[a.jsx(da,{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 employee"})]}),a.jsx(Dd,{width:"100%",height:Math.max(80,A.length*36),children:a.jsxs(fu,{data:A,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(_l,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Pl,{type:"number",tickFormatter:D=>rl(D),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ml,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(nu,{content:a.jsx(Zw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(Ol,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),M.length>0&&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:[a.jsx(Rr,{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 project"})]}),a.jsx(Dd,{width:"100%",height:Math.max(80,M.length*36),children:a.jsxs(fu,{data:M,layout:"vertical",margin:{left:0,right:40,top:0,bottom:0},children:[a.jsx(_l,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Pl,{type:"number",tickFormatter:D=>rl(D),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ml,{type:"category",dataKey:"name",width:100,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(nu,{content:a.jsx(Zw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(Ol,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]})]}),a.jsx("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:b.map(D=>{var z;const B=D.project_id?w.get(D.project_id):void 0,E=((z=x==null?void 0:x.get(D.user_id))==null?void 0:z.name)??D.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:E}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:(B==null?void 0:B.name)??(D.project_id?"Unknown":"—")}),a.jsx("td",{className:"px-6 py-3",children:D.issue_identifier?a.jsx(Yr,{to:`/${u}/projects/${B==null?void 0:B.identifier}/issues/${D.issue_id}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline",children:D.issue_identifier}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[D.issue_id.slice(0,8),"…"]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground tabular-nums whitespace-nowrap",children:D.logged_date?he(new Date(D.logged_date),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground truncate max-w-xs",children:D.description??a.jsx("span",{className:"italic",children:"—"})}),a.jsx("td",{className:"px-6 py-3 text-xs text-right tabular-nums font-semibold",children:D.duration_minutes!=null?rl(D.duration_minutes):"Running…"})]},D.id)})})]})})]})]})}function Si(e){const t=Math.floor(e/60),r=e%60;return t===0?`${r}m`:r===0?`${t}h`:`${t}h ${r}m`}function Jw({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:Si(((n=t[0])==null?void 0:n.value)??0)})]})}function RQ(){const{projectKey:e,workspace:t}=Vt(),[r,n]=h.useState(void 0),[s,i]=h.useState(void 0),[o,l]=h.useState([]),{data:c}=Pa(e??""),{data:d}=di(),{data:u=[]}=Zl(),f=r?he(r,"yyyy-MM-dd"):void 0,m=s?he(s,"yyyy-MM-dd"):void 0,{data:p,isLoading:g}=XO({project_id:c==null?void 0:c.id,from:f,to:m}),x=(p==null?void 0:p.time_logs)??[],v=h.useMemo(()=>o.length>0?x.filter(S=>o.includes(S.user_id)):x,[x,o]),y=h.useMemo(()=>v.reduce((S,_)=>S+(_.duration_minutes??0),0),[v]),w=h.useMemo(()=>{const S=new Map;for(const _ of v){S.has(_.user_id)||S.set(_.user_id,{logs:[],totalMinutes:0});const A=S.get(_.user_id);A.logs.push(_),A.totalMinutes+=_.duration_minutes??0}return S},[v]),N=h.useMemo(()=>{const S=new Map;for(const _ of v){S.has(_.issue_id)||S.set(_.issue_id,{logs:[],totalMinutes:0});const A=S.get(_.issue_id);A.logs.push(_),A.totalMinutes+=_.duration_minutes??0}return S},[v]),j=Array.from(w.entries()).sort((S,_)=>_[1].totalMinutes-S[1].totalMinutes).slice(0,8).map(([S,{totalMinutes:_}])=>{var A;return{name:((A=d==null?void 0:d.get(S))==null?void 0:A.name)??"Unknown",minutes:_}}),k=Array.from(N.entries()).sort((S,_)=>_[1].totalMinutes-S[1].totalMinutes).slice(0,8).map(([S,{totalMinutes:_,logs:A}])=>{var M;return{name:((M=A[0])==null?void 0:M.issue_identifier)??S.slice(0,8),minutes:_}}),b=h.useMemo(()=>u.map(S=>({value:S.id,label:[S.first_name,S.last_name].filter(Boolean).join(" ")||S.email})),[u]),C=v.length>0;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-4 py-3 flex items-center gap-3 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(eo,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Date range"})]}),a.jsx(mu,{value:r,onChange:n,placeholder:"From"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"→"}),a.jsx(mu,{value:s,onChange:i,placeholder:"To"}),a.jsx("div",{className:"w-px h-4 bg-border"}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground shrink-0",children:[a.jsx(da,{className:"h-3.5 w-3.5"}),a.jsx("span",{className:"font-medium",children:"Employee"})]}),a.jsx(wp,{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?Si(y):"—",icon:Xn},{label:"Contributors",value:w.size>0?String(w.size):"—",icon:da},{label:"Issues tracked",value:N.size>0?String(N.size):"—",icon:ga}].map(({label:S,value:_,icon:A})=>a.jsxs("div",{className:"bg-white dark:bg-card border border-border rounded-xl px-5 py-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[a.jsx(A,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx("p",{className:"text-[11px] text-muted-foreground uppercase tracking-wider font-medium",children:S})]}),a.jsx("p",{className:"text-2xl font-bold tabular-nums",children:_})]},S))}),g?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(S=>a.jsxs("div",{className:"flex items-center gap-4 px-6 py-4",children:[a.jsx(ue,{className:"h-7 w-7 rounded-full"}),a.jsx(ue,{className:"h-4 w-40"}),a.jsx("div",{className:"flex-1"}),a.jsx(ue,{className:"h-4 w-20"})]},S))})}):c!=null&&c.id?C?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.size>0&&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:[a.jsx(da,{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.jsx(Dd,{width:"100%",height:Math.max(100,j.length*36),children:a.jsxs(fu,{data:j,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(_l,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Pl,{type:"number",tickFormatter:S=>Si(S),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ml,{type:"category",dataKey:"name",width:88,tick:{fontSize:11,fill:"hsl(var(--foreground))"},axisLine:!1,tickLine:!1}),a.jsx(nu,{content:a.jsx(Jw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(Ol,{dataKey:"minutes",fill:"#6366f1",radius:[0,4,4,0]})]})})]}),N.size>0&&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:[a.jsx(ga,{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.jsx(Dd,{width:"100%",height:Math.max(100,k.length*36),children:a.jsxs(fu,{data:k,layout:"vertical",margin:{left:0,right:32,top:0,bottom:0},children:[a.jsx(_l,{strokeDasharray:"3 3",horizontal:!1,stroke:"hsl(var(--border))"}),a.jsx(Pl,{type:"number",tickFormatter:S=>Si(S),tick:{fontSize:9,fill:"hsl(var(--muted-foreground))"},axisLine:!1,tickLine:!1}),a.jsx(Ml,{type:"category",dataKey:"name",width:64,tick:{fontSize:11,fill:"hsl(var(--foreground))",fontFamily:"monospace"},axisLine:!1,tickLine:!1}),a.jsx(nu,{content:a.jsx(Jw,{}),cursor:{fill:"hsl(var(--muted))"}}),a.jsx(Ol,{dataKey:"minutes",fill:"#818cf8",radius:[0,4,4,0]})]})})]})]}),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(da,{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((S,_)=>_[1].totalMinutes-S[1].totalMinutes).map(([S,{logs:_,totalMinutes:A}])=>{const M=d==null?void 0:d.get(S),P=new Set(_.map(T=>T.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:(M==null?void 0:M.name)??S.slice(0,8)+"…"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:P}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:Si(A)})]},S)})})]})]}),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(ga,{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((S,_)=>_[1].totalMinutes-S[1].totalMinutes).map(([S,{logs:_,totalMinutes:A}])=>{var B,E;const M=new Set(_.map(z=>z.user_id)).size,P=_.reduce((z,Q)=>Q.logged_date&&(!z||new Date(Q.logged_date)>new Date(z))?Q.logged_date:z,null),T=(B=_[0])==null?void 0:B.issue_identifier,D=(E=_[0])==null?void 0:E.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:[T?a.jsx(Yr,{to:`/${t}/projects/${e}/issues/${S}`,className:"font-mono text-xs text-indigo-600 dark:text-indigo-400 hover:underline shrink-0",children:T}):a.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[S.slice(0,8),"…"]}),D&&a.jsx("span",{className:"text-xs text-muted-foreground truncate",children:D})]})}),a.jsx("td",{className:"px-6 py-3 text-xs text-muted-foreground",children:P?he(new Date(P),"MMM d, yyyy"):"—"}),a.jsx("td",{className:"px-6 py-3 text-xs text-right text-muted-foreground tabular-nums",children:M}),a.jsx("td",{className:"px-6 py-3 text-sm text-right tabular-nums font-semibold",children:Si(A)})]},S)})})]})]})]}):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(rs,{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 $Q={share_enabled:{icon:dh,color:"text-green-600",bg:"bg-green-50 dark:bg-green-950/40",label:()=>"Enabled public link"},share_revoked:{icon:XA,color:"text-red-500",bg:"bg-red-50 dark:bg-red-950/40",label:()=>"Revoked public link"},member_added:{icon:no,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:P1,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:da,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:vD,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:cD,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:$r,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:Ls,color:"text-amber-500",bg:"bg-amber-50 dark:bg-amber-950/40",label:()=>"Updated project"},created:{icon:ct,color:"text-emerald-600",bg:"bg-emerald-50 dark:bg-emerald-950/40",label:()=>"Created project"}},zQ={icon:Nu,color:"text-zinc-500",bg:"bg-zinc-100 dark:bg-zinc-800",label:()=>"Activity"};function LQ({activity:e,userMap:t,teamMap:r}){const n=$Q[e.action]??zQ,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-center gap-4 px-6 py-4 hover:bg-muted/30 transition-colors",children:[a.jsx("div",{className:R("h-8 w-8 rounded-full flex items-center justify-center shrink-0",n.bg),children:a.jsx(s,{className:R("h-4 w-4",n.color)})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ft,{className:"h-5 w-5 shrink-0",children:a.jsx(Bt,{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})]}),d&&a.jsx("div",{className:"mt-0.5 pl-7",children:d})]}),a.jsx("time",{className:"text-xs text-muted-foreground shrink-0",children:he(new Date(e.created_at),"MMM d, yyyy · h:mm a")})]})}function FQ(){const{projectKey:e}=Vt(),{workspace:t}=Ie(),{data:r}=Pa(e??""),{data:n,isLoading:s}=lT((r==null?void 0:r.id)??""),{data:i=new Map}=di(),{data:o=[]}=Pu((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",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(ue,{className:"h-8 w-8 rounded-full shrink-0"}),a.jsxs("div",{className:"flex-1 space-y-1.5",children:[a.jsx(ue,{className:"h-4 w-48"}),a.jsx(ue,{className:"h-3 w-64"})]}),a.jsx(ue,{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(Nu,{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(LQ,{activity:d,userMap:i,teamMap:l},d.id))})]})})}function QO(){return We({queryKey:["me"],queryFn:()=>re.get("/admin/users/me")})}function BQ(){const e=Se(),{updateLocalUser:t}=Ie();return be({mutationFn:r=>re.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 WQ(){const e=Se(),{updateLocalUser:t}=Ie();return be({mutationFn:r=>{const n=new FormData;return n.append("avatar",r),re.upload("/admin/users/me/avatar",n)},onSuccess:({user:r})=>{t({avatar_url:r.avatar_url}),e.invalidateQueries({queryKey:["me"]})}})}function UQ(){const e=Se(),{updateLocalUser:t}=Ie();return be({mutationFn:()=>re.delete("/admin/users/me/avatar"),onSuccess:()=>{t({avatar_url:null}),e.invalidateQueries({queryKey:["me"]})}})}function qQ(){return be({mutationFn:()=>re.post("/admin/users/me/password/send-otp",{})})}function HQ(){const e=Se();return be({mutationFn:t=>re.post("/admin/users/me/password",t),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}function KQ(){const e=Se();return be({mutationFn:()=>re.delete("/admin/users/me/google"),onSuccess:()=>{e.invalidateQueries({queryKey:["me"]})}})}const YQ=[{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"}],GQ={mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1};function VQ({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=BI(),u=WI(),f=d.isPending||u.isPending,m=p=>{if(p.preventDefault(),!n.trim()){L.error("Holiday name is required");return}if(!i){L.error("Date is required");return}r?u.mutate({id:r.id,name:n.trim(),date:i,recurring:l},{onSuccess:()=>{L.success("Holiday updated"),t()},onError:()=>L.error("Failed to update holiday")}):d.mutate({name:n.trim(),date:i,recurring:l},{onSuccess:()=>{L.success("Holiday added"),t()},onError:()=>L.error("Failed to add holiday")})};return a.jsx(Ma,{open:e,onOpenChange:p=>!p&&t(),children:a.jsxs(Zn,{className:"sm:max-w-md",children:[a.jsxs(Ea,{children:[a.jsx(Aa,{children:r?"Edit holiday":"Add holiday"}),a.jsx(io,{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(Ae,{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(Ae,{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(ho,{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(ee,{type:"button",variant:"outline",size:"sm",onClick:t,children:"Cancel"}),a.jsx(ee,{type:"submit",size:"sm",disabled:f,children:f?r?"Saving…":"Adding…":r?"Save changes":"Add holiday"})]})]})]})})}function XQ(){const{data:e,isLoading:t}=lg(),r=FI(),n=(e==null?void 0:e.working_days)??GQ,s=(i,o)=>{const l={...n,[i]:o};r.mutate({working_days:l},{onSuccess:()=>L.success("Working days updated"),onError:()=>L.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(ue,{className:"h-8 w-full"},i))}):YQ.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:R("text-xs font-medium",l?"text-foreground":"text-muted-foreground/60"),children:l?"Working day":"Not a working day"}),a.jsx(ho,{checked:l,onCheckedChange:c=>s(i,c),disabled:r.isPending})]},i)})]})}function QQ(){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}=cg(e),u=UI(),f=()=>{o&&u.mutate(o.id,{onSuccess:()=>{L.success("Holiday removed"),l(null)},onError:()=>L.error("Failed to remove holiday")})},m=[...c].sort((p,g)=>{const x=new Date(p.date).getMonth()*100+new Date(p.date).getDate(),v=new Date(g.date).getMonth()*100+new Date(g.date).getDate();return x-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(ee,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(ct,{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(ku,{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(_n,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"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(ue,{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(g1,{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(ee,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5",onClick:()=>{i(null),n(!0)},children:[a.jsx(ct,{className:"h-3.5 w-3.5"}),"Add holiday"]})]}):m.map(p=>{const g=new Date(p.date);return a.jsxs("div",{className:"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:he(g,"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(ol,{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:a.jsxs(Xr,{children:[a.jsx(Qr,{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(cs,{className:"h-3.5 w-3.5"})})}),a.jsxs(zr,{align:"end",className:"w-36",children:[a.jsxs(bt,{className:"gap-2 cursor-pointer",onClick:()=>{i(p),n(!0)},children:[a.jsx(Ls,{className:"h-3.5 w-3.5"}),"Edit"]}),a.jsxs(bt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>l(p),children:[a.jsx($r,{className:"h-3.5 w-3.5"}),"Remove"]})]})]})})]},p.id)}),a.jsx(VQ,{open:r,onClose:()=>{n(!1),i(null)},holiday:s}),a.jsx(Fi,{open:!!o,onOpenChange:p=>!p&&l(null),children:a.jsxs(qs,{children:[a.jsxs(Hs,{children:[a.jsxs(Ys,{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(Ks,{children:[a.jsx(Xs,{children:"Cancel"}),a.jsx(Vs,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]})})]})}const ej=["super-admin","admin","member"],ZQ={"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"},tj={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 JQ({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(ir,{className:"h-3.5 w-3.5 text-emerald-500"}):a.jsx(Fp,{className:"h-3.5 w-3.5"})})}const th={"super-admin":3,admin:2,moderator:1,member:0};function eZ(){const{data:e}=QO(),t=th[(e==null?void 0:e.role)??"member"]??0,{data:r=[],isLoading:n}=Zl(),{data:s=[],isLoading:i}=NI(),{data:o=[]}=Ju(),l=Ek(),c=CI(),d=_I(),u=kI(),f=SI(),[m,p]=h.useState(null),[g,x]=h.useState(null),[v,y]=h.useState(!1),[w,N]=h.useState(""),[j,k]=h.useState("member"),b=S=>{S.preventDefault(),w.trim()&&f.mutate({email:w.trim().toLowerCase(),role:j},{onSuccess:()=>{L.success(`Invitation sent to ${w.trim()}`),y(!1),N(""),k("member")},onError:_=>L.error((_==null?void 0:_.message)??"Failed to send invitation")})},C=()=>{m&&d.mutate(m,{onSuccess:()=>{L.success("User deleted"),p(null)},onError:()=>L.error("Failed to delete 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.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"All users"}),a.jsxs(ee,{size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>y(!0),children:[a.jsx(ct,{className:"h-3.5 w-3.5"}),"Invite member"]})]}),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:"View and manage all platform users. Change a user's custom role or remove them from the system."})}),a.jsx(Ma,{open:v,onOpenChange:S=>{S||(y(!1),N(""),k("member"))},children:a.jsxs(Zn,{className:"sm:max-w-md",children:[a.jsx(Ea,{children:a.jsx(Aa,{children:"Invite member"})}),a.jsxs("form",{onSubmit:b,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(Ae,{type:"email",value:w,onChange:S=>N(S.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(Be,{value:j,onValueChange:k,children:[a.jsx(ze,{className:"h-9 text-sm",children:a.jsx(Ye,{})}),a.jsx(Le,{children:ej.map(S=>a.jsx(Ne,{value:S,className:"text-sm capitalize",children:S},S))})]})]}),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(ee,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!1),children:"Cancel"}),a.jsx(ee,{type:"submit",size:"sm",disabled:f.isPending,children:f.isPending?"Sending…":"Send invite"})]})]})]})}),a.jsxs("div",{className:"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",{})]}),n?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(S=>a.jsx(ue,{className:"h-10 w-full"},S))}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[a.jsx(da,{className:"h-8 w-8 text-muted-foreground/40 mb-3"}),a.jsx("p",{className:"text-sm font-medium",children:"No users found"})]}):r.map(S=>{var E;const _=S.first_name??"",A=S.last_name??"",M=`${_} ${A}`.trim()||S.email,P=(_[0]??A[0]??((E=S.email)==null?void 0:E[0])??"U").toUpperCase(),T=th[S.role??"member"]??0,D=S.id===(e==null?void 0:e.id),B=!D&&T<t;return a.jsxs("div",{className:"grid grid-cols-[1fr_160px_200px_40px] gap-4 items-center px-6 py-3 border-b border-border hover:bg-muted/20 transition-colors group",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:P}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("p",{className:"text-sm font-medium truncate",children:[M,D&&a.jsx("span",{className:"text-xs text-muted-foreground ml-1.5",children:"(you)"})]}),a.jsx("p",{className:"text-xs text-muted-foreground truncate",children:S.email})]})]}),a.jsxs(Be,{value:S.role??"member",disabled:!B,onValueChange:z=>c.mutate({userId:S.id,role:z},{onSuccess:()=>L.success("Global role updated"),onError:Q=>L.error((Q==null?void 0:Q.message)??"Failed to update global role")}),children:[a.jsx(ze,{className:R("h-7 text-xs w-full",!B&&"opacity-60 cursor-not-allowed"),children:a.jsx(Ye,{})}),a.jsx(Le,{children:ej.filter(z=>(th[z]??0)<t).map(z=>a.jsx(Ne,{value:z,className:"text-xs",children:a.jsx("span",{className:R("inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",ZQ[z]),children:z})},z))})]}),a.jsxs(Be,{value:S.app_role_id??"none",disabled:!B,onValueChange:z=>l.mutate({userId:S.id,appRoleId:z==="none"?null:z},{onSuccess:()=>L.success("Custom role updated"),onError:()=>L.error("Failed to update custom role")}),children:[a.jsx(ze,{className:R("h-7 text-xs w-full",!B&&"opacity-60 cursor-not-allowed"),children:a.jsx(Ye,{placeholder:"No role"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"none",className:"text-xs",children:"No role"}),o.map(z=>a.jsx(Ne,{value:z.id,className:"text-xs",children:z.name},z.id))]})]}),a.jsx("div",{className:"flex justify-end opacity-0 group-hover:opacity-100 transition-opacity",children:B&&a.jsxs(Xr,{children:[a.jsx(Qr,{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(cs,{className:"h-3.5 w-3.5"})})}),a.jsx(zr,{align:"end",className:"w-36",children:a.jsxs(bt,{className:"gap-2 cursor-pointer text-destructive focus:text-destructive",onClick:()=>p(S.id),children:[a.jsx($r,{className:"h-3.5 w-3.5"}),"Delete user"]})})]})})]},S.id)}),a.jsx("div",{className:"px-6 py-2 border-b border-border bg-muted/20 mt-2",children:a.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Invitations"})}),i?a.jsx("div",{className:"px-6 py-4 space-y-3",children:[1,2,3].map(S=>a.jsx(ue,{className:"h-8 w-full"},S))}):s.filter(S=>S.status==="pending").length===0?a.jsx("div",{className:"px-6 py-6 text-center",children:a.jsx("p",{className:"text-xs text-muted-foreground",children:"No pending invitations."})}):s.filter(S=>S.status==="pending").map(S=>{const _=`${window.location.origin}/invite/${S.token}`;return a.jsxs("div",{className:"flex items-center gap-3 px-6 py-3.5 border-b border-border hover:bg-muted/20 transition-colors group",children:[a.jsx("div",{className:"h-7 w-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:a.jsx(Wl,{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:S.email??"Shareable link"}),a.jsx("span",{className:R("inline-flex items-center text-[11px] px-1.5 py-0.5 rounded font-medium",S.role==="super-admin"?"bg-purple-50 text-purple-700 dark:bg-purple-950/30 dark:text-purple-300":S.role==="admin"?"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-300":"bg-muted text-muted-foreground"),children:S.role==="super-admin"?"Super Admin":S.role==="admin"?"Admin":"Member"}),S.workspace_name&&a.jsxs("span",{className:"text-[11px] text-muted-foreground truncate",children:["· ",S.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:_}),a.jsx(JQ,{value:_})]})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[a.jsx("span",{className:R("inline-flex items-center px-2 py-0.5 rounded text-[11px] font-medium",tj[S.status]??tj.revoked),children:S.status}),a.jsx("span",{className:"text-xs text-muted-foreground hidden sm:block",children:he(new Date(S.created_at),"MMM d")}),S.status==="pending"&&a.jsx("button",{onClick:()=>x(S),className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",title:"Revoke invitation",children:a.jsx(at,{className:"h-3.5 w-3.5"})})]})]},S.id)}),a.jsx(Fi,{open:!!m,onOpenChange:S=>!S&&p(null),children:a.jsxs(qs,{children:[a.jsxs(Hs,{children:[a.jsx(Ys,{children:"Delete this user?"}),a.jsx(Gs,{children:"This action is permanent and cannot be undone. The user will lose access immediately."})]}),a.jsxs(Ks,{children:[a.jsx(Xs,{children:"Cancel"}),a.jsx(Vs,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),a.jsx(Fi,{open:!!g,onOpenChange:S=>!S&&x(null),children:a.jsxs(qs,{children:[a.jsxs(Hs,{children:[a.jsx(Ys,{children:"Revoke this invitation?"}),a.jsxs(Gs,{children:["The invite link sent to ",a.jsx("span",{className:"font-medium",children:g==null?void 0:g.email})," will no longer work."]})]}),a.jsxs(Ks,{children:[a.jsx(Xs,{children:"Cancel"}),a.jsx(Vs,{onClick:()=>{g&&u.mutate(g.id,{onSuccess:()=>{L.success("Invitation revoked"),x(null)},onError:()=>L.error("Failed to revoke invitation")})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke"})]})]})})]})}const tZ=["working-days","holidays","members"];function rZ(){const[e,t]=Dl(),r=e.get("tab"),n=r&&tZ.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 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(g1,{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:R("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(XQ,{}),n==="holidays"&&a.jsx(QQ,{}),n==="members"&&a.jsx(eZ,{})]})]})})}const rh=e=>{let{transform:t}=e;return{...t,y:0}};function ov(){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 nZ(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 aZ(){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 Ln={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function ZO(e){return"init"in e}function jp(e){return!!e.write}function rj(e){return"v"in e||"e"in e}function hu(e){if("e"in e)throw e.e;if((Ln?"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 JO(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function eP(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 sZ=(e,t,...r)=>t.read(...r),iZ=(e,t,...r)=>t.write(...r),oZ=(e,t)=>{var r;return(r=t.INTERNAL_onInit)==null?void 0:r.call(t,e)},lZ=(e,t,r)=>{var n;return(n=t.onMount)==null?void 0:n.call(t,r)},cZ=(e,t)=>{var r;const n=Lt(e),s=n[0],i=n[6],o=n[9];if((Ln?"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},dZ=e=>{const t=Lt(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)},uZ=e=>{const t=Lt(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((Ln?"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 g of eP(m,p,r))d.has(g)||f.push(g)}for(let m=c.length-1;m>=0;--m){const[p,g]=c[m];let x=!1;for(const v of g.d.keys())if(v!==p&&s.has(v)){x=!0;break}x&&(o(e,p),l(e,p)),n.delete(p)}},Np=new WeakSet,fZ=(e,t)=>{var r,n;const s=Lt(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],g=s[16],x=s[17],v=s[20],y=s[26],w=u(e,t);if(rj(w)){if(i.has(t)&&o.get(t)!==w.n)return w;let T=!1;for(const[D,B]of w.d)if(p(e,D).n!==B){T=!0;break}if(!T)return w}let N=!0;const j=new Set(w.d.keys()),k=new Map,b=()=>{for(const T of j)k.has(T)||w.d.delete(T)},C=()=>{if(i.has(t)){const T=!l.size;x(e,t),T&&(m(e),f(e))}},S=T=>{var D;if(T===t){const E=u(e,T);if(!rj(E))if(ZO(T))v(e,T,T.init);else throw new Error("no atom init");return hu(E)}const B=p(e,T);try{return hu(B)}finally{k.set(T,B.n),w.d.set(T,B.n),pu(w.v)&&JO(t,w.v,B),i.has(t)&&((D=i.get(T))==null||D.t.add(t)),N||C()}};let _,A;const M={get signal(){return _||(_=new AbortController),_.signal},get setSelf(){return(Ln?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Ln?"production":void 0)!=="production"&&!jp(t)&&console.warn("setSelf function cannot be used with read-only atom"),!A&&jp(t)&&(A=(...T)=>{if((Ln?"production":void 0)!=="production"&&N&&console.warn("setSelf function cannot be called in sync"),!N)try{return g(e,t,...T)}finally{m(e),f(e)}}),A}},P=w.n;try{(Ln?"production":void 0)!=="production"&&Np.delete(e);const T=d(e,t,S,M);if((Ln?"production":void 0)!=="production"&&Np.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,t,T),pu(T)){y(e,T,()=>_==null?void 0:_.abort());const D=()=>{b(),C()};T.then(D,D)}else b();return(r=c.r)==null||r.call(c,t),w}catch(T){return delete w.v,w.e=T,++w.n,w}finally{N=!1,P!==w.n&&o.get(t)===P&&(o.set(t,w.n),l.add(t),(n=c.c)==null||n.call(c,t))}},mZ=(e,t)=>{const r=Lt(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 eP(l,c,n)){const u=i(e,d);s.get(d)!==u.n&&(s.set(d,u.n),o.push(d))}}},hZ=(e,t,...r)=>{const n=Lt(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],g=n[20];let x=!0;const v=w=>hu(u(e,w)),y=(w,...N)=>{var j;const k=l(e,w);try{if(w===t){if(!ZO(w))throw new Error("atom not writable");(Ln?"production":void 0)!=="production"&&Np.add(e);const b=k.n,C=N[0];g(e,w,C),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{x||(d(e),c(e))}};try{return o(e,t,v,y,...r)}finally{x=!1}},pZ=(e,t)=>{var r;const n=Lt(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,g]of f.d)if(!m.d.has(p)){const x=l(e,p);d(e,p).t.add(t),m.d.add(p),g!==x.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 g=u(e,p);g==null||g.t.delete(t)}}},gZ=(e,t)=>{var r;const n=Lt(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],g=c(e,t);let x=s.get(t);if(!x){f(e,t);for(const v of g.d.keys())p(e,v).t.add(t);if(x={l:new Set,d:new Set(g.d.keys()),t:new Set},s.set(t,x),jp(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&&(x.u=()=>{y=!0;try{N()}finally{y=!1}})}finally{y=!1}};i.add(v)}(r=o.m)==null||r.call(o,t)}return x},xZ=(e,t)=>{var r,n;const s=Lt(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 g=d(e,p);g==null||g.t.delete(t)}(n=l.u)==null||n.call(l,t);return}return f},vZ=(e,t,r)=>{const n=Lt(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())JO(t,r,s(e,d));o.v=r,delete o.e,(!l||!Object.is(c,o.v))&&(++o.n,pu(c)&&i(e,c))},yZ=(e,t)=>{const r=Lt(e)[14];return hu(r(e,t))},bZ=(e,t,...r)=>{const n=Lt(e),s=n[12],i=n[13],o=n[16];try{return o(e,t,...r)}finally{i(e),s(e)}},wZ=(e,t,r)=>{const n=Lt(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)}},jZ=(e,t,r)=>{const s=Lt(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)},NZ=(e,t)=>{const s=Lt(e)[25].get(t);s==null||s.forEach(i=>i())},tP=new WeakMap,Lt=e=>{const t=tP.get(e);if((Ln?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function kZ(e){const t=Lt(e),r=t[24];return r?r(t):t}function SZ(...e){const t={get(n){const s=Lt(t)[21];return s(t,n)},set(n,...s){const i=Lt(t)[22];return i(t,n,...s)},sub(n,s){const i=Lt(t)[23];return i(t,n,s)}},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},sZ,iZ,oZ,lZ,cZ,dZ,uZ,fZ,mZ,hZ,pZ,gZ,xZ,vZ,yZ,bZ,wZ,void 0,new WeakMap,jZ,NZ].map((n,s)=>e[s]||n);return tP.set(t,Object.freeze(r)),t}const rP={};let CZ=0;function nP(e,t){const r=`atom${++CZ}`,n={toString(){return(rP?"production":void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof e=="function"?n.read=e:(n.init=e,n.read=_Z,n.write=OZ),n}function _Z(e){return e(this)}function OZ(e,t,r){return t(this,typeof r=="function"?r(e(this)):r)}function PZ(){return SZ()}let Xo;function MZ(){return Xo||(Xo=PZ(),(rP?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Xo),globalThis.__JOTAI_DEFAULT_STORE__!==Xo&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Xo}const EZ={},AZ=h.createContext(void 0);function aP(e){return h.useContext(AZ)||MZ()}const kp=e=>typeof(e==null?void 0:e.then)=="function",Sp=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},DZ=I.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Sp(e),e)}),nh=new WeakMap,nj=(e,t,r)=>{const s=kZ(e)[26];let i=nh.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();kp(m)?(nh.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)}),nh.set(t,i)),i};function TZ(e,t){const{delay:r,unstable_promiseStatus:n=!I.use}={},s=aP(),[[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);kp(f)&&Sp(nj(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),kp(d)){const u=nj(s,d,()=>s.get(e));return n&&Sp(u),DZ(u)}return d}function IZ(e,t){const r=aP();return h.useCallback((...s)=>{if((EZ?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return r.set(e,...s)},[r,e])}function sP(e,t){return[TZ(e),IZ(e)]}var iP="Expected a function",aj=NaN,RZ="[object Symbol]",$Z=/^\s+|\s+$/g,zZ=/^[-+]0x[0-9a-f]+$/i,LZ=/^0b[01]+$/i,FZ=/^0o[0-7]+$/i,BZ=parseInt,WZ=typeof jc=="object"&&jc&&jc.Object===Object&&jc,UZ=typeof self=="object"&&self&&self.Object===Object&&self,qZ=WZ||UZ||Function("return this")(),HZ=Object.prototype,KZ=HZ.toString,YZ=Math.max,GZ=Math.min,ah=function(){return qZ.Date.now()};function VZ(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(iP);t=sj(t)||0,gu(r)&&(u=!!r.leading,f="maxWait"in r,i=f?YZ(sj(r.maxWait)||0,t):i,m="trailing"in r?!!r.trailing:m);function p(b){var C=n,S=s;return n=s=void 0,d=b,o=e.apply(S,C),o}function g(b){return d=b,l=setTimeout(y,t),u?p(b):o}function x(b){var C=b-c,S=b-d,_=t-C;return f?GZ(_,i-S):_}function v(b){var C=b-c,S=b-d;return c===void 0||C>=t||C<0||f&&S>=i}function y(){var b=ah();if(v(b))return w(b);l=setTimeout(y,x(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(ah())}function k(){var b=ah(),C=v(b);if(n=arguments,s=this,c=b,C){if(l===void 0)return g(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 XZ(e,t,r){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(iP);return gu(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),VZ(e,t,{leading:n,maxWait:t,trailing:s})}function gu(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function QZ(e){return!!e&&typeof e=="object"}function ZZ(e){return typeof e=="symbol"||QZ(e)&&KZ.call(e)==RZ}function sj(e){if(typeof e=="number")return e;if(ZZ(e))return aj;if(gu(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gu(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace($Z,"");var r=LZ.test(e);return r||FZ.test(e)?BZ(e.slice(2),r?2:8):zZ.test(e)?aj:+e}var JZ=XZ;const eJ=Oa(JZ),oP=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:R("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));oP.displayName="Card";const tJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:R("flex flex-col space-y-1.5 p-6",e),...t}));tJ.displayName="CardHeader";const rJ=h.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:R("text-2xl font-semibold leading-none tracking-tight",e),...t}));rJ.displayName="CardTitle";const nJ=h.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:R("text-sm text-muted-foreground",e),...t}));nJ.displayName="CardDescription";const aJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:R("p-6 pt-0",e),...t}));aJ.displayName="CardContent";const sJ=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:R("flex items-center p-6 pt-0",e),...t}));sJ.displayName="CardFooter";function iJ(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,...g}=f,x=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,v=h.useMemo(()=>g,Object.values(g));return a.jsx(x.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,m){var x;const p=((x=m==null?void 0:m[e])==null?void 0:x[c])||l,g=h.useContext(p);if(g)return g;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,oJ(s,...t)]}function oJ(...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 lJ(e){const t=cJ(e),r=h.forwardRef((n,s)=>{const{children:i,...o}=n,l=h.Children.toArray(i),c=l.find(uJ);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 cJ(e){const t=h.forwardRef((r,n)=>{const{children:s,...i}=r;if(h.isValidElement(s)){const o=mJ(s),l=fJ(i,s.props);return s.type!==h.Fragment&&(l.ref=n?Rj(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 dJ=Symbol("radix.slottable");function uJ(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dJ}function fJ(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 mJ(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 hJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pJ=hJ.reduce((e,t)=>{const r=lJ(`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}},{}),lv="ContextMenu",[gJ]=iJ(lv,[Fj]),Or=Fj(),[xJ,lP]=gJ(lv),cP=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:s,modal:i=!0}=e,[o,l]=h.useState(!1),c=Or(t),d=zM(n),u=h.useCallback(f=>{l(f),d(f)},[d]);return a.jsx(xJ,{scope:t,open:o,onOpenChange:u,modal:i,children:a.jsx(LM,{...c,dir:s,open:o,onOpenChange:u,modal:i,children:r})})};cP.displayName=lv;var dP="ContextMenuTrigger",uP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...s}=e,i=lP(dP,r),o=Or(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(FM,{...o,virtualRef:c}),a.jsx(pJ.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:ks(e.onContextMenu,m=>{u(),f(m),m.preventDefault()}),onPointerDown:n?e.onPointerDown:ks(e.onPointerDown,Zc(m=>{u(),d.current=window.setTimeout(()=>f(m),700)})),onPointerMove:n?e.onPointerMove:ks(e.onPointerMove,Zc(u)),onPointerCancel:n?e.onPointerCancel:ks(e.onPointerCancel,Zc(u)),onPointerUp:n?e.onPointerUp:ks(e.onPointerUp,Zc(u))})]})});uP.displayName=dP;var vJ="ContextMenuPortal",fP=e=>{const{__scopeContextMenu:t,...r}=e,n=Or(t);return a.jsx(MM,{...n,...r})};fP.displayName=vJ;var mP="ContextMenuContent",hP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=lP(mP,r),i=Or(r),o=h.useRef(!1);return a.jsx(EM,{...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)"}})});hP.displayName=mP;var yJ="ContextMenuGroup",bJ=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(BM,{...s,...n,ref:t})});bJ.displayName=yJ;var wJ="ContextMenuLabel",pP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(RM,{...s,...n,ref:t})});pP.displayName=wJ;var jJ="ContextMenuItem",gP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(AM,{...s,...n,ref:t})});gP.displayName=jJ;var NJ="ContextMenuCheckboxItem",xP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(DM,{...s,...n,ref:t})});xP.displayName=NJ;var kJ="ContextMenuRadioGroup",SJ=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(WM,{...s,...n,ref:t})});SJ.displayName=kJ;var CJ="ContextMenuRadioItem",vP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(IM,{...s,...n,ref:t})});vP.displayName=CJ;var _J="ContextMenuItemIndicator",yP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(TM,{...s,...n,ref:t})});yP.displayName=_J;var OJ="ContextMenuSeparator",bP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx($M,{...s,...n,ref:t})});bP.displayName=OJ;var PJ="ContextMenuArrow",MJ=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(UM,{...s,...n,ref:t})});MJ.displayName=PJ;var EJ="ContextMenuSubTrigger",wP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(OM,{...s,...n,ref:t})});wP.displayName=EJ;var AJ="ContextMenuSubContent",jP=h.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,s=Or(r);return a.jsx(PM,{...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)"}})});jP.displayName=AJ;function Zc(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var DJ=cP,TJ=uP,IJ=fP,NP=hP,kP=pP,SP=gP,CP=xP,_P=vP,OP=yP,PP=bP,MP=wP,EP=jP;const RJ=DJ,$J=TJ,zJ=h.forwardRef(({className:e,inset:t,children:r,...n},s)=>a.jsxs(MP,{ref:s,className:R("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(_n,{className:"ml-auto h-4 w-4"})]}));zJ.displayName=MP.displayName;const LJ=h.forwardRef(({className:e,...t},r)=>a.jsx(EP,{ref:r,className:R("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}));LJ.displayName=EP.displayName;const AP=h.forwardRef(({className:e,...t},r)=>a.jsx(IJ,{children:a.jsx(NP,{ref:r,className:R("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})}));AP.displayName=NP.displayName;const DP=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(SP,{ref:n,className:R("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}));DP.displayName=SP.displayName;const FJ=h.forwardRef(({className:e,children:t,checked:r,...n},s)=>a.jsxs(CP,{ref:s,className:R("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(OP,{children:a.jsx(ir,{className:"h-4 w-4"})})}),t]}));FJ.displayName=CP.displayName;const BJ=h.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(_P,{ref:n,className:R("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(OP,{children:a.jsx(sn,{className:"h-2 w-2 fill-current"})})}),t]}));BJ.displayName=_P.displayName;const WJ=h.forwardRef(({className:e,inset:t,...r},n)=>a.jsx(kP,{ref:n,className:R("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r}));WJ.displayName=kP.displayName;const UJ=h.forwardRef(({className:e,...t},r)=>a.jsx(PP,{ref:r,className:R("-mx-1 my-1 h-px bg-border",e),...t}));UJ.displayName=PP.displayName;const qJ=nP(!1),HJ=nP(0),cv=()=>sP(qJ),dv=()=>sP(HJ),KJ=e=>{let t=r=>1;return(e==="monthly"||e==="quarterly")&&(t=as),t},wc=e=>{let t=fN;return(e==="monthly"||e==="quarterly")&&(t=pN),t},uv=e=>{let t=a3;return(e==="monthly"||e==="quarterly")&&(t=fN),t},El=e=>{let t=$i;return(e==="monthly"||e==="quarterly")&&(t=xN),t},YJ=e=>{let t=hN;return(e==="monthly"||e==="quarterly")&&(t=ag),t},TP=e=>{let t=Ir;return(e==="monthly"||e==="quarterly")&&(t=tg),t},nl=(e,t)=>{const r=new Date(e.timelineData[0].year,0,1),n=e.columnWidth*e.zoom/100,s=Math.floor(t/n),i=KJ(e.range),l=TP(e.range)(r,s),c=i(l),d=Math.round(n/c),u=Math.floor(t%n/d);return Ir(l,u)},GJ=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:as(new Date(r.year,l,1))}})}));return t},IP=(e,t,r)=>{const n=r.columnWidth*r.zoom/100,s=wc(r.range),i=El(r.range),o=s(i(e),t);if(r.range==="daily")return n*o;const l=e.getDate(),c=as(e),d=n/c;return o*n+l*d},VJ=(e,t,r)=>{const n=r.columnWidth*r.zoom/100;if(!t)return n*2;const s=wc(r.range);if(r.range==="daily"){const g=s(t,e);return n*(g||1)}const i=as(e),o=n/i;if(zi(e,t))return o;const l=uv(r.range),c=El(r.range);if(zi(c(e),c(t)))return l(t,e)*o;const d=i-sl(e),u=sl(t),f=s(c(t),c(e)),m=as(t),p=n/m;return(f-1)*n+d*o+u*p},RP=(e,t,r)=>{const n=El(t),s=YJ(t),i=uv(t),o=n(e),l=s(e),c=i(l,o);return e.getDate()/c*r},Pn=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}),fv=({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}`))})]})},XJ=()=>h.useContext(Pn).timelineData.map(t=>t.quarters.flatMap(r=>r.months).map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(fv,{columns:r.days,renderHeaderItem:s=>a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx("p",{children:he(Ir(new Date(t.year,n,1),s),"d")}),a.jsx("p",{className:"text-muted-foreground",children:he(Ir(new Date(t.year,n,1),s),"EEEEE")})]}),title:he(new Date(t.year,n,1),"MMMM yyyy")}),a.jsx(mv,{columns:r.days,isColumnSecondary:s=>[0,6].includes(Ir(new Date(t.year,n,1),s).getDay())})]},`${t.year}-${n}`))),QJ=()=>h.useContext(Pn).timelineData.map(t=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(fv,{columns:t.quarters.flatMap(r=>r.months).length,renderHeaderItem:r=>a.jsx("p",{children:he(new Date(t.year,r,1),"MMM")}),title:`${t.year}`}),a.jsx(mv,{columns:t.quarters.flatMap(r=>r.months).length})]},t.year)),ZJ=()=>h.useContext(Pn).timelineData.map(t=>t.quarters.map((r,n)=>a.jsxs("div",{className:"relative flex flex-col",children:[a.jsx(fv,{columns:r.months.length,renderHeaderItem:s=>a.jsx("p",{children:he(new Date(t.year,n*3+s,1),"MMM")}),title:`Q${n+1} ${t.year}`}),a.jsx(mv,{columns:r.months.length})]},`${t.year}-${n}`))),JJ={daily:XJ,monthly:QJ,quarterly:ZJ},eee=({className:e})=>{const t=h.useContext(Pn),r=JJ[t.range];return a.jsx("div",{className:R("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:a.jsx(r,{})})},sh=({feature:e,onSelectItem:t,className:r,duration:n})=>{const s=h.useContext(Pn),i=e.endAt&&zi(e.startAt,e.endAt)?Ir(e.endAt,1):e.endAt,o=n??(i?gh(e.startAt,i):`${gh(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:R("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)},tee=()=>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"})]}),ih=({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})]}),ree=({children:e,className:t})=>a.jsxs("div",{className:R("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(tee,{}),a.jsx("div",{className:"space-y-4",children:e})]}),nee=({top:e,className:t})=>{const[r]=dv(),n=h.useContext(Pn),[s,i]=ov(),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=nl(n,c);(m=n.onAddItem)==null||m.call(n,d)};return a.jsx("div",{className:R("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(ct,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},aee=({index:e,isColumnSecondary:t})=>{var m;const r=h.useContext(Pn),[n]=cv(),[s,i]=ov(),[o,l]=h.useState(!1),[c]=aZ(),d=()=>l(!0),u=()=>l(!1),f=nZ(s.y-(((m=i.current)==null?void 0:m.getBoundingClientRect().y)??0)-(c.y??0),10);return a.jsx("div",{className:R("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(nee,{top:f}):null})},mv=({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(aee,{index:s,isColumnSecondary:t},`${r}-${s}`))})},ij=({direction:e,featureId:t,date:r})=>{const[,n]=cv(),{attributes:s,listeners:i,setNodeRef:o}=qj({id:`feature-drag-helper-${t}`}),l=!!s["aria-pressed"];return h.useEffect(()=>n(l),[l,n]),a.jsxs("div",{className:R("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:R("-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:R("-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:he(r,"MMM dd, yyyy")})]})},see=({id:e,children:t})=>{const[,r]=cv(),{attributes:n,listeners:s,setNodeRef:i}=qj({id:e}),o=!!n["aria-pressed"];return h.useEffect(()=>r(o),[o,r]),a.jsx(oP,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:a.jsx("div",{className:R("flex h-full w-full items-center justify-between gap-2 text-left",o&&"cursor-grabbing"),...n,...s,ref:i,children:t})})},oj=({onMove:e,children:t,className:r,...n})=>{const[s]=dv(),i=h.useContext(Pn),o=h.useMemo(()=>{var M;return new Date(((M=i.timelineData.at(0))==null?void 0:M.year)??0,0,1)},[i.timelineData]),[l,c]=h.useState(n.startAt),[d,u]=h.useState(n.endAt),f=h.useMemo(()=>VJ(l,d,i),[l,d,i]),m=h.useMemo(()=>IP(l,o,i),[l,o,i]),p=h.useMemo(()=>TP(i.range),[i.range]),[g]=ov(),[x,v]=h.useState(0),[y,w]=h.useState(l),[N,j]=h.useState(d),k=Mp(VM,{activationConstraint:{distance:10}}),b=h.useCallback(()=>{v(g.x),w(l),j(d)},[g.x,l,d]),C=h.useCallback(()=>{const M=nl(i,g.x),P=nl(i,x),T=i.range==="daily"?wc(i.range)(M,P):uv(i.range)(M,P),D=Ir(y,T),B=N?Ir(N,T):null;c(D),u(B)},[i,g.x,x,y,N]),S=h.useCallback(()=>e==null?void 0:e(n.id,l,d),[e,n.id,l,d]),_=h.useCallback(()=>{var B,E;const M=(E=(B=i.ref)==null?void 0:B.current)==null?void 0:E.getBoundingClientRect(),P=g.x-((M==null?void 0:M.left)??0)+s-i.sidebarWidth,D=El(i.range)(nl(i,P));c(D)},[i,g.x,s]),A=h.useCallback(()=>{var B,E;const M=(E=(B=i.ref)==null?void 0:B.current)==null?void 0:E.getBoundingClientRect(),P=g.x-((M==null?void 0:M.left)??0)+s-i.sidebarWidth,D=El(i.range)(nl(i,P));u(D)},[i,g.x,s]);return a.jsx("div",{className:R("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(al,{modifiers:[rh],onDragEnd:S,onDragMove:_,sensors:[k],children:a.jsx(ij,{date:l,direction:"left",featureId:n.id})}),a.jsx(al,{modifiers:[rh],onDragEnd:S,onDragMove:C,onDragStart:b,sensors:[k],children:a.jsx(see,{id:n.id,children:t??a.jsx("p",{className:"flex-1 truncate text-xs",children:n.name})})}),e&&a.jsx(al,{modifiers:[rh],onDragEnd:S,onDragMove:A,sensors:[k],children:a.jsx(ij,{date:d?jN(d):p(l,1),direction:"right",featureId:n.id})})]})})},oh=({children:e,className:t})=>a.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),iee=({className:e,children:t})=>a.jsx("div",{className:R("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),$P=h.memo(({label:e,date:t,id:r,onRemove:n,className:s})=>{const i=h.useContext(Pn),o=h.useMemo(()=>wc(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(()=>RP(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(RJ,{children:[a.jsx($J,{asChild:!0,children:a.jsxs("div",{className:R("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:he(t,"MMM dd, yyyy")})]})}),a.jsx(AP,{children:n?a.jsxs(DP,{className:"flex items-center gap-2 text-destructive",onClick:u,children:[a.jsx(mD,{size:16}),"Remove marker"]}):null})]}),a.jsx("div",{className:R("h-full w-px bg-card",s)})]})});$P.displayName="GanttMarker";const oee=({zoom:e=100,range:t="monthly",onAddItem:r,children:n,className:s})=>{const i=h.useRef(null),[o,l]=h.useState(GJ(new Date)),[,c]=dv(),[d,u]=h.useState(0),f=60,m=36;let p=50;t==="monthly"?p=150:t==="quarterly"&&(p=100);const g=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 x=h.useCallback(eJ(()=>{var k,b;const y=i.current;if(!y)return;const{scrollLeft:w,scrollWidth:N,clientWidth:j}=y;if(c(w),w===0){const C=(k=o[0])==null?void 0:k.year;if(!C)return;const S=[...o];S.unshift({year:C-1,quarters:new Array(4).fill(null).map((_,A)=>({months:new Array(3).fill(null).map((M,P)=>{const T=A*3+P;return{days:as(new Date(C,T,1))}})}))}),l(S),y.scrollLeft=y.clientWidth,c(y.scrollLeft)}else if(w+j>=N){const C=(b=o.at(-1))==null?void 0:b.year;if(!C)return;const S=[...o];S.push({year:C+1,quarters:new Array(4).fill(null).map((_,A)=>({months:new Array(3).fill(null).map((M,P)=>{const T=A*3+P;return{days:as(new Date(C,T,1))}})}))}),l(S),y.scrollLeft=y.scrollWidth-y.clientWidth,c(y.scrollLeft)}},100),[]);h.useEffect(()=>{const y=i.current;return y&&y.addEventListener("scroll",x),()=>{y&&y.removeEventListener("scroll",x)}},[x]);const v=h.useCallback(y=>{const w=i.current;if(!w)return;const N=new Date(o[0].year,0,1),j=IP(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(Pn.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:R("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:i,style:{...g,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:n})})},lee=({children:e,className:t})=>a.jsx("div",{className:R("relative flex h-full w-max flex-none overflow-clip",t),children:e}),cee=({className:e})=>{const t="Today",r=h.useMemo(()=>new Date,[]),n=h.useContext(Pn),s=h.useMemo(()=>wc(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(()=>RP(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:R("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:he(r,"MMM dd, yyyy")})]}),a.jsx("div",{className:R("h-full w-px bg-card",e)})]})};function dee(e){return We({queryKey:["public","share",e],queryFn:()=>re.get(`/public/share/${e}`),select:t=>t.project,enabled:!!e,retry:!1})}function hv(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 We({queryKey:["public","share",e,"issues",t],queryFn:()=>re.get(`/public/share/${e}/issues${n}`),select:s=>s.issues,enabled:!!e,retry:!1})}function zP(e){return We({queryKey:["public","share",e,"sprints"],queryFn:()=>re.get(`/public/share/${e}/sprints`),select:t=>t.sprints,enabled:!!e,retry:!1})}function uee({priority:e,className:t}){const r=R("h-3.5 w-3.5 shrink-0",og[e],t);switch(e){case"urgent":return a.jsx(ds,{className:r});case"high":return a.jsx(Fl,{className:r});case"medium":return a.jsx(oi,{className:r});case"low":return a.jsx(zl,{className:r});default:return a.jsx(sn,{className:R("h-3.5 w-3.5 shrink-0 text-zinc-300",t)})}}const Cp="grid-cols-[70px_250px_150px_120px_130px_140px_130px]";function LP({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:R(`group grid ${Cp} items-center py-3`,"hover:bg-[#f9fafb] dark:hover:bg-muted/30 transition-colors",i&&"bg-muted/10"),children:[a.jsx("span",{className:R("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:R("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(Qa,{children:[a.jsx(Za,{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(Vn,{className:"h-3.5 w-3.5"}):a.jsx(_n,{className:"h-3.5 w-3.5"})})}),a.jsx(pa,{side:"top",children:c?"Collapse":"Expand"})]}):i?a.jsx(jn,{className:"h-3 w-3 text-muted-foreground/40 shrink-0"}):a.jsx("span",{className:"w-4 shrink-0"}),a.jsx("span",{className:R("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(jn,{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(uee,{priority:e.priority}),a.jsx("span",{className:"text-xs text-muted-foreground",children:kn[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(Rr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:R("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(mr,{className:"h-3.5 w-3.5 text-muted-foreground/50 shrink-0"}),a.jsx("span",{className:R("text-xs",e.due_date?"text-foreground":"text-muted-foreground/50"),children:e.due_date?he(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(LP,{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 fee({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(_n,{className:"h-3.5 w-3.5"}):a.jsx(Vn,{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(LP,{issue:d,statuses:r,statusLabels:n,statusColorMap:s,sprints:i,children:t[d.id]??[],childrenMap:t},d.id))})]})}function mee({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}=hv(e),{data:m=[]}=zP(e),p=Object.fromEntries(t.map(N=>[N.key,N.name])),g=Object.fromEntries(t.map(N=>[N.key,N.color])),x={};for(const N of u)N.parent_id&&(x[N.parent_id]||(x[N.parent_id]=[]),x[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,C=s==="all"||N.priority===s,S=o==="all"?!0:o==="none"?!N.sprint_id:N.sprint_id===o;return k&&b&&C&&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=x[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(Be,{value:o,onValueChange:l,children:[a.jsx(ze,{className:"h-8 text-xs w-[140px] bg-transparent",children:a.jsx(Ye,{placeholder:"Sprint"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All sprints"}),a.jsx(Ne,{value:"none",className:"text-xs text-muted-foreground",children:"No sprint"}),m.map(N=>a.jsx(Ne,{value:N.id,className:"text-xs",children:N.name},N.id))]})]}),a.jsxs(Be,{value:r,onValueChange:n,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Status"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All statuses"}),t.map(({key:N,name:j})=>a.jsx(Ne,{value:N,className:"text-xs",children:j},N))]})]}),a.jsxs(Be,{value:s,onValueChange:i,children:[a.jsx(ze,{className:"h-8 text-xs w-[130px] bg-transparent",children:a.jsx(Ye,{placeholder:"Priority"})}),a.jsxs(Le,{children:[a.jsx(Ne,{value:"all",className:"text-xs",children:"All priorities"}),Object.entries(kn).map(([N,j])=>a.jsx(Ne,{value:N,className:"text-xs",children:j},N))]})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx(Ul,{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(Ae,{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:R("grid items-center py-2.5 border-b border-border",Cp),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:R("grid items-center px-6 py-3 gap-4",Cp),children:[a.jsx(ue,{className:"h-4 w-14"}),a.jsx(ue,{className:"h-4 w-56"}),a.jsx(ue,{className:"h-5 w-20"}),a.jsx(ue,{className:"h-4 w-16"}),a.jsx(ue,{className:"h-4 w-20"}),a.jsx(ue,{className:"h-4 w-24"}),a.jsx(ue,{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(wu,{delayDuration:200,children:a.jsx(fee,{issues:v,childrenMap:x,statuses:t,statusLabels:p,statusColorMap:g,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 Jc(e,t){const r=e.start_date?new Date(e.start_date):new Date(e.due_date),n=e.due_date?Ir(new Date(e.due_date),1):Ir(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 hee({token:e,statuses:t}){const[r,n]=h.useState("monthly"),s=h.useRef(null),{data:i=[]}=hv(e),{data:o=[]}=zP(e);h.useEffect(()=>{const m=requestAnimationFrame(()=>{var w;const p=(w=s.current)==null?void 0:w.querySelector(".gantt");if(!p)return;const g=new Date,x=g.getFullYear()-1,v=300;let y;if(r==="daily")y=Math.floor((g.getTime()-new Date(x,0,1).getTime())/864e5)*50;else{const N=r==="monthly"?150:100,j=(g.getFullYear()-x)*12+g.getMonth(),k=new Date(g.getFullYear(),g.getMonth()+1,0).getDate();y=j*N+(g.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(oee,{range:r,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[a.jsxs(ree,{children:[o.map(m=>{const p=u[m.id]??[];return a.jsx(ih,{name:m.name,children:p.map(g=>a.jsx(sh,{feature:Jc(g,l[g.status]??"#94a3b8")},g.id))},m.id)}),f.length>0&&a.jsx(ih,{name:"No Sprint",children:f.map(m=>a.jsx(sh,{feature:Jc(m,l[m.status]??"#94a3b8")},m.id))}),d.length>0&&a.jsx(ih,{name:"Unscheduled",children:d.map(m=>a.jsx(sh,{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(lee,{children:[a.jsx(eee,{}),a.jsxs(iee,{children:[o.map(m=>a.jsx(oh,{children:(u[m.id]??[]).map(p=>a.jsx("div",{className:"flex",children:a.jsx(oj,{...Jc(p,l[p.status]??"#94a3b8")})},p.id))},m.id)),f.length>0&&a.jsx(oh,{children:f.map(m=>a.jsx("div",{className:"flex",children:a.jsx(oj,{...Jc(m,l[m.status]??"#94a3b8")})},m.id))}),d.length>0&&a.jsx(oh,{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($P,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),a.jsx(cee,{})]})]})})]})}function pee(){const{token:e}=Vt(),[t,r]=h.useState("board"),{data:n,isLoading:s,isError:i}=dee(e??""),{data:o}=hv(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(kN,{issues:o??[],projectId:n.id,statuses:n.statuses,readOnly:!0}),t==="issues"&&a.jsx(mee,{token:e,statuses:n.statuses}),t==="timeline"&&a.jsx(hee,{token:e,statuses:n.statuses})]})]})}const gee=new URLSearchParams(window.location.search);function xee(){const[e,t]=h.useState(null),r=St(),n=Ie(),s=h.useRef(!1);if(h.useEffect(()=>{if(s.current)return;s.current=!0;const i=gee;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(`${Ti}/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(`${Ti}/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(Yr,{to:"/login",children:a.jsx(ee,{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(Yr,{to:"/login",children:a.jsx(ee,{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..."})})}var vee=Object.defineProperty,yee=Object.defineProperties,bee=Object.getOwnPropertyDescriptors,xu=Object.getOwnPropertySymbols,FP=Object.prototype.hasOwnProperty,BP=Object.prototype.propertyIsEnumerable,lj=(e,t,r)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wee=(e,t)=>{for(var r in t||(t={}))FP.call(t,r)&&lj(e,r,t[r]);if(xu)for(var r of xu(t))BP.call(t,r)&&lj(e,r,t[r]);return e},jee=(e,t)=>yee(e,bee(t)),Nee=(e,t)=>{var r={};for(var n in e)FP.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xu)for(var n of xu(e))t.indexOf(n)<0&&BP.call(e,n)&&(r[n]=e[n]);return r};function kee(e){let t=setTimeout(e,0),r=setTimeout(e,10),n=setTimeout(e,50);return[t,r,n]}function See(e){let t=h.useRef();return h.useEffect(()=>{t.current=e}),t.current}var Cee=18,WP=40,_ee=`${WP}px`,Oee=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Pee({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 g=m,x=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=x-Cee,w=v;document.querySelectorAll(Oee).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 x=window.innerWidth-m.getBoundingClientRect().right;l(x>=WP)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,r]),h.useEffect(()=>{let m=n||document.activeElement===t.current;if(r==="none"||!m)return;let p=setTimeout(f,0),g=setTimeout(f,2e3),x=setTimeout(f,5e3),v=setTimeout(()=>{d(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(x),clearTimeout(v)}},[t,n,r,f]),{hasPWMBadge:s,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:_ee}}var UP=h.createContext({}),qP=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:g=Mee,render:x,children:v}=r,y=Nee(r,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),w,N,j,k,b;let[C,S]=h.useState(typeof y.defaultValue=="string"?y.defaultValue:""),_=n??C,A=See(_),M=h.useCallback(V=>{s==null||s(V),S(V)},[s]),P=h.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),T=h.useRef(null),D=h.useRef(null),B=h.useRef({value:_,onChange:M,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"))}),E=h.useRef({prev:[(j=T.current)==null?void 0:j.selectionStart,(k=T.current)==null?void 0:k.selectionEnd,(b=T.current)==null?void 0:b.selectionDirection]});h.useImperativeHandle(t,()=>T.current,[]),h.useEffect(()=>{let V=T.current,oe=D.current;if(!V||!oe)return;B.current.value!==V.value&&B.current.onChange(V.value),E.current.prev=[V.selectionStart,V.selectionEnd,V.selectionDirection];function pe(){if(document.activeElement!==V){U(null),J(null);return}let H=V.selectionStart,ve=V.selectionEnd,De=V.selectionDirection,He=V.maxLength,Fe=V.value,Qe=E.current.prev,gt=-1,Ge=-1,Ze;if(Fe.length!==0&&H!==null&&ve!==null){let hn=H===ve,gr=H===Fe.length&&Fe.length<He;if(hn&&!gr){let Ct=H;if(Ct===0)gt=0,Ge=1,Ze="forward";else if(Ct===He)gt=Ct-1,Ge=Ct,Ze="backward";else if(He>1&&Fe.length>1){let Rt=0;if(Qe[0]!==null&&Qe[1]!==null){Ze=Ct<Qe[1]?"backward":"forward";let qt=Qe[0]===Qe[1]&&Qe[0]<He;Ze==="backward"&&!qt&&(Rt=-1)}gt=Rt+Ct,Ge=Rt+Ct+1}}gt!==-1&&Ge!==-1&>!==Ge&&T.current.setSelectionRange(gt,Ge,Ze)}let pr=gt!==-1?gt:H,mn=Ge!==-1?Ge:ve,Pr=Ze??De;U(pr),J(mn),E.current.prev=[pr,mn,Pr]}if(document.addEventListener("selectionchange",pe,{capture:!0}),pe(),document.activeElement===V&&se(!0),!document.getElementById("input-otp-style")){let H=document.createElement("style");if(H.id="input-otp-style",document.head.appendChild(H),H.sheet){let ve="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;";Qo(H.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Qo(H.sheet,`[data-input-otp]:autofill { ${ve} }`),Qo(H.sheet,`[data-input-otp]:-webkit-autofill { ${ve} }`),Qo(H.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; } }"),Qo(H.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let we=()=>{oe&&oe.style.setProperty("--root-height",`${V.clientHeight}px`)};we();let _e=new ResizeObserver(we);return _e.observe(V),()=>{document.removeEventListener("selectionchange",pe,{capture:!0}),_e.disconnect()}},[]);let[z,Q]=h.useState(!1),[K,se]=h.useState(!1),[te,U]=h.useState(null),[G,J]=h.useState(null);h.useEffect(()=>{kee(()=>{var V,oe,pe,we;(V=T.current)==null||V.dispatchEvent(new Event("input"));let _e=(oe=T.current)==null?void 0:oe.selectionStart,H=(pe=T.current)==null?void 0:pe.selectionEnd,ve=(we=T.current)==null?void 0:we.selectionDirection;_e!==null&&H!==null&&(U(_e),J(H),E.current.prev=[_e,H,ve])})},[_,K]),h.useEffect(()=>{A!==void 0&&_!==A&&A.length<i&&_.length===i&&(u==null||u(_))},[i,u,A,_]);let X=Pee({containerRef:D,inputRef:T,pushPasswordManagerStrategy:f,isFocused:K}),O=h.useCallback(V=>{let oe=V.currentTarget.value.slice(0,i);if(oe.length>0&&P&&!P.test(oe)){V.preventDefault();return}typeof A=="string"&&oe.length<A.length&&document.dispatchEvent(new Event("selectionchange")),M(oe)},[i,M,A,P]),F=h.useCallback(()=>{var V;if(T.current){let oe=Math.min(T.current.value.length,i-1),pe=T.current.value.length;(V=T.current)==null||V.setSelectionRange(oe,pe),U(oe),J(pe)}se(!0)},[i]),ae=h.useCallback(V=>{var oe,pe;let we=T.current;if(!m&&(!B.current.isIOS||!V.clipboardData||!we))return;let _e=V.clipboardData.getData("text/plain"),H=m?m(_e):_e;V.preventDefault();let ve=(oe=T.current)==null?void 0:oe.selectionStart,De=(pe=T.current)==null?void 0:pe.selectionEnd,He=(ve!==De?_.slice(0,ve)+H+_.slice(De):_.slice(0,ve)+H+_.slice(ve)).slice(0,i);if(He.length>0&&P&&!P.test(He))return;we.value=He,M(He);let Fe=Math.min(He.length,i-1),Qe=He.length;we.setSelectionRange(Fe,Qe),U(Fe),J(Qe)},[i,M,P,_]),W=h.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),q=h.useMemo(()=>({position:"absolute",inset:0,width:X.willPushPWMBadge?`calc(100% + ${X.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:X.willPushPWMBadge?`inset(0 ${X.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"}),[X.PWM_BADGE_SPACE_WIDTH,X.willPushPWMBadge,o]),le=h.useMemo(()=>h.createElement("input",jee(wee({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":_.length===0||void 0,"data-input-otp-mss":te,"data-input-otp-mse":G,inputMode:d,pattern:P==null?void 0:P.source,"aria-placeholder":c,style:q,maxLength:i,value:_,ref:T,onPaste:V=>{var oe;ae(V),(oe=y.onPaste)==null||oe.call(y,V)},onChange:O,onMouseOver:V=>{var oe;Q(!0),(oe=y.onMouseOver)==null||oe.call(y,V)},onMouseLeave:V=>{var oe;Q(!1),(oe=y.onMouseLeave)==null||oe.call(y,V)},onFocus:V=>{var oe;F(),(oe=y.onFocus)==null||oe.call(y,V)},onBlur:V=>{var oe;se(!1),(oe=y.onBlur)==null||oe.call(y,V)}})),[O,F,ae,d,q,i,G,te,y,P==null?void 0:P.source,_]),Z=h.useMemo(()=>({slots:Array.from({length:i}).map((V,oe)=>{var pe;let we=K&&te!==null&&G!==null&&(te===G&&oe===te||oe>=te&&oe<G),_e=_[oe]!==void 0?_[oe]:null,H=_[0]!==void 0?null:(pe=c==null?void 0:c[oe])!=null?pe:null;return{char:_e,placeholderChar:H,isActive:we,hasFakeCaret:we&&_e===null}}),isFocused:K,isHovering:!y.disabled&&z}),[K,z,i,G,te,y.disabled,_]),de=h.useMemo(()=>x?x(Z):h.createElement(UP.Provider,{value:Z},v),[v,Z,x]);return h.createElement(h.Fragment,null,g!==null&&h.createElement("noscript",null,h.createElement("style",null,g)),h.createElement("div",{ref:D,"data-input-otp-container":!0,style:W,className:p},de,h.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},le)))});qP.displayName="Input";function Qo(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var Mee=`
|
|
596
|
-
[data-input-otp] {
|
|
597
|
-
--nojs-bg: white !important;
|
|
598
|
-
--nojs-fg: black !important;
|
|
599
|
-
|
|
600
|
-
background-color: var(--nojs-bg) !important;
|
|
601
|
-
color: var(--nojs-fg) !important;
|
|
602
|
-
caret-color: var(--nojs-fg) !important;
|
|
603
|
-
letter-spacing: .25em !important;
|
|
604
|
-
text-align: center !important;
|
|
605
|
-
border: 1px solid var(--nojs-fg) !important;
|
|
606
|
-
border-radius: 4px !important;
|
|
607
|
-
width: 100% !important;
|
|
608
|
-
}
|
|
609
|
-
@media (prefers-color-scheme: dark) {
|
|
610
|
-
[data-input-otp] {
|
|
611
|
-
--nojs-bg: black !important;
|
|
612
|
-
--nojs-fg: white !important;
|
|
613
|
-
}
|
|
614
|
-
}`;const HP=h.forwardRef(({className:e,containerClassName:t,...r},n)=>a.jsx(qP,{ref:n,containerClassName:R("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:R("disabled:cursor-not-allowed",e),...r}));HP.displayName="InputOTP";const _p=h.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:R("flex items-center",e),...t}));_p.displayName="InputOTPGroup";const Ns=h.forwardRef(({index:e,className:t,...r},n)=>{const s=h.useContext(UP),{char:i,hasFakeCaret:o,isActive:l}=s.slots[e];return a.jsxs("div",{ref:n,className:R("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"})})]})});Ns.displayName="InputOTPSlot";const KP=h.forwardRef(({...e},t)=>a.jsx("div",{ref:t,role:"separator",...e,children:a.jsx(oi,{})}));KP.displayName="InputOTPSeparator";function cj({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 Eee(){var W,q,le,Z;const[e,t]=Dl(),{user:r}=Ie(),{data:n,isLoading:s}=QO(),i=BQ(),o=WQ(),l=UQ(),c=KQ(),d=qQ(),u=HQ(),f=h.useRef(null),[m,p]=h.useState(""),[g,x]=h.useState(""),[v,y]=h.useState(""),[w,N]=h.useState(""),[j,k]=h.useState(!1),[b,C]=h.useState(!1),[S,_]=h.useState(""),[A,M]=h.useState(""),[P,T]=h.useState(""),[D,B]=h.useState(!1),[E,z]=h.useState(0),Q=h.useRef(null);h.useEffect(()=>{n&&(p(n.first_name??""),x(n.last_name??""),y(n.designation??""),N(n.phone_number??""))},[n]),h.useEffect(()=>{e.get("linked")==="true"&&(L.success("Google account connected successfully"),t(de=>(de.delete("linked"),de),{replace:!0}))},[e,t]);const K=r&&(`${((W=r.first_name)==null?void 0:W[0])??""}${((q=r.last_name)==null?void 0:q[0])??""}`.toUpperCase()||((Z=(le=r.email)==null?void 0:le[0])==null?void 0:Z.toUpperCase()))||"?",se=de=>{var oe;const V=(oe=de.target.files)==null?void 0:oe[0];V&&(o.mutate(V,{onSuccess:()=>L.success("Avatar updated"),onError:pe=>L.error(pe.message??"Failed to upload avatar")}),de.target.value="")},te=()=>{l.mutate(void 0,{onSuccess:()=>L.success("Avatar removed"),onError:de=>L.error(de.message??"Failed to remove avatar")})},U=()=>{i.mutate({first_name:m,last_name:g,designation:v||null,phone_number:w||null},{onSuccess:()=>L.success("Profile updated"),onError:de=>L.error(de.message??"Failed to update profile")})},G=()=>{const de=localStorage.getItem("meridian_token");if(!de){L.error("You must be logged in to connect Google");return}window.location.href=`${Ti}/auth/google/link?token=${encodeURIComponent(de)}`},J=()=>{c.mutate(void 0,{onSuccess:()=>L.success("Google account disconnected"),onError:de=>L.error(de.message??"Failed to unlink Google account")})},X=h.useCallback(()=>{z(30),Q.current&&clearInterval(Q.current),Q.current=setInterval(()=>{z(de=>de<=1?(Q.current&&clearInterval(Q.current),0):de-1)},1e3)},[]);h.useEffect(()=>()=>{Q.current&&clearInterval(Q.current)},[]);const O=()=>{d.mutate(void 0,{onSuccess:()=>{C(!0),X(),L.success("Verification code sent to your email")},onError:de=>L.error(de.message??"Failed to send verification code")})},F=()=>{if(A.length<8){L.error("New password must be at least 8 characters");return}if(A!==P){L.error("Passwords do not match");return}u.mutate({otp:S,new_password:A},{onSuccess:()=>{L.success("Password updated"),ae()},onError:de=>L.error(de.message??"Failed to set password")})},ae=()=>{k(!1),C(!1),_(""),M(""),T(""),B(!1),z(0),Q.current&&clearInterval(Q.current)};return a.jsx("div",{className:"p-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(_u,{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 items-center justify-between px-6 py-4 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground w-44 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(Ft,{className:"h-14 w-14 rounded-xl",children:[n!=null&&n.avatar_url?a.jsx(ll,{src:n.avatar_url,alt:"Avatar",className:"object-cover"}):null,a.jsx(Bt,{className:"rounded-xl bg-foreground text-background text-base font-medium",children:K})]}),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(ee,{variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{var de;return(de=f.current)==null?void 0:de.click()},disabled:o.isPending,children:[a.jsx($A,{className:"size-3.5"}),"Change photo"]}),(n==null?void 0:n.avatar_url)&&a.jsxs(ee,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-destructive",onClick:te,disabled:l.isPending,children:[a.jsx($r,{className:"size-3.5"}),"Remove"]})]}),a.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:se})]})]}),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-[180px_1fr] items-center gap-4 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(ue,{className:"h-8 w-56"}):a.jsx(Ae,{value:m,onChange:de=>p(de.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"First name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 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(ue,{className:"h-8 w-56"}):a.jsx(Ae,{value:g,onChange:de=>x(de.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"Last name"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),s?a.jsx(ue,{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-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Designation"}),s?a.jsx(ue,{className:"h-8 w-56"}):a.jsx(Ae,{value:v,onChange:de=>y(de.target.value),className:"h-8 w-64 text-sm bg-transparent",placeholder:"e.g. Software Engineer"})]}),a.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 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(ue,{className:"h-8 w-56"}):a.jsx(Ae,{value:w,onChange:de=>N(de.target.value),className:"h-8 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(ee,{size:"sm",onClick:U,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.jsxs("div",{className:"grid grid-cols-[180px_1fr] items-center gap-4 px-6 py-3.5 border-b border-border",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[a.jsx(cj,{className:"size-3.5 shrink-0"}),"Google"]}),s?a.jsx(ue,{className:"h-8 w-48"}):n!=null&&n.google_id?a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1.5 text-sm",children:[a.jsx(ls,{className:"size-3.5 text-emerald-500 shrink-0"}),a.jsx("span",{className:"text-foreground font-medium",children:"Connected"}),a.jsxs("span",{className:"text-muted-foreground",children:["· ",n.email]})]}),a.jsxs(ee,{variant:"ghost",size:"sm",className:"h-7 gap-1.5 text-muted-foreground hover:text-destructive ml-auto",onClick:J,disabled:c.isPending,children:[a.jsx(Lp,{className:"size-3.5"}),"Disconnect"]})]}):a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"}),a.jsxs(ee,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:G,children:[a.jsx(cj,{className:"size-3.5"}),"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-[180px_1fr] items-center gap-4 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(ee,{variant:"outline",size:"sm",className:"h-7 gap-1.5",onClick:()=>k(!0),children:[a.jsx(VA,{className:"size-3.5"}),(n==null?void 0:n.has_password)===!1?"Create password":"Change password"]})]})]}),a.jsx(Ma,{open:j,onOpenChange:de=>{de||ae()},children:a.jsxs(Zn,{className:"sm:max-w-md",children:[a.jsxs(Ea,{children:[a.jsx(Aa,{children:(n==null?void 0:n.has_password)===!1?"Create password":"Change password"}),a.jsxs(io,{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(ut,{className:"text-sm",children:"Verification code"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(HP,{maxLength:6,value:S,onChange:_,children:[a.jsxs(_p,{children:[a.jsx(Ns,{index:0}),a.jsx(Ns,{index:1}),a.jsx(Ns,{index:2})]}),a.jsx(KP,{}),a.jsxs(_p,{children:[a.jsx(Ns,{index:3}),a.jsx(Ns,{index:4}),a.jsx(Ns,{index:5})]})]}),b?E>0?a.jsxs("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums w-16 text-center",children:["Resend in ",E,"s"]}):a.jsx(ee,{variant:"ghost",size:"sm",className:"h-8 shrink-0 text-indigo-500 hover:text-indigo-600",onClick:O,disabled:d.isPending,children:d.isPending?"Sending…":"Resend"}):a.jsx(ee,{variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:O,disabled:d.isPending,children:d.isPending?"Sending…":"Send code"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ut,{className:"text-sm",children:"New password"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ae,{type:D?"text":"password",value:A,onChange:de=>M(de.target.value),className:"h-9 text-sm pr-9",placeholder:"At least 8 characters",autoComplete:"new-password"}),a.jsx("button",{type:"button",onClick:()=>B(!D),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:D?a.jsx(Bl,{className:"size-3.5"}):a.jsx(ii,{className:"size-3.5"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(ut,{className:"text-sm",children:"Confirm password"}),a.jsx(Ae,{type:"password",value:P,onChange:de=>T(de.target.value),className:"h-9 text-sm",placeholder:"Re-enter new password",autoComplete:"new-password"})]})]}),a.jsxs(Xp,{children:[a.jsx(ee,{variant:"ghost",size:"sm",onClick:ae,children:"Cancel"}),a.jsx(ee,{size:"sm",onClick:F,disabled:u.isPending||S.length!==6||!A||!P,children:u.isPending?"Saving…":(n==null?void 0:n.has_password)===!1?"Create password":"Update password"})]})]})})]})]})})}function Aee(){const[e,t]=h.useState(""),[r,n]=h.useState(!1),s=$D(),i=o=>{o.preventDefault(),s.mutate({email:e},{onSuccess:()=>n(!0),onError:l=>L.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(ee,{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(Ae,{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(ee,{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(Yr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Ll,{className:"size-3.5"}),"Back to login"]})})]})})}function Dee(){const[e]=Dl(),t=e.get("token")??"",r=St(),n=zD(),[s,i]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState(!1),u=f=>{if(f.preventDefault(),s.length<8){L.error("Password must be at least 8 characters");return}if(s!==o){L.error("Passwords do not match");return}n.mutate({token:t,password:s},{onSuccess:()=>{L.success("Password has been reset. Please sign in."),r("/login",{replace:!0})},onError:m=>L.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(Ae,{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(Bl,{className:"h-4 w-4"}):a.jsx(ii,{className:"h-4 w-4"})})]}),a.jsx(Ae,{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(ee,{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(Yr,{to:"/login",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a.jsx(Ll,{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(Yr,{to:"/forgot-password",children:a.jsx(ee,{variant:"outline",size:"sm",children:"Request a new link"})})]})})}const Tee=h.lazy(()=>Zj(()=>import("./ProjectTimelinePage-CND6RpOG.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ProjectTimelinePage}))),Iee=h.lazy(()=>Zj(()=>import("./WorkspaceReportingPage-B3aVl4VS.js"),__vite__mapDeps([6,1,2,3,4,5])).then(e=>({default:e.WorkspaceReportingPage})));function ji({children:e}){const{isAuthenticated:t}=Ie();return t?a.jsx(a.Fragment,{children:e}):a.jsx(Xa,{to:"/login",replace:!0})}function Ree({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(Xa,{to:"/",replace:!0})}function dj({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(Xa,{to:"/",replace:!0})}function ed({children:e}){const{isAuthenticated:t}=Ie(),{data:r}=Mu(),n=vu();return t?a.jsx(Xa,{to:"/",replace:!0}):r!=null&&r.needsSetup&&n.pathname==="/login"?a.jsx(Xa,{to:"/register",replace:!0}):r&&!r.needsSetup&&n.pathname==="/register"?a.jsx(Xa,{to:"/login",replace:!0}):a.jsx(a.Fragment,{children:e})}function $ee(){const{workspace:e,setWorkspace:t}=Ie(),r=St(),{data:n,isLoading:s}=Ou(!e);return h.useEffect(()=>{if(e){r(`/${e.slug}/projects`,{replace:!0});return}if(!s&&n!==void 0)if(n.length>0){const i=n[0];t({id:i.id,name:i.name,slug:i.slug}),r(`/${i.slug}/projects`,{replace:!0})}else r("/setup",{replace:!0})},[e,n,s,r,t]),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 zee(){const{workspace:e}=Vt(),{workspace:t,setWorkspace:r}=Ie();WD();const n=St(),{data:s,isLoading:i,isFetching:o}=Ou();return h.useEffect(()=>{if(i||!s)return;const l=s.find(c=>c.slug===e);l?l.id!==(t==null?void 0:t.id)&&r({id:l.id,name:l.name,slug:l.slug}):s.length>0?n(`/${s[0].slug}/projects`,{replace:!0}):!t&&!o&&n("/setup",{replace:!0})},[s,e,i,o,t==null?void 0:t.id,n,r]),i||!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(NT,{}),a.jsx(o5,{})]})}function Lee(){return a.jsxs(tM,{children:[a.jsx(Ke,{path:"/login",element:a.jsx(ed,{children:a.jsx(l5,{})})}),a.jsx(Ke,{path:"/register",element:a.jsx(ed,{children:a.jsx(c5,{})})}),a.jsx(Ke,{path:"/forgot-password",element:a.jsx(ed,{children:a.jsx(Aee,{})})}),a.jsx(Ke,{path:"/reset-password",element:a.jsx(ed,{children:a.jsx(Dee,{})})}),a.jsx(Ke,{path:"/invite/:token",element:a.jsx(F6,{})}),a.jsx(Ke,{path:"/oauth/google/callback",element:a.jsx(xee,{})}),a.jsx(Ke,{path:"/share/:token",element:a.jsx(pee,{})}),a.jsx(Ke,{path:"/reporting",element:a.jsx(ji,{children:a.jsx(dj,{children:a.jsx(PT,{})})}),children:a.jsx(Ke,{index:!0,element:a.jsx(IQ,{})})}),a.jsx(Ke,{path:"/org/settings",element:a.jsx(ji,{children:a.jsx(dj,{children:a.jsx(AT,{})})}),children:a.jsx(Ke,{index:!0,element:a.jsx(rZ,{})})}),a.jsx(Ke,{path:"/profile",element:a.jsx(ji,{children:a.jsx(IT,{})}),children:a.jsx(Ke,{index:!0,element:a.jsx(Eee,{})})}),a.jsx(Ke,{path:"/setup",element:a.jsx(ji,{children:a.jsx(d5,{})})}),a.jsx(Ke,{index:!0,element:a.jsx(ji,{children:a.jsx($ee,{})})}),a.jsxs(Ke,{path:"/:workspace",element:a.jsx(ji,{children:a.jsx(zee,{})}),children:[a.jsx(Ke,{index:!0,element:a.jsx(Xa,{to:"projects",replace:!0})}),a.jsx(Ke,{path:"projects",element:a.jsx(vI,{})}),a.jsxs(Ke,{path:"projects/:projectKey",element:a.jsx(CT,{}),children:[a.jsx(Ke,{path:"board",element:a.jsx(B$,{})}),a.jsx(Ke,{path:"issues",element:a.jsx(W$,{})}),a.jsx(Ke,{path:"issues/new",element:a.jsx(x6,{})}),a.jsx(Ke,{path:"issues/:issueId",element:a.jsx(f6,{})}),a.jsx(Ke,{path:"sprints",element:a.jsx(k6,{})}),a.jsx(Ke,{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(Tee,{})})}),a.jsx(Ke,{path:"access",element:a.jsx(l6,{})}),a.jsx(Ke,{path:"reports",element:a.jsx(RQ,{})}),a.jsx(Ke,{path:"activity",element:a.jsx(FQ,{})})]}),a.jsx(Ke,{path:"notifications",element:a.jsx(b6,{})}),a.jsx(Ke,{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(Iee,{})})}),a.jsx(Ke,{path:"settings",element:a.jsx(I6,{})}),a.jsx(Ke,{path:"roles",element:a.jsx(Ree,{children:a.jsx(z6,{})})})]}),a.jsx(Ke,{path:"*",element:a.jsx(Xa,{to:"/",replace:!0})})]})}window.__React=I;window.__ReactJsxRuntime=XP;const Fee=new QP({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{}Qj(document.getElementById("root")).render(a.jsx(h.StrictMode,{children:a.jsx(OA,{widgets:[...bD,...e],children:a.jsx(YE,{children:a.jsxs(ZP,{client:Fee,children:[a.jsx(GE,{children:a.jsx(VE,{children:a.jsx(rM,{children:a.jsxs(wu,{delayDuration:300,children:[a.jsx(Lee,{}),a.jsx(RE,{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(cE,{initialIsOpen:!1})]})})})}))})();export{ee as B,Vu as C,oee as G,dk as I,ct as P,IQ as R,Nr as W,Rl as a,fo as b,mo as c,lg as d,cg as e,ree as f,ih as g,sh as h,lee as i,eee as j,iee as k,oh as l,oj as m,$P as n,cee as o,SN as p,Ir as q,he as r,jN as s,L as t,Pa as u,Tt as v,re as w,Ie as x};
|