@meridianjs/admin-dashboard 0.1.7 → 0.1.9
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-BtEP9_Du.js +6 -0
- package/dist/assets/index-BezQbQuU.js +466 -0
- package/dist/assets/index-Rp0DT-rw.css +1 -0
- package/dist/assets/{vendor-dnd-dQurpOJF.js → vendor-dnd-DmX4J2r6.js} +2 -2
- package/dist/assets/{vendor-editor-DUJVLow6.js → vendor-editor-D6k4FPZ2.js} +1 -1
- package/dist/assets/{vendor-query-BxDNdxq_.js → vendor-query-DOje7EXl.js} +1 -1
- package/dist/assets/{vendor-radix-B3DR0avi.js → vendor-radix-DganjVC1.js} +2 -2
- package/dist/assets/vendor-react-ChOmrACb.js +59 -0
- package/dist/index.html +7 -7
- package/package.json +7 -1
- package/dist/assets/index-CtDYafeT.css +0 -1
- package/dist/assets/index-CtZgTfmN.js +0 -445
- package/dist/assets/vendor-react-CfHM_tz4.js +0 -59
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{j as i,u as It,a as kt}from"./vendor-query-DOje7EXl.js";import{r as l,c as Oe,j as At,k as K,u as Et}from"./vendor-react-ChOmrACb.js";import{c as Rt,t as G,n as ne,d as Ot,m as Pt,e as Pe,a as Tt,g as Ce,b as Lt,f as Se,h as V,i as Bt,j as S,C as Wt,k as $t,l as Gt,o as H,p as de,q as $,r as W,s as Ht,P as Te,u as Ft,v as zt,w as Ut,x as Xt,y as Yt,z as Kt,B as Vt,I as qt,A as Jt,D as Qt,E as Zt,F as en}from"./index-BezQbQuU.js";import{a as tn,D as oe,M as nn,g as Le}from"./vendor-dnd-DmX4J2r6.js";import{a6 as on,a7 as sn,a8 as rn,a9 as an,a3 as F,aa as Be,ab as cn,ac as ln,ad as dn,ae as un,af as fn,ag as mn,ah as hn,ai as pn,aj as gn,ak as xn,al as vn,am as yn,an as bn}from"./vendor-radix-DganjVC1.js";import"./vendor-editor-D6k4FPZ2.js";/**
|
|
2
|
+
* @license lucide-react v0.468.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const wn=Rt("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"}]]);function Q(e,t){const n=+G(e)-+G(t);return n<0?-1:n>0?1:n}function We(e,t,n){const[o,s]=ne(n==null?void 0:n.in,e,t),r=je(o,s),c=Math.abs(Ot(o,s));o.setDate(o.getDate()-r*c);const a=+(je(o,s)===-r),d=r*(c-a);return d===0?0:d}function je(e,t){const n=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 n<0?-1:n>0?1:n}function $e(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function Mn(e,t,n){const[o,s]=ne(n==null?void 0:n.in,e,t),r=(+o-+s)/Pt;return $e(n==null?void 0:n.roundingMethod)(r)}function Cn(e,t){return+G(e)-+G(t)}function Ge(e,t){const n=G(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Sn(e,t){const n=G(e,t==null?void 0:t.in);return+Ge(n,t)==+Pe(n,t)}function He(e,t,n){const[o,s,r]=ne(n==null?void 0:n.in,e,e,t),c=Q(s,r),a=Math.abs(Tt(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-c*a);let d=Q(s,r)===-c;Sn(o)&&a===1&&Q(o,r)===1&&(d=!1);const u=c*(a-+d);return u===0?0:u}function jn(e,t,n){const o=Cn(e,t)/1e3;return $e(n==null?void 0:n.roundingMethod)(o)}function _e(e,t,n){const s=Bt().locale??Lt,r=2520,c=Q(e,t);if(isNaN(c))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:c}),[d,u]=ne(n==null?void 0:n.in,...c>0?[t,e]:[e,t]),p=jn(u,d),h=(Ce(u)-Ce(d))/1e3,f=Math.round((p-h)/60);let g;if(f<2)return f===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",f,a);if(f<45)return s.formatDistance("xMinutes",f,a);if(f<90)return s.formatDistance("aboutXHours",1,a);if(f<Se){const v=Math.round(f/60);return s.formatDistance("aboutXHours",v,a)}else{if(f<r)return s.formatDistance("xDays",1,a);if(f<V){const v=Math.round(f/Se);return s.formatDistance("xDays",v,a)}else if(f<V*2)return g=Math.round(f/V),s.formatDistance("aboutXMonths",g,a)}if(g=He(u,d),g<12){const v=Math.round(f/V);return s.formatDistance("xMonths",v,a)}else{const v=g%12,M=Math.trunc(g/12);return v<3?s.formatDistance("aboutXYears",M,a):v<9?s.formatDistance("overXYears",M,a):s.formatDistance("almostXYears",M+1,a)}}function De(e,t){return G(e,t==null?void 0:t.in).getDate()}const se=e=>{let{transform:t}=e;return{...t,y:0}};function pe(){const[e,t]=l.useState({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),n=l.useRef(null);return l.useLayoutEffect(()=>{const o=s=>{var c;let r={x:s.pageX,y:s.pageY};if(((c=n.current)==null?void 0:c.nodeType)===Node.ELEMENT_NODE){const{left:a,top:d}=n.current.getBoundingClientRect(),u=a+window.scrollX,p=d+window.scrollY,h=s.pageX-u,f=s.pageY-p;r.elementX=h,r.elementY=f,r.elementPositionX=u,r.elementPositionY=p}t(a=>({...a,...r}))};return document.addEventListener("mousemove",o),()=>{document.removeEventListener("mousemove",o)}},[]),[e,n]}function _n(e,t=500){const[n,o]=l.useState(e),s=l.useRef(null);return l.useEffect(()=>{const r=Date.now();if(s.current&&r>=s.current+t)s.current=r,o(e);else{const c=window.setTimeout(()=>{s.current=r,o(e)},t);return()=>window.clearTimeout(c)}},[e,t]),n}function Dn(){const[e,t]=l.useState({x:null,y:null}),n=l.useCallback((...o)=>{if(typeof o[0]=="object")window.scrollTo(o[0]);else if(typeof o[0]=="number"&&typeof o[1]=="number")window.scrollTo(o[0],o[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 l.useLayoutEffect(()=>{const o=()=>{t({x:window.scrollX,y:window.scrollY})};return o(),window.addEventListener("scroll",o),()=>{window.removeEventListener("scroll",o)}},[]),[e,n]}const B={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function Fe(e){return"init"in e}function ue(e){return!!e.write}function Ne(e){return"v"in e||"e"in e}function Z(e){if("e"in e)throw e.e;if((B?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function ee(e){return typeof(e==null?void 0:e.then)=="function"}function ze(e,t,n){if(!n.p.has(e)){n.p.add(e);const o=()=>n.p.delete(e);t.then(o,o)}}function Ue(e,t,n){var o;const s=new Set;for(const r of((o=n.get(e))==null?void 0:o.t)||[])s.add(r);for(const r of t.p)s.add(r);return s}const Nn=(e,t,...n)=>t.read(...n),In=(e,t,...n)=>t.write(...n),kn=(e,t)=>{var n;return(n=t.INTERNAL_onInit)==null?void 0:n.call(t,e)},An=(e,t,n)=>{var o;return(o=t.onMount)==null?void 0:o.call(t,n)},En=(e,t)=>{var n;const o=k(e),s=o[0],r=o[6],c=o[9];if((B?"production":void 0)!=="production"&&!t)throw new Error("Atom is undefined or null");let a=s.get(t);return a||(a={d:new Map,p:new Set,n:0},s.set(t,a),(n=r.i)==null||n.call(r,t),c==null||c(e,t)),a},Rn=e=>{const t=k(e),n=t[1],o=t[3],s=t[4],r=t[5],c=t[6],a=t[13],d=[],u=p=>{try{p()}catch(h){d.push(h)}};do{c.f&&u(c.f);const p=new Set,h=p.add.bind(p);o.forEach(f=>{var g;return(g=n.get(f))==null?void 0:g.l.forEach(h)}),o.clear(),r.forEach(h),r.clear(),s.forEach(h),s.clear(),p.forEach(u),o.size&&a(e)}while(o.size||r.size||s.size);if(d.length)throw new AggregateError(d)},On=e=>{const t=k(e),n=t[1],o=t[2],s=t[3],r=t[11],c=t[14],a=t[17],d=[],u=new WeakSet,p=new WeakSet,h=Array.from(s);for(;h.length;){const f=h[h.length-1],g=r(e,f);if(p.has(f)){h.pop();continue}if(u.has(f)){if(o.get(f)===g.n)d.push([f,g]);else if((B?"production":void 0)!=="production"&&o.has(f))throw new Error("[Bug] invalidated atom exists");p.add(f),h.pop();continue}u.add(f);for(const v of Ue(f,g,n))u.has(v)||h.push(v)}for(let f=d.length-1;f>=0;--f){const[g,v]=d[f];let M=!1;for(const D of v.d.keys())if(D!==g&&s.has(D)){M=!0;break}M&&(c(e,g),a(e,g)),o.delete(g)}},fe=new WeakSet,Pn=(e,t)=>{var n,o;const s=k(e),r=s[1],c=s[2],a=s[3],d=s[6],u=s[7],p=s[11],h=s[12],f=s[13],g=s[14],v=s[16],M=s[17],D=s[20],y=s[26],x=p(e,t);if(Ne(x)){if(r.has(t)&&c.get(t)!==x.n)return x;let w=!1;for(const[I,E]of x.d)if(g(e,I).n!==E){w=!0;break}if(!w)return x}let j=!0;const A=new Set(x.d.keys()),_=new Map,m=()=>{for(const w of A)_.has(w)||x.d.delete(w)},C=()=>{if(r.has(t)){const w=!a.size;M(e,t),w&&(f(e),h(e))}},b=w=>{var I;if(w===t){const Y=p(e,w);if(!Ne(Y))if(Fe(w))D(e,w,w.init);else throw new Error("no atom init");return Z(Y)}const E=g(e,w);try{return Z(E)}finally{_.set(w,E.n),x.d.set(w,E.n),ee(x.v)&&ze(t,x.v,E),r.has(t)&&((I=r.get(w))==null||I.t.add(t)),j||C()}};let R,T;const N={get signal(){return R||(R=new AbortController),R.signal},get setSelf(){return(B?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(B?"production":void 0)!=="production"&&!ue(t)&&console.warn("setSelf function cannot be used with read-only atom"),!T&&ue(t)&&(T=(...w)=>{if((B?"production":void 0)!=="production"&&j&&console.warn("setSelf function cannot be called in sync"),!j)try{return v(e,t,...w)}finally{f(e),h(e)}}),T}},O=x.n;try{(B?"production":void 0)!=="production"&&fe.delete(e);const w=u(e,t,b,N);if((B?"production":void 0)!=="production"&&fe.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),D(e,t,w),ee(w)){y(e,w,()=>R==null?void 0:R.abort());const I=()=>{m(),C()};w.then(I,I)}else m();return(n=d.r)==null||n.call(d,t),x}catch(w){return delete x.v,x.e=w,++x.n,x}finally{j=!1,O!==x.n&&c.get(t)===O&&(c.set(t,x.n),a.add(t),(o=d.c)==null||o.call(d,t))}},Tn=(e,t)=>{const n=k(e),o=n[1],s=n[2],r=n[11],c=[t];for(;c.length;){const a=c.pop(),d=r(e,a);for(const u of Ue(a,d,o)){const p=r(e,u);s.get(u)!==p.n&&(s.set(u,p.n),c.push(u))}}},Ln=(e,t,...n)=>{const o=k(e),s=o[3],r=o[6],c=o[8],a=o[11],d=o[12],u=o[13],p=o[14],h=o[15],f=o[16],g=o[17],v=o[20];let M=!0;const D=x=>Z(p(e,x)),y=(x,...j)=>{var A;const _=a(e,x);try{if(x===t){if(!Fe(x))throw new Error("atom not writable");(B?"production":void 0)!=="production"&&fe.add(e);const m=_.n,C=j[0];v(e,x,C),g(e,x),m!==_.n&&(s.add(x),h(e,x),(A=r.c)==null||A.call(r,x));return}else return f(e,x,...j)}finally{M||(u(e),d(e))}};try{return c(e,t,D,y,...n)}finally{M=!1}},Bn=(e,t)=>{var n;const o=k(e),s=o[1],r=o[3],c=o[6],a=o[11],d=o[15],u=o[18],p=o[19],h=a(e,t),f=s.get(t);if(f){for(const[g,v]of h.d)if(!f.d.has(g)){const M=a(e,g);u(e,g).t.add(t),f.d.add(g),v!==M.n&&(r.add(g),d(e,g),(n=c.c)==null||n.call(c,g))}for(const g of f.d)if(!h.d.has(g)){f.d.delete(g);const v=p(e,g);v==null||v.t.delete(t)}}},Wn=(e,t)=>{var n;const o=k(e),s=o[1],r=o[4],c=o[6],a=o[10],d=o[11],u=o[12],p=o[13],h=o[14],f=o[16],g=o[18],v=d(e,t);let M=s.get(t);if(!M){h(e,t);for(const D of v.d.keys())g(e,D).t.add(t);if(M={l:new Set,d:new Set(v.d.keys()),t:new Set},s.set(t,M),ue(t)){const D=()=>{let y=!0;const x=(...j)=>{try{return f(e,t,...j)}finally{y||(p(e),u(e))}};try{const j=a(e,t,x);j&&(M.u=()=>{y=!0;try{j()}finally{y=!1}})}finally{y=!1}};r.add(D)}(n=c.m)==null||n.call(c,t)}return M},$n=(e,t)=>{var n,o;const s=k(e),r=s[1],c=s[5],a=s[6],d=s[11],u=s[19],p=d(e,t);let h=r.get(t);if(!h||h.l.size)return h;let f=!1;for(const g of h.t)if((n=r.get(g))!=null&&n.d.has(t)){f=!0;break}if(!f){h.u&&c.add(h.u),h=void 0,r.delete(t);for(const g of p.d.keys()){const v=u(e,g);v==null||v.t.delete(t)}(o=a.u)==null||o.call(a,t);return}return h},Gn=(e,t,n)=>{const o=k(e),s=o[11],r=o[27],c=s(e,t),a="v"in c,d=c.v;if(ee(n))for(const u of c.d.keys())ze(t,n,s(e,u));c.v=n,delete c.e,(!a||!Object.is(d,c.v))&&(++c.n,ee(d)&&r(e,d))},Hn=(e,t)=>{const n=k(e)[14];return Z(n(e,t))},Fn=(e,t,...n)=>{const o=k(e),s=o[12],r=o[13],c=o[16];try{return c(e,t,...n)}finally{r(e),s(e)}},zn=(e,t,n)=>{const o=k(e),s=o[12],r=o[18],c=o[19],d=r(e,t).l;return d.add(n),s(e),()=>{d.delete(n),c(e,t),s(e)}},Un=(e,t,n)=>{const s=k(e)[25];let r=s.get(t);if(!r){r=new Set,s.set(t,r);const c=()=>s.delete(t);t.then(c,c)}r.add(n)},Xn=(e,t)=>{const s=k(e)[25].get(t);s==null||s.forEach(r=>r())},Xe=new WeakMap,k=e=>{const t=Xe.get(e);if((B?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};function Yn(e){const t=k(e),n=t[24];return n?n(t):t}function Kn(...e){const t={get(o){const s=k(t)[21];return s(t,o)},set(o,...s){const r=k(t)[22];return r(t,o,...s)},sub(o,s){const r=k(t)[23];return r(t,o,s)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Nn,In,kn,An,En,Rn,On,Pn,Tn,Ln,Bn,Wn,$n,Gn,Hn,Fn,zn,void 0,new WeakMap,Un,Xn].map((o,s)=>e[s]||o);return Xe.set(t,Object.freeze(n)),t}const Ye={};let Vn=0;function Ke(e,t){const n=`atom${++Vn}`,o={toString(){return(Ye?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?o.read=e:(o.init=e,o.read=qn,o.write=Jn),o}function qn(e){return e(this)}function Jn(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}function Qn(){return Kn()}let z;function Zn(){return z||(z=Qn(),(Ye?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=z),globalThis.__JOTAI_DEFAULT_STORE__!==z&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),z}const eo={},to=l.createContext(void 0);function Ve(e){return l.useContext(to)||Zn()}const me=e=>typeof(e==null?void 0:e.then)=="function",he=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},no=Oe.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(he(e),e)}),re=new WeakMap,Ie=(e,t,n)=>{const s=Yn(e)[26];let r=re.get(t);return r||(r=new Promise((c,a)=>{let d=t;const u=f=>g=>{d===f&&c(g)},p=f=>g=>{d===f&&a(g)},h=()=>{try{const f=n();me(f)?(re.set(f,r),d=f,f.then(u(f),p(f)),s(e,f,h)):c(f)}catch(f){a(f)}};t.then(u(t),p(t)),s(e,t,h)}),re.set(t,r)),r};function oo(e,t){const{delay:n,unstable_promiseStatus:o=!Oe.use}={},s=Ve(),[[r,c,a],d]=l.useReducer(p=>{const h=s.get(e);return Object.is(p[0],h)&&p[1]===s&&p[2]===e?p:[h,s,e]},void 0,()=>[s.get(e),s,e]);let u=r;if((c!==s||a!==e)&&(d(),u=s.get(e)),l.useEffect(()=>{const p=s.sub(e,()=>{if(o)try{const h=s.get(e);me(h)&&he(Ie(s,h,()=>s.get(e)))}catch{}if(typeof n=="number"){setTimeout(d,n);return}d()});return d(),p},[s,e,n,o]),l.useDebugValue(u),me(u)){const p=Ie(s,u,()=>s.get(e));return o&&he(p),no(p)}return u}function so(e,t){const n=Ve();return l.useCallback((...s)=>{if((eo?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function qe(e,t){return[oo(e),so(e)]}var Je="Expected a function",ke=NaN,ro="[object Symbol]",ao=/^\s+|\s+$/g,io=/^[-+]0x[0-9a-f]+$/i,co=/^0b[01]+$/i,lo=/^0o[0-7]+$/i,uo=parseInt,fo=typeof K=="object"&&K&&K.Object===Object&&K,mo=typeof self=="object"&&self&&self.Object===Object&&self,ho=fo||mo||Function("return this")(),po=Object.prototype,go=po.toString,xo=Math.max,vo=Math.min,ae=function(){return ho.Date.now()};function yo(e,t,n){var o,s,r,c,a,d,u=0,p=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(Je);t=Ae(t)||0,te(n)&&(p=!!n.leading,h="maxWait"in n,r=h?xo(Ae(n.maxWait)||0,t):r,f="trailing"in n?!!n.trailing:f);function g(m){var C=o,b=s;return o=s=void 0,u=m,c=e.apply(b,C),c}function v(m){return u=m,a=setTimeout(y,t),p?g(m):c}function M(m){var C=m-d,b=m-u,R=t-C;return h?vo(R,r-b):R}function D(m){var C=m-d,b=m-u;return d===void 0||C>=t||C<0||h&&b>=r}function y(){var m=ae();if(D(m))return x(m);a=setTimeout(y,M(m))}function x(m){return a=void 0,f&&o?g(m):(o=s=void 0,c)}function j(){a!==void 0&&clearTimeout(a),u=0,o=d=s=a=void 0}function A(){return a===void 0?c:x(ae())}function _(){var m=ae(),C=D(m);if(o=arguments,s=this,d=m,C){if(a===void 0)return v(d);if(h)return a=setTimeout(y,t),g(d)}return a===void 0&&(a=setTimeout(y,t)),c}return _.cancel=j,_.flush=A,_}function bo(e,t,n){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Je);return te(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),yo(e,t,{leading:o,maxWait:t,trailing:s})}function te(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function wo(e){return!!e&&typeof e=="object"}function Mo(e){return typeof e=="symbol"||wo(e)&&go.call(e)==ro}function Ae(e){if(typeof e=="number")return e;if(Mo(e))return ke;if(te(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=te(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ao,"");var n=co.test(e);return n||lo.test(e)?uo(e.slice(2),n?2:8):io.test(e)?ke:+e}var Co=bo;const So=At(Co),Qe=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Qe.displayName="Card";const jo=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("flex flex-col space-y-1.5 p-6",e),...t}));jo.displayName="CardHeader";const _o=l.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:S("text-2xl font-semibold leading-none tracking-tight",e),...t}));_o.displayName="CardTitle";const Do=l.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:S("text-sm text-muted-foreground",e),...t}));Do.displayName="CardDescription";const No=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("p-6 pt-0",e),...t}));No.displayName="CardContent";const Io=l.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:S("flex items-center p-6 pt-0",e),...t}));Io.displayName="CardFooter";function ko(e,t=[]){let n=[];function o(r,c){const a=l.createContext(c),d=n.length;n=[...n,c];const u=h=>{var y;const{scope:f,children:g,...v}=h,M=((y=f==null?void 0:f[e])==null?void 0:y[d])||a,D=l.useMemo(()=>v,Object.values(v));return i.jsx(M.Provider,{value:D,children:g})};u.displayName=r+"Provider";function p(h,f){var M;const g=((M=f==null?void 0:f[e])==null?void 0:M[d])||a,v=l.useContext(g);if(v)return v;if(c!==void 0)return c;throw new Error(`\`${h}\` must be used within \`${r}\``)}return[u,p]}const s=()=>{const r=n.map(c=>l.createContext(c));return function(a){const d=(a==null?void 0:a[e])||r;return l.useMemo(()=>({[`__scope${e}`]:{...a,[e]:d}}),[a,d])}};return s.scopeName=e,[o,Ao(s,...t)]}function Ao(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(r){const c=o.reduce((a,{useScope:d,scopeName:u})=>{const h=d(r)[`__scope${u}`];return{...a,...h}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Eo(e){const t=Ro(e),n=l.forwardRef((o,s)=>{const{children:r,...c}=o,a=l.Children.toArray(r),d=a.find(Po);if(d){const u=d.props.children,p=a.map(h=>h===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:h);return i.jsx(t,{...c,ref:s,children:l.isValidElement(u)?l.cloneElement(u,void 0,p):null})}return i.jsx(t,{...c,ref:s,children:r})});return n.displayName=`${e}.Slot`,n}function Ro(e){const t=l.forwardRef((n,o)=>{const{children:s,...r}=n;if(l.isValidElement(s)){const c=Lo(s),a=To(r,s.props);return s.type!==l.Fragment&&(a.ref=o?on(o,c):c),l.cloneElement(s,a)}return l.Children.count(s)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oo=Symbol("radix.slottable");function Po(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oo}function To(e,t){const n={...t};for(const o in t){const s=e[o],r=t[o];/^on[A-Z]/.test(o)?s&&r?n[o]=(...a)=>{const d=r(...a);return s(...a),d}:s&&(n[o]=s):o==="style"?n[o]={...s,...r}:o==="className"&&(n[o]=[s,r].filter(Boolean).join(" "))}return{...e,...n}}function Lo(e){var o,s;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wo=Bo.reduce((e,t)=>{const n=Eo(`Primitive.${t}`),o=l.forwardRef((s,r)=>{const{asChild:c,...a}=s,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...a,ref:r})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),ge="ContextMenu",[$o]=ko(ge,[Be]),P=Be(),[Go,Ze]=$o(ge),et=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:o,dir:s,modal:r=!0}=e,[c,a]=l.useState(!1),d=P(t),u=sn(o),p=l.useCallback(h=>{a(h),u(h)},[u]);return i.jsx(Go,{scope:t,open:c,onOpenChange:p,modal:r,children:i.jsx(rn,{...d,dir:s,open:c,onOpenChange:p,modal:r,children:n})})};et.displayName=ge;var tt="ContextMenuTrigger",nt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:o=!1,...s}=e,r=Ze(tt,n),c=P(n),a=l.useRef({x:0,y:0}),d=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(u.current),[]),h=f=>{a.current={x:f.clientX,y:f.clientY},r.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(o&&p()),[o,p]),i.jsxs(i.Fragment,{children:[i.jsx(an,{...c,virtualRef:d}),i.jsx(Wo.span,{"data-state":r.open?"open":"closed","data-disabled":o?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:o?e.onContextMenu:F(e.onContextMenu,f=>{p(),h(f),f.preventDefault()}),onPointerDown:o?e.onPointerDown:F(e.onPointerDown,q(f=>{p(),u.current=window.setTimeout(()=>h(f),700)})),onPointerMove:o?e.onPointerMove:F(e.onPointerMove,q(p)),onPointerCancel:o?e.onPointerCancel:F(e.onPointerCancel,q(p)),onPointerUp:o?e.onPointerUp:F(e.onPointerUp,q(p))})]})});nt.displayName=tt;var Ho="ContextMenuPortal",ot=e=>{const{__scopeContextMenu:t,...n}=e,o=P(t);return i.jsx(cn,{...o,...n})};ot.displayName=Ho;var st="ContextMenuContent",rt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=Ze(st,n),r=P(n),c=l.useRef(!1);return i.jsx(ln,{...r,...o,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var d;(d=e.onCloseAutoFocus)==null||d.call(e,a),!a.defaultPrevented&&c.current&&a.preventDefault(),c.current=!1},onInteractOutside:a=>{var d;(d=e.onInteractOutside)==null||d.call(e,a),!a.defaultPrevented&&!s.modal&&(c.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)"}})});rt.displayName=st;var Fo="ContextMenuGroup",zo=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(un,{...s,...o,ref:t})});zo.displayName=Fo;var Uo="ContextMenuLabel",at=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(fn,{...s,...o,ref:t})});at.displayName=Uo;var Xo="ContextMenuItem",it=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(dn,{...s,...o,ref:t})});it.displayName=Xo;var Yo="ContextMenuCheckboxItem",ct=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(mn,{...s,...o,ref:t})});ct.displayName=Yo;var Ko="ContextMenuRadioGroup",Vo=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(hn,{...s,...o,ref:t})});Vo.displayName=Ko;var qo="ContextMenuRadioItem",lt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(pn,{...s,...o,ref:t})});lt.displayName=qo;var Jo="ContextMenuItemIndicator",dt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(gn,{...s,...o,ref:t})});dt.displayName=Jo;var Qo="ContextMenuSeparator",ut=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(xn,{...s,...o,ref:t})});ut.displayName=Qo;var Zo="ContextMenuArrow",es=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(vn,{...s,...o,ref:t})});es.displayName=Zo;var ts="ContextMenuSubTrigger",ft=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(yn,{...s,...o,ref:t})});ft.displayName=ts;var ns="ContextMenuSubContent",mt=l.forwardRef((e,t)=>{const{__scopeContextMenu:n,...o}=e,s=P(n);return i.jsx(bn,{...s,...o,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)"}})});mt.displayName=ns;function q(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var os=et,ss=nt,rs=ot,ht=rt,pt=at,gt=it,xt=ct,vt=lt,yt=dt,bt=ut,wt=ft,Mt=mt;const as=os,is=ss,cs=l.forwardRef(({className:e,inset:t,children:n,...o},s)=>i.jsxs(wt,{ref:s,className:S("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),...o,children:[n,i.jsx(Wt,{className:"ml-auto h-4 w-4"})]}));cs.displayName=wt.displayName;const ls=l.forwardRef(({className:e,...t},n)=>i.jsx(Mt,{ref:n,className:S("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}));ls.displayName=Mt.displayName;const Ct=l.forwardRef(({className:e,...t},n)=>i.jsx(rs,{children:i.jsx(ht,{ref:n,className:S("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})}));Ct.displayName=ht.displayName;const St=l.forwardRef(({className:e,inset:t,...n},o)=>i.jsx(gt,{ref:o,className:S("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),...n}));St.displayName=gt.displayName;const ds=l.forwardRef(({className:e,children:t,checked:n,...o},s)=>i.jsxs(xt,{ref:s,className:S("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:n,...o,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(yt,{children:i.jsx($t,{className:"h-4 w-4"})})}),t]}));ds.displayName=xt.displayName;const us=l.forwardRef(({className:e,children:t,...n},o)=>i.jsxs(vt,{ref:o,className:S("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),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(yt,{children:i.jsx(Gt,{className:"h-2 w-2 fill-current"})})}),t]}));us.displayName=vt.displayName;const fs=l.forwardRef(({className:e,inset:t,...n},o)=>i.jsx(pt,{ref:o,className:S("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));fs.displayName=pt.displayName;const ms=l.forwardRef(({className:e,...t},n)=>i.jsx(bt,{ref:n,className:S("-mx-1 my-1 h-px bg-border",e),...t}));ms.displayName=bt.displayName;const hs=Ke(!1),ps=Ke(0),xe=()=>qe(hs),ve=()=>qe(ps),gs=e=>{let t=n=>1;return(e==="monthly"||e==="quarterly")&&(t=H),t},X=e=>{let t=We;return(e==="monthly"||e==="quarterly")&&(t=He),t},ye=e=>{let t=Mn;return(e==="monthly"||e==="quarterly")&&(t=We),t},be=e=>{let t=Ht;return(e==="monthly"||e==="quarterly")&&(t=Ft),t},xs=e=>{let t=Ge;return(e==="monthly"||e==="quarterly")&&(t=Pe),t},jt=e=>{let t=$;return(e==="monthly"||e==="quarterly")&&(t=zt),t},U=(e,t)=>{const n=new Date(e.timelineData[0].year,0,1),o=e.columnWidth*e.zoom/100,s=Math.floor(t/o),r=gs(e.range),a=jt(e.range)(n,s),d=r(a),u=Math.round(o/d),p=Math.floor(t%o/u);return $(a,p)},vs=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 n of t)n.quarters=new Array(4).fill(null).map((o,s)=>({months:new Array(3).fill(null).map((r,c)=>{const a=s*3+c;return{days:H(new Date(n.year,a,1))}})}));return t},_t=(e,t,n)=>{const o=n.columnWidth*n.zoom/100,s=X(n.range),r=be(n.range),c=s(r(e),t);if(n.range==="daily")return o*c;const a=e.getDate(),d=H(e),u=o/d;return c*o+a*u},ys=(e,t,n)=>{const o=n.columnWidth*n.zoom/100;if(!t)return o*2;const s=X(n.range);if(n.range==="daily"){const v=s(t,e);return o*(v||1)}const r=H(e),c=o/r;if(de(e,t))return c;const a=ye(n.range),d=be(n.range);if(de(d(e),d(t)))return a(t,e)*c;const u=r-De(e),p=De(t),h=s(d(t),d(e)),f=H(t),g=o/f;return(h-1)*o+u*c+p*g},Dt=(e,t,n)=>{const o=be(t),s=xs(t),r=ye(t),c=o(e),a=s(e),d=r(a,c);return e.getDate()/d*n},L=l.createContext({zoom:100,range:"monthly",columnWidth:50,headerHeight:60,sidebarWidth:300,rowHeight:36,onAddItem:void 0,placeholderLength:2,timelineData:[],ref:null,scrollToFeature:void 0}),we=({title:e,columns:t,renderHeaderItem:n})=>{const o=l.useId();return i.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:[i.jsx("div",{children:i.jsx("div",{className:"sticky inline-flex whitespace-nowrap px-3 py-2 text-muted-foreground text-xs",style:{left:"var(--gantt-sidebar-width)"},children:i.jsx("p",{children:e})})}),i.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:`repeat(${t}, var(--gantt-column-width))`},children:Array.from({length:t}).map((s,r)=>i.jsx("div",{className:"shrink-0 border-border/50 border-b py-1 text-center text-xs",children:n(r)},`${o}-${r}`))})]})},bs=()=>l.useContext(L).timelineData.map(t=>t.quarters.flatMap(n=>n.months).map((n,o)=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:n.days,renderHeaderItem:s=>i.jsxs("div",{className:"flex items-center justify-center gap-1",children:[i.jsx("p",{children:W($(new Date(t.year,o,1),s),"d")}),i.jsx("p",{className:"text-muted-foreground",children:W($(new Date(t.year,o,1),s),"EEEEE")})]}),title:W(new Date(t.year,o,1),"MMMM yyyy")}),i.jsx(Me,{columns:n.days,isColumnSecondary:s=>[0,6].includes($(new Date(t.year,o,1),s).getDay())})]},`${t.year}-${o}`))),ws=()=>l.useContext(L).timelineData.map(t=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:t.quarters.flatMap(n=>n.months).length,renderHeaderItem:n=>i.jsx("p",{children:W(new Date(t.year,n,1),"MMM")}),title:`${t.year}`}),i.jsx(Me,{columns:t.quarters.flatMap(n=>n.months).length})]},t.year)),Ms=()=>l.useContext(L).timelineData.map(t=>t.quarters.map((n,o)=>i.jsxs("div",{className:"relative flex flex-col",children:[i.jsx(we,{columns:n.months.length,renderHeaderItem:s=>i.jsx("p",{children:W(new Date(t.year,o*3+s,1),"MMM")}),title:`Q${o+1} ${t.year}`}),i.jsx(Me,{columns:n.months.length})]},`${t.year}-${o}`))),Cs={daily:bs,monthly:ws,quarterly:Ms},Ss=({className:e})=>{const t=l.useContext(L),n=Cs[t.range];return i.jsx("div",{className:S("-space-x-px flex h-full w-max divide-x divide-border/50",e),children:i.jsx(n,{})})},ie=({feature:e,onSelectItem:t,className:n})=>{const o=l.useContext(L),s=e.endAt&&de(e.startAt,e.endAt)?$(e.endAt,1):e.endAt,r=s?_e(e.startAt,s):`${_e(e.startAt,new Date)} so far`,c=d=>{var u;d.target===d.currentTarget&&((u=o.scrollToFeature)==null||u.call(o,e),t==null||t(e.id))},a=d=>{var u;d.key==="Enter"&&((u=o.scrollToFeature)==null||u.call(o,e),t==null||t(e.id))};return i.jsxs("div",{className:S("relative flex items-center gap-2.5 p-2.5 text-xs hover:bg-secondary",n),onClick:c,onKeyDown:a,role:"button",style:{height:"var(--gantt-row-height)"},tabIndex:0,children:[i.jsx("div",{className:"pointer-events-none h-2 w-2 shrink-0 rounded-full",style:{backgroundColor:e.status.color}}),i.jsx("p",{className:"pointer-events-none flex-1 truncate text-left font-medium",children:e.name}),i.jsx("p",{className:"pointer-events-none text-muted-foreground",children:r})]},e.id)},js=()=>i.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:[i.jsx("p",{className:"flex-1 truncate text-left",children:"Issues"}),i.jsx("p",{className:"shrink-0",children:"Duration"})]}),ce=({children:e,name:t,className:n})=>i.jsxs("div",{className:n,children:[i.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}),i.jsx("div",{className:"divide-y divide-border/50",children:e})]}),_s=({children:e,className:t})=>i.jsxs("div",{className:S("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:[i.jsx(js,{}),i.jsx("div",{className:"space-y-4",children:e})]}),Ds=({top:e,className:t})=>{const[n]=ve(),o=l.useContext(L),[s,r]=pe(),c=()=>{var p,h,f;const a=(h=(p=o.ref)==null?void 0:p.current)==null?void 0:h.getBoundingClientRect(),d=s.x-((a==null?void 0:a.left)??0)+n-o.sidebarWidth,u=U(o,d);(f=o.onAddItem)==null||f.call(o,u)};return i.jsx("div",{className:S("absolute top-0 w-full px-0.5",t),ref:r,style:{marginTop:-o.rowHeight/2,transform:`translateY(${e}px)`},children:i.jsx("button",{className:"flex h-full w-full items-center justify-center rounded-md border border-dashed p-2",onClick:c,type:"button",children:i.jsx(Te,{className:"pointer-events-none select-none text-muted-foreground",size:16})})})},Ns=({index:e,isColumnSecondary:t})=>{var f;const n=l.useContext(L),[o]=xe(),[s,r]=pe(),[c,a]=l.useState(!1),[d]=Dn(),u=()=>a(!0),p=()=>a(!1),h=_n(s.y-(((f=r.current)==null?void 0:f.getBoundingClientRect().y)??0)-(d.y??0),10);return i.jsx("div",{className:S("group relative h-full overflow-hidden",t!=null&&t(e)?"bg-[#f59e0b]/5 dark:bg-[#f59e0b]/5":""),onMouseEnter:u,onMouseLeave:p,ref:r,children:!o&&c&&n.onAddItem?i.jsx(Ds,{top:h}):null})},Me=({columns:e,isColumnSecondary:t})=>{const n=l.useId();return i.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((o,s)=>i.jsx(Ns,{index:s,isColumnSecondary:t},`${n}-${s}`))})},Ee=({direction:e,featureId:t,date:n})=>{const[,o]=xe(),{attributes:s,listeners:r,setNodeRef:c}=Le({id:`feature-drag-helper-${t}`}),a=!!s["aria-pressed"];return l.useEffect(()=>o(a),[a,o]),i.jsxs("div",{className:S("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:c,...s,...r,children:[i.jsx("div",{className:S("-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",a&&(e==="left"?"left-0":"right-0"),"group-hover:opacity-100",a&&"opacity-100")}),n&&i.jsx("div",{className:S("-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",a&&"block"),children:W(n,"MMM dd, yyyy")})]})},Is=({id:e,children:t})=>{const[,n]=xe(),{attributes:o,listeners:s,setNodeRef:r}=Le({id:e}),c=!!o["aria-pressed"];return l.useEffect(()=>n(c),[c,n]),i.jsx(Qe,{className:"h-full w-full rounded-md bg-background p-2 text-xs shadow-sm",children:i.jsx("div",{className:S("flex h-full w-full items-center justify-between gap-2 text-left",c&&"cursor-grabbing"),...o,...s,ref:r,children:t})})},Re=({onMove:e,children:t,className:n,...o})=>{const[s]=ve(),r=l.useContext(L),c=l.useMemo(()=>{var N;return new Date(((N=r.timelineData.at(0))==null?void 0:N.year)??0,0,1)},[r.timelineData]),[a,d]=l.useState(o.startAt),[u,p]=l.useState(o.endAt),h=l.useMemo(()=>ys(a,u,r),[a,u,r]),f=l.useMemo(()=>_t(a,c,r),[a,c,r]),g=l.useMemo(()=>jt(r.range),[r.range]),[v]=pe(),[M,D]=l.useState(0),[y,x]=l.useState(a),[j,A]=l.useState(u),_=tn(nn,{activationConstraint:{distance:10}}),m=l.useCallback(()=>{D(v.x),x(a),A(u)},[v.x,a,u]),C=l.useCallback(()=>{const N=U(r,v.x),O=U(r,M),w=r.range==="daily"?X(r.range)(N,O):ye(r.range)(N,O),I=$(y,w),E=j?$(j,w):null;d(I),p(E)},[r,v.x,M,y,j]),b=l.useCallback(()=>e==null?void 0:e(o.id,a,u),[e,o.id,a,u]),R=l.useCallback(()=>{var I,E;const N=(E=(I=r.ref)==null?void 0:I.current)==null?void 0:E.getBoundingClientRect(),O=v.x-((N==null?void 0:N.left)??0)+s-r.sidebarWidth,w=U(r,O);d(w)},[r,v.x,s]),T=l.useCallback(()=>{var I,E;const N=(E=(I=r.ref)==null?void 0:I.current)==null?void 0:E.getBoundingClientRect(),O=v.x-((N==null?void 0:N.left)??0)+s-r.sidebarWidth,w=U(r,O);p(w)},[r,v.x,s]);return i.jsx("div",{className:S("relative flex w-max min-w-full py-0.5",n),style:{height:"var(--gantt-row-height)"},children:i.jsxs("div",{className:"pointer-events-auto absolute top-0.5",style:{height:"calc(var(--gantt-row-height) - 4px)",width:Math.round(h),left:Math.round(f)},children:[e&&i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:R,sensors:[_],children:i.jsx(Ee,{date:a,direction:"left",featureId:o.id})}),i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:C,onDragStart:m,sensors:[_],children:i.jsx(Is,{id:o.id,children:t??i.jsx("p",{className:"flex-1 truncate text-xs",children:o.name})})}),e&&i.jsx(oe,{modifiers:[se],onDragEnd:b,onDragMove:T,sensors:[_],children:i.jsx(Ee,{date:u??g(a,2),direction:"right",featureId:o.id})})]})})},le=({children:e,className:t})=>i.jsx("div",{className:t,style:{paddingTop:"var(--gantt-row-height)"},children:e}),ks=({className:e,children:t})=>i.jsx("div",{className:S("absolute top-0 left-0 h-full w-max space-y-4",e),style:{marginTop:"var(--gantt-header-height)"},children:t}),Nt=l.memo(({label:e,date:t,id:n,onRemove:o,className:s})=>{const r=l.useContext(L),c=l.useMemo(()=>X(r.range),[r.range]),a=l.useMemo(()=>{var h;return new Date(((h=r.timelineData.at(0))==null?void 0:h.year)??0,0,1)},[r.timelineData]),d=l.useMemo(()=>c(t,a),[c,t,a]),u=l.useMemo(()=>Dt(t,r.range,r.columnWidth*r.zoom/100),[t,r.range,r.columnWidth,r.zoom]),p=l.useCallback(()=>o==null?void 0:o(n),[o,n]);return i.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) * ${d} + ${u}px))`},children:[i.jsxs(as,{children:[i.jsx(is,{asChild:!0,children:i.jsxs("div",{className:S("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,i.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:W(t,"MMM dd, yyyy")})]})}),i.jsx(Ct,{children:o?i.jsxs(St,{className:"flex items-center gap-2 text-destructive",onClick:p,children:[i.jsx(wn,{size:16}),"Remove marker"]}):null})]}),i.jsx("div",{className:S("h-full w-px bg-card",s)})]})});Nt.displayName="GanttMarker";const As=({zoom:e=100,range:t="monthly",onAddItem:n,children:o,className:s})=>{const r=l.useRef(null),[c,a]=l.useState(vs(new Date)),[,d]=ve(),[u,p]=l.useState(0),h=60,f=36;let g=50;t==="monthly"?g=150:t==="quarterly"&&(g=100);const v=l.useMemo(()=>({"--gantt-zoom":`${e}`,"--gantt-column-width":`${e/100*g}px`,"--gantt-header-height":`${h}px`,"--gantt-row-height":`${f}px`,"--gantt-sidebar-width":`${u}px`}),[e,g,u]);l.useEffect(()=>{r.current&&(r.current.scrollLeft=r.current.scrollWidth/2-r.current.clientWidth/2,d(r.current.scrollLeft))},[d]),l.useEffect(()=>{const y=()=>{var _;const A=((_=r.current)==null?void 0:_.querySelector('[data-roadmap-ui="gantt-sidebar"]'))?300:0;p(A)};y();const x=new MutationObserver(y);return r.current&&x.observe(r.current,{childList:!0,subtree:!0}),()=>{x.disconnect()}},[]);const M=l.useCallback(So(()=>{var _,m;const y=r.current;if(!y)return;const{scrollLeft:x,scrollWidth:j,clientWidth:A}=y;if(d(x),x===0){const C=(_=c[0])==null?void 0:_.year;if(!C)return;const b=[...c];b.unshift({year:C-1,quarters:new Array(4).fill(null).map((R,T)=>({months:new Array(3).fill(null).map((N,O)=>{const w=T*3+O;return{days:H(new Date(C,w,1))}})}))}),a(b),y.scrollLeft=y.clientWidth,d(y.scrollLeft)}else if(x+A>=j){const C=(m=c.at(-1))==null?void 0:m.year;if(!C)return;const b=[...c];b.push({year:C+1,quarters:new Array(4).fill(null).map((R,T)=>({months:new Array(3).fill(null).map((N,O)=>{const w=T*3+O;return{days:H(new Date(C,w,1))}})}))}),a(b),y.scrollLeft=y.scrollWidth-y.clientWidth,d(y.scrollLeft)}},100),[]);l.useEffect(()=>{const y=r.current;return y&&y.addEventListener("scroll",M),()=>{y&&y.removeEventListener("scroll",M)}},[M]);const D=l.useCallback(y=>{const x=r.current;if(!x)return;const j=new Date(c[0].year,0,1),A=_t(y.startAt,j,{zoom:e,range:t,columnWidth:g}),_=Math.max(0,A);x.scrollTo({left:_,behavior:"smooth"})},[c,e,t,g,u,n]);return i.jsx(L.Provider,{value:{zoom:e,range:t,headerHeight:h,columnWidth:g,sidebarWidth:u,rowHeight:f,onAddItem:n,timelineData:c,placeholderLength:2,ref:r,scrollToFeature:D},children:i.jsx("div",{className:S("gantt relative isolate grid h-full w-full flex-none select-none overflow-auto rounded-sm bg-secondary",t,s),ref:r,style:{...v,gridTemplateColumns:"var(--gantt-sidebar-width) 1fr"},children:o})})},Es=({children:e,className:t})=>i.jsx("div",{className:S("relative flex h-full w-max flex-none overflow-clip",t),children:e}),Rs=({className:e})=>{const t="Today",n=l.useMemo(()=>new Date,[]),o=l.useContext(L),s=l.useMemo(()=>X(o.range),[o.range]),r=l.useMemo(()=>{var d;return new Date(((d=o.timelineData.at(0))==null?void 0:d.year)??0,0,1)},[o.timelineData]),c=l.useMemo(()=>s(n,r),[s,n,r]),a=l.useMemo(()=>Dt(n,o.range,o.columnWidth*o.zoom/100),[n,o.range,o.columnWidth,o.zoom]);return i.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} + ${a}px))`},children:[i.jsxs("div",{className:S("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,i.jsx("span",{className:"max-h-[0] overflow-hidden opacity-80 transition-all group-hover:max-h-[2rem]",children:W(n,"MMM dd, yyyy")})]}),i.jsx("div",{className:S("h-full w-px bg-card",e)})]})};function J(e,t){const n=e.start_date?new Date(e.start_date):new Date(e.due_date),o=e.due_date?new Date(e.due_date):n;return{id:e.id,name:`${e.identifier} ${e.title}`,startAt:n,endAt:o,status:{id:e.status,name:e.status,color:t}}}function $s(){const{projectKey:e}=Et(),t=It(),[n,o]=l.useState("monthly"),[s,r]=l.useState(null),[c,a]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>{const m=requestAnimationFrame(()=>{var w;const C=(w=d.current)==null?void 0:w.querySelector(".gantt");if(!C)return;const b=new Date,R=b.getFullYear()-1,T=300;let N;if(n==="daily"){const I=new Date(R,0,1);N=Math.floor((b.getTime()-I.getTime())/864e5)*50}else{const I=n==="monthly"?150:100,E=(b.getFullYear()-R)*12+b.getMonth(),Y=new Date(b.getFullYear(),b.getMonth()+1,0).getDate();N=E*I+(b.getDate()-1)/Y*I}const O=C.clientWidth-T;C.scrollLeft=Math.max(0,N-O/2)});return()=>cancelAnimationFrame(m)},[n]);const{data:u}=Ut(e??""),p=(u==null?void 0:u.id)??"",{data:h=[]}=Xt(p||void 0),{data:f=[]}=Yt(p||void 0),{data:g=[]}=Kt(p||void 0),v=kt({mutationFn:({id:m,start_date:C,due_date:b})=>en.put(`/admin/issues/${m}`,{start_date:C,due_date:b}),onSuccess:()=>{t.invalidateQueries({queryKey:Zt.byProject(p)})},onError:()=>Qt.error("Failed to update issue dates")}),M=Object.fromEntries(f.map(m=>[m.key,m.color])),D=h.filter(m=>m.due_date),y=h.filter(m=>!m.due_date),x={},j=[];for(const m of D)m.sprint_id?(x[m.sprint_id]||(x[m.sprint_id]=[]),x[m.sprint_id].push(m)):j.push(m);const A=(m,C,b)=>{v.mutate({id:m,start_date:W(C,"yyyy-MM-dd"),due_date:b?W(b,"yyyy-MM-dd"):null})},_=m=>{const C=h.find(b=>b.id===m)??null;r(C)};return e?i.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border shrink-0 bg-white dark:bg-zinc-950",children:[i.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-md p-0.5",children:["daily","monthly","quarterly"].map(m=>i.jsx("button",{onClick:()=>o(m),className:`px-3 py-1 rounded text-xs font-medium transition-colors capitalize ${n===m?"bg-white dark:bg-zinc-900 text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:m},m))}),i.jsxs(Vt,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1",onClick:()=>a(!0),children:[i.jsx(Te,{className:"h-3.5 w-3.5"}),"Issue"]})]}),i.jsx("div",{ref:d,className:"flex-1 min-h-0 overflow-hidden",children:i.jsxs(As,{range:n,zoom:100,className:"h-full bg-white dark:bg-zinc-950",children:[i.jsxs(_s,{children:[g.map(m=>{const C=x[m.id]??[];return i.jsx(ce,{name:m.name,children:C.map(b=>i.jsx(ie,{feature:J(b,M[b.status]??"#94a3b8"),onSelectItem:_},b.id))},m.id)}),j.length>0&&i.jsx(ce,{name:"No Sprint",children:j.map(m=>i.jsx(ie,{feature:J(m,M[m.status]??"#94a3b8"),onSelectItem:_},m.id))}),y.length>0&&i.jsx(ce,{name:"Unscheduled",children:y.map(m=>i.jsx(ie,{feature:{id:m.id,name:`${m.identifier} ${m.title}`,startAt:new Date,endAt:new Date,status:{id:m.status,name:m.status,color:M[m.status]??"#94a3b8"}},onSelectItem:_},m.id))})]}),i.jsxs(Es,{children:[i.jsx(Ss,{}),i.jsxs(ks,{children:[g.map(m=>{const C=x[m.id]??[];return i.jsx(le,{children:C.map(b=>i.jsx("div",{className:"flex",children:i.jsx(Re,{onMove:A,...J(b,M[b.status]??"#94a3b8")})},b.id))},m.id)}),j.length>0&&i.jsx(le,{children:j.map(m=>i.jsx("div",{className:"flex",children:i.jsx(Re,{onMove:A,...J(m,M[m.status]??"#94a3b8")})},m.id))}),y.length>0&&i.jsx(le,{children:y.map(m=>i.jsx("div",{style:{height:"var(--gantt-row-height)"}},m.id))})]}),g.filter(m=>m.end_date).map(m=>i.jsx(Nt,{id:m.id,date:new Date(m.end_date),label:`${m.name} end`},m.id)),i.jsx(Rs,{})]})]})}),i.jsx(qt,{issue:s,projectId:p,open:!!s,onClose:()=>r(null)}),i.jsx(Jt,{open:c,onClose:()=>a(!1),projectId:p})]}):null}export{$s as ProjectTimelinePage};
|