forge-openclaw-plugin 0.2.100 → 0.2.101
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/{activity-page-5oyCFOns.js → activity-page-CpjuNSHw.js} +1 -1
- package/dist/assets/{ai-surface-workspace-qgk_B57-.js → ai-surface-workspace-DEAFZruS.js} +1 -1
- package/dist/assets/{atlas-panel-rfH2qOez.js → atlas-panel-CdVNPotj.js} +1 -1
- package/dist/assets/{calendar-page-Bo2iua-a.js → calendar-page-DNNt6lfz.js} +1 -1
- package/dist/assets/{calendar-rules-DA1g3QUk.js → calendar-rules-DNJFNsxi.js} +1 -1
- package/dist/assets/{calendar-week-toolbar-DU1Q4RYj.js → calendar-week-toolbar-BbPwYeN0.js} +1 -1
- package/dist/assets/{companion-sync-lab-page-CosNknOK.js → companion-sync-lab-page-KxEDigM6.js} +1 -1
- package/dist/assets/{daily-metrics-dashboard-LjuGAB3f.js → daily-metrics-dashboard-B3cqJgDt.js} +1 -1
- package/dist/assets/{entity-note-count-link-BmGDB572.js → entity-note-count-link-DrhjJZ4i.js} +1 -1
- package/dist/assets/{entity-notes-surface-DgEgicaE.js → entity-notes-surface-CkcRsKJQ.js} +1 -1
- package/dist/assets/{execution-board-CDRXQB85.js → execution-board-D07gOocB.js} +1 -1
- package/dist/assets/{faceted-token-search-CE1YauRd.js → faceted-token-search-BxRRcM3q.js} +1 -1
- package/dist/assets/{flagship-signal-deck-DDds90Gl.js → flagship-signal-deck-cmy82b8_.js} +1 -1
- package/dist/assets/{floating-action-menu-CJkI2iFy.js → floating-action-menu-Fs_ZiUMo.js} +1 -1
- package/dist/assets/{goal-detail-page-cJvHaLMQ.js → goal-detail-page-CqLiNz4f.js} +1 -1
- package/dist/assets/{goals-page-f_39hvUV.js → goals-page-BTk7mg_T.js} +1 -1
- package/dist/assets/{habits-page-DKb96_mj.js → habits-page-BJxagdzx.js} +1 -1
- package/dist/assets/{index-BHTUu_4M.js → index-CF4J4R9L.js} +2 -2
- package/dist/assets/{insight-flow-dialog-pzAzyayN.js → insight-flow-dialog-8f3D0GuC.js} +1 -1
- package/dist/assets/{insights-page-Dc9oFltJ.js → insights-page-D6rOa7uk.js} +1 -1
- package/dist/assets/{kanban-page-JAxerYh6.js → kanban-page-XQ7Se6dH.js} +1 -1
- package/dist/assets/{knowledge-graph-page-UQ3skqEi.js → knowledge-graph-page-BtAg8iv3.js} +1 -1
- package/dist/assets/{life-force-page-BGDbQuVh.js → life-force-page-Dy0JTS2G.js} +1 -1
- package/dist/assets/{life-force-workspace-B1fYSXRC.js → life-force-workspace-OfyB9HJM.js} +1 -1
- package/dist/assets/{metric-tile-DX6TclqM.js → metric-tile-DKpo-8xw.js} +1 -1
- package/dist/assets/{movement-page-6HP6nGJx.js → movement-page-Bg_T_Stx.js} +1 -1
- package/dist/assets/{note-markdown-DiW2-5d3.js → note-markdown-N-uxD3Xt.js} +1 -1
- package/dist/assets/{note-tags-input-DDLXf54U.js → note-tags-input-Cdu7wiw6.js} +1 -1
- package/dist/assets/{notes-page-BuguDjhz.js → notes-page-CKXnF_KU.js} +1 -1
- package/dist/assets/{open-in-graph-button-Cg5VrKsC.js → open-in-graph-button-IXe9SGth.js} +1 -1
- package/dist/assets/{orbit-map-GD05-0oS.js → orbit-map-Dzi6KliQ.js} +1 -1
- package/dist/assets/{overview-page-DuOs2OCB.js → overview-page-1miYqaVS.js} +1 -1
- package/dist/assets/{page-hero-CQWo1Mm_.js → page-hero-DRy5b2MU.js} +1 -1
- package/dist/assets/{pill-cluster-BJogDRDJ.js → pill-cluster-C9QczVJ2.js} +1 -1
- package/dist/assets/{preference-entity-handoff-button-D4WAs9pC.js → preference-entity-handoff-button-5PzUn42S.js} +1 -1
- package/dist/assets/{preferences-page-BaJTMU1I.js → preferences-page-DtNaF5Q3.js} +1 -1
- package/dist/assets/{project-collections-DvaX20q_.js → project-collections-xPz2mlRr.js} +1 -1
- package/dist/assets/{project-detail-page-drPIFZGb.js → project-detail-page-BXK5-4xW.js} +1 -1
- package/dist/assets/{project-management-hierarchy-page-BUbRXvny.js → project-management-hierarchy-page-DtRpMABw.js} +1 -1
- package/dist/assets/{project-management-section-nav-C2Ud8Zdd.js → project-management-section-nav-P3ixzPa-.js} +1 -1
- package/dist/assets/{projects-page-BGzEZUtg.js → projects-page-C5ViRuf4.js} +1 -1
- package/dist/assets/{psyche-behaviors-page-Dmm_Io9D.js → psyche-behaviors-page-Dco46sC4.js} +1 -1
- package/dist/assets/{psyche-flashcards-page-BgNKJ6QJ.js → psyche-flashcards-page-ZcoEB8gV.js} +1 -1
- package/dist/assets/{psyche-goal-map-page-DXJs98Vr.js → psyche-goal-map-page-CLBAQOI0.js} +1 -1
- package/dist/assets/{psyche-graph-CFgs_Bqc.js → psyche-graph-k4tX2tdp.js} +1 -1
- package/dist/assets/{psyche-metrics-page-zYTJDbyZ.js → psyche-metrics-page-CuR9oqEy.js} +1 -1
- package/dist/assets/{psyche-mode-guide-page-XPgRfCOf.js → psyche-mode-guide-page-hIVXcCnE.js} +1 -1
- package/dist/assets/{psyche-modes-page-B-GA8oRF.js → psyche-modes-page-0lYtBlhO.js} +1 -1
- package/dist/assets/{psyche-page--r6a3e1t.js → psyche-page-VZ9k9ISp.js} +1 -1
- package/dist/assets/{psyche-patterns-page-BM5-3bMm.js → psyche-patterns-page-gx5nmdGq.js} +1 -1
- package/dist/assets/{psyche-questionnaire-builder-page-CJshQ-mg.js → psyche-questionnaire-builder-page-Bn0TOISd.js} +1 -1
- package/dist/assets/{psyche-questionnaire-detail-page-USmR5G5A.js → psyche-questionnaire-detail-page-CmVzSd_s.js} +1 -1
- package/dist/assets/{psyche-questionnaire-run-detail-page-D7iBCmTi.js → psyche-questionnaire-run-detail-page-BsMbmXCG.js} +1 -1
- package/dist/assets/{psyche-questionnaire-run-page-Cpil-kDh.js → psyche-questionnaire-run-page-CgkRL2vi.js} +1 -1
- package/dist/assets/{psyche-questionnaires-page-C-_y3VwS.js → psyche-questionnaires-page-D7V8uLXM.js} +1 -1
- package/dist/assets/{psyche-report-detail-page--dkSPRaj.js → psyche-report-detail-page-OlFq57eL.js} +1 -1
- package/dist/assets/{psyche-reports-page-CUaOXmIN.js → psyche-reports-page-dVUZjna1.js} +1 -1
- package/dist/assets/{psyche-schemas-beliefs-page-BX6xaap3.js → psyche-schemas-beliefs-page-BCgc8FUd.js} +1 -1
- package/dist/assets/{psyche-screen-time-page-CAAI4mD7.js → psyche-screen-time-page-B_6BT_WN.js} +1 -1
- package/dist/assets/{psyche-self-observation-page-BZ6FLuwa.js → psyche-self-observation-page-CEG5mluK.js} +1 -1
- package/dist/assets/{psyche-values-page-yEV6MGt8.js → psyche-values-page-DRbRfEd6.js} +1 -1
- package/dist/assets/{report-chain-fields-fZ8Xd4H6.js → report-chain-fields-CALCV3V5.js} +1 -1
- package/dist/assets/{rewards-page-C2HQjIAf.js → rewards-page-DmC4R_Ps.js} +1 -1
- package/dist/assets/{scheduling-rules-editor-BHOpHOrV.js → scheduling-rules-editor-D02s70hr.js} +1 -1
- package/dist/assets/{schema-badge-DyKbxb51.js → schema-badge-BZO-qNhO.js} +1 -1
- package/dist/assets/{select-menu-BX-pZNqL.js → select-menu-fYyreSdQ.js} +1 -1
- package/dist/assets/{settings-agents-page-VuYXTiyc.js → settings-agents-page-C_v_hMJF.js} +1 -1
- package/dist/assets/{settings-bin-page-BNzvYaOk.js → settings-bin-page-DY5bg81n.js} +1 -1
- package/dist/assets/{settings-calendar-page-CjSFB53S.js → settings-calendar-page-D1CzE6cg.js} +1 -1
- package/dist/assets/{settings-data-page-CGSlryuI.js → settings-data-page-CHRQFU9H.js} +1 -1
- package/dist/assets/{settings-logs-page-BTK5fine.js → settings-logs-page-B04pUwEv.js} +1 -1
- package/dist/assets/{settings-mobile-page-CRaObOGo.js → settings-mobile-page-D9kTlYDS.js} +1 -1
- package/dist/assets/{settings-models-page-DFshpYF8.js → settings-models-page-D26270R2.js} +1 -1
- package/dist/assets/{settings-page-BP81Mb5R.js → settings-page-DYDTFlnv.js} +1 -1
- package/dist/assets/{settings-rewards-page-CDJ1PH2G.js → settings-rewards-page-cl4vqqO_.js} +1 -1
- package/dist/assets/{settings-section-nav-CCFm27r2.js → settings-section-nav-DSOuht_F.js} +1 -1
- package/dist/assets/{settings-users-page-TdUocFPa.js → settings-users-page-BU79JB_T.js} +1 -1
- package/dist/assets/{settings-wiki-page-B2zX0QQG.js → settings-wiki-page-DwAUlyA3.js} +1 -1
- package/dist/assets/{sleep-page-cI1GMVzk.js → sleep-page-D8NbdhyS.js} +1 -1
- package/dist/assets/{sports-page-06LTqp0V.js → sports-page-CV4Cnzwn.js} +1 -1
- package/dist/assets/{strategies-page-DXP9Kx8s.js → strategies-page-C4qvXnql.js} +1 -1
- package/dist/assets/{strategy-detail-page-D6mx_Mik.js → strategy-detail-page-DJLo5rfy.js} +1 -1
- package/dist/assets/{strategy-dialog-BvzomTaF.js → strategy-dialog-D3AuUlVz.js} +1 -1
- package/dist/assets/{task-detail-page-BIWIggdp.js → task-detail-page-z-9u9rF0.js} +1 -1
- package/dist/assets/{timebox-planning-dialog-CaCnoslG.js → timebox-planning-dialog-DB6FLqmI.js} +1 -1
- package/dist/assets/{today-page-DO2mRPT2.js → today-page-BKlu6gx5.js} +1 -1
- package/dist/assets/{training-load-page-CyZ0mlEr.js → training-load-page-CyJQqo_3.js} +1 -1
- package/dist/assets/{vitals-page-BQvEjTc6.js → vitals-page-qre17Nw8.js} +1 -1
- package/dist/assets/{weekly-review-page-Tp6Q9CRj.js → weekly-review-page-Cz4vkRcx.js} +1 -1
- package/dist/assets/weight-loss-page-BQrnOI0y.js +1 -0
- package/dist/assets/{wiki-article-markdown-DQYohmW2.js → wiki-article-markdown-DdiR2TJE.js} +1 -1
- package/dist/assets/{wiki-editor-page-Dem_3eZv.js → wiki-editor-page-DqwoqVFb.js} +1 -1
- package/dist/assets/{wiki-ingest-history-page-BxoOcCoJ.js → wiki-ingest-history-page--evBLbOw.js} +1 -1
- package/dist/assets/{wiki-ingest-modal-DhguKk3J.js → wiki-ingest-modal--ohzFnj2.js} +1 -1
- package/dist/assets/{wiki-page-BLRxVXkl.js → wiki-page-B_VJFBPA.js} +1 -1
- package/dist/assets/{workbench-flow-page-DqMkCCTy.js → workbench-flow-page-Du62mtJU.js} +1 -1
- package/dist/assets/{workbench-page-BWd02wPw.js → workbench-page-4MKr3iRm.js} +1 -1
- package/dist/assets/{workout-detail-page-BD8u7GyL.js → workout-detail-page-DfUbYYw1.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/server/server/src/watch-mobile.js +22 -10
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/assets/weight-loss-page-BBzlhLVV.js +0 -1
package/dist/assets/{daily-metrics-dashboard-LjuGAB3f.js → daily-metrics-dashboard-B3cqJgDt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bU as j,j as e,d1 as M,d2 as V,aI as _,d3 as S,d4 as P,d5 as L,aG as T,aX as z,r as u,cX as R,aK as $}from"./vendor-DHkYh85p.js";import{R as K,P as F,O as B,C as O,T as A,D as W,a as I}from"./ui-C13Nbgas.js";import{C as v,Z as x,c}from"./index-BHTUu_4M.js";import{R as X,e as E,C as G,X as H,Y,d as U,T as Z,B as q,a as J}from"./charts-P7EVhIog.js";function m(a){return a?new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"No date yet"}function Q(a,s){return s==="cumulative"?a.total??a.latest??a.maximum??a.average:a.latest??a.average??a.maximum??a.minimum}function d(a,s){if(s==null)return"No reading";const t=a.unit==="steps"||a.unit==="flights"||a.unit==="kcal"||a.unit==="min"||a.unit==="swears"||a.unit==="conversations"||a.unit==="messages"?0:(a.unit==="%",1);return`${s.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t===0||s>=100?0:1})} ${a.unit}`}function w(a){return a.deltaValue==null?"No baseline yet":`${a.deltaValue>0?"+":""}${d(a,a.deltaValue)}`}function ee(a){return Math.round(a*10)/10}function N(a,s){return Q(a,s)}function b(a){const s=a.days.map(t=>N(t,a.aggregation)).filter(t=>t!=null);return s.length===0?{minimum:null,average:null,maximum:null,count:0}:{minimum:Math.min(...s),average:s.reduce((t,i)=>t+i,0)/s.length,maximum:Math.max(...s),count:s.length}}function y(a){return new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ae({active:a,payload:s,label:t,metric:i}){var r;if(!a||!(s!=null&&s.length)||typeof t!="string")return null;const l=((r=s.find(n=>typeof n.value=="number"))==null?void 0:r.value)??null;return e.jsxs("div",{className:"rounded-[18px] border border-white/10 bg-[rgba(9,13,24,0.94)] px-3 py-2 shadow-[0_18px_48px_rgba(0,0,0,0.38)] backdrop-blur-xl",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/40",children:y(t)}),e.jsx("div",{className:"mt-1 text-sm font-semibold text-white",children:d(i,l)})]})}function k({metric:a,height:s=180,detailed:t=!1}){const i=u.useMemo(()=>b(a),[a]),l=u.useMemo(()=>a.days.map(o=>({dateKey:o.dateKey,value:N(o,a.aggregation),sampleCount:o.sampleCount})),[a]),r=l.map(o=>o.value).filter(o=>o!=null),n=r.length>0?Math.min(...r):0,p=r.length>0?Math.max(...r):1,f=Math.max((p-n)*.12,a.unit==="%"?2:1),C=g(a.category),h=`metric-gradient-${a.metric.replace(/[^a-z0-9]/gi,"-")}`;return r.length===0?e.jsx("div",{className:"flex items-center justify-center rounded-[22px] border border-dashed border-white/8 bg-white/[0.025] text-sm text-white/40",style:{height:s},children:"Waiting for chart data"}):e.jsx("div",{className:x("overflow-hidden rounded-[22px] border bg-[radial-gradient(circle_at_top_left,rgba(171,232,255,0.08),transparent_34%),rgba(255,255,255,0.025)] p-3",C.ring),style:{height:s},children:e.jsx(X,{width:"100%",height:"100%",children:e.jsxs(E,{data:l,margin:{top:t?18:8,right:t?18:4,bottom:t?12:0,left:t?8:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:h,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"rgba(171,232,255,0.55)"}),e.jsx("stop",{offset:"56%",stopColor:"rgba(251,191,36,0.22)"}),e.jsx("stop",{offset:"100%",stopColor:"rgba(251,191,36,0.02)"})]})}),e.jsx(G,{stroke:"rgba(255,255,255,0.07)",vertical:t}),e.jsx(H,{dataKey:"dateKey",tickFormatter:y,minTickGap:t?22:34,tick:{fill:"rgba(255,255,255,0.46)",fontSize:11},axisLine:{stroke:"rgba(255,255,255,0.1)"},tickLine:!1}),e.jsx(Y,{width:t?62:36,domain:[Math.max(0,n-f),p+f],tickFormatter:o=>d(a,Number(o)).replace(` ${a.unit}`,""),tick:{fill:"rgba(255,255,255,0.46)",fontSize:11},axisLine:!1,tickLine:!1}),i.average!=null?e.jsx(U,{y:ee(i.average),stroke:"rgba(255,255,255,0.34)",strokeDasharray:"5 5",ifOverflow:"extendDomain"}):null,e.jsx(Z,{cursor:{stroke:"rgba(255,255,255,0.22)",strokeWidth:1},content:e.jsx(ae,{metric:a})}),a.aggregation==="cumulative"?e.jsx(q,{dataKey:"value",radius:[8,8,2,2],fill:`url(#${h})`,maxBarSize:t?34:20}):e.jsx(J,{type:"monotone",dataKey:"value",stroke:"rgba(171,232,255,0.92)",strokeWidth:t?3:2,fill:`url(#${h})`,dot:t?{r:3,fill:"rgba(251,191,36,0.9)"}:!1,activeDot:{r:5,fill:"rgba(251,191,36,0.95)"}})]})})})}function te({metric:a,open:s,onOpenChange:t}){const i=b(a),l=g(a.category);return e.jsx(K,{open:s,onOpenChange:t,children:e.jsxs(F,{children:[e.jsx(B,{className:"fixed inset-0 z-50 bg-[rgba(3,7,18,0.82)] backdrop-blur-xl"}),e.jsxs(O,{className:"fixed inset-3 z-[51] grid min-h-0 overflow-hidden rounded-[32px] border border-white/10 bg-[radial-gradient(circle_at_top_left,rgba(171,232,255,0.12),transparent_34%),linear-gradient(180deg,rgba(12,18,32,0.98),rgba(7,10,20,0.99))] shadow-[0_34px_110px_rgba(0,0,0,0.58)] sm:inset-5",children:[e.jsxs(A,{className:"sr-only",children:[a.label," chart"]}),e.jsx(W,{className:"sr-only",children:"Full-screen time-series chart for the selected daily metric."}),e.jsxs("div",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-white/8 px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:[a.category," time series"]}),e.jsx("div",{className:"mt-1 text-2xl font-semibold text-white sm:text-3xl",children:a.label}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-white/54",children:[e.jsx(c,{className:l.badge,children:a.aggregation}),e.jsxs(c,{tone:"meta",children:[a.coverageDays," tracked days"]}),e.jsxs(c,{tone:"meta",children:["latest ",m(a.latestDateKey)]})]})]}),e.jsx(I,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex size-11 items-center justify-center rounded-full border border-white/10 bg-white/[0.06] text-white/72 transition hover:bg-white/[0.1] hover:text-white","aria-label":"Close metric chart",children:e.jsx($,{className:"size-5"})})})]}),e.jsxs("div",{className:"grid min-h-0 gap-4 overflow-y-auto p-4 sm:p-6 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[e.jsx(k,{metric:a,height:560,detailed:!0}),e.jsx("div",{className:"grid content-start gap-3",children:[["Latest",a.latestValue],["Period min",i.minimum],["Period average",i.average],["Period max",i.maximum],["Baseline",a.baselineValue],["Delta",a.deltaValue]].map(([r,n])=>e.jsxs("div",{className:"rounded-[22px] border border-white/8 bg-white/[0.035] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:r}),e.jsx("div",{className:"mt-1 text-xl font-semibold text-white",children:d(a,typeof n=="number"?n:null)})]},String(r)))})]})]})]})]})})}function se(a){return a.deltaValue==null||a.deltaValue===0?"steady":a.deltaValue>0?"up":"down"}function g(a){switch(a){case"recovery":return{ring:"border-[rgba(255,122,167,0.18)]",badge:"bg-[rgba(255,122,167,0.16)] text-[rgb(255,179,205)]",glow:"from-[rgba(255,122,167,0.2)] via-[rgba(109,76,255,0.06)] to-transparent"};case"cardio":return{ring:"border-[rgba(109,173,255,0.22)]",badge:"bg-[rgba(109,173,255,0.16)] text-[rgb(186,220,255)]",glow:"from-[rgba(109,173,255,0.22)] via-[rgba(64,108,255,0.08)] to-transparent"};case"breathing":return{ring:"border-[rgba(111,232,195,0.2)]",badge:"bg-[rgba(111,232,195,0.15)] text-[rgb(195,255,237)]",glow:"from-[rgba(111,232,195,0.2)] via-[rgba(29,154,123,0.08)] to-transparent"};case"composition":return{ring:"border-[rgba(247,211,110,0.18)]",badge:"bg-[rgba(247,211,110,0.15)] text-[rgb(255,235,176)]",glow:"from-[rgba(247,211,110,0.18)] via-[rgba(184,128,24,0.08)] to-transparent"};case"temperature":return{ring:"border-[rgba(255,153,102,0.18)]",badge:"bg-[rgba(255,153,102,0.16)] text-[rgb(255,214,190)]",glow:"from-[rgba(255,153,102,0.2)] via-[rgba(255,91,46,0.06)] to-transparent"};case"conversationTone":return{ring:"border-[rgba(251,191,36,0.2)]",badge:"bg-[rgba(251,191,36,0.16)] text-[rgb(255,232,166)]",glow:"from-[rgba(251,191,36,0.18)] via-[rgba(244,114,182,0.08)] to-transparent"};default:return{ring:"border-[rgba(163,174,208,0.16)]",badge:"bg-[rgba(163,174,208,0.14)] text-[rgb(220,228,255)]",glow:"from-[rgba(163,174,208,0.14)] via-[rgba(112,120,167,0.06)] to-transparent"}}}function D(a){switch(a){case"restingHeartRate":case"walkingHeartRateAverage":case"heartRateRecoveryOneMinute":return z;case"heartRateVariabilitySDNN":case"vo2Max":return T;case"oxygenSaturation":case"respiratoryRate":return L;case"bodyMass":case"bodyFatPercentage":case"leanBodyMass":return P;case"stepCount":case"flightsClimbed":case"appleExerciseTime":return S;case"basalEnergyBurned":return _;case"swearingMessagePercent":return V;case"devrageSwearCount":return M;default:return j}}function oe({title:a,description:s,metric:t,emptyDescription:i}){const l=t?D(t.metric):j,r=g(t?t.category:"default"),n=t?se(t):"steady";return e.jsxs(v,{className:x("relative overflow-hidden rounded-[28px] border bg-[rgba(12,18,36,0.82)] p-5 shadow-[0_18px_60px_rgba(4,8,18,0.3)]",r.ring),children:[e.jsx("div",{className:x("pointer-events-none absolute inset-0 bg-gradient-to-br opacity-90",r.glow)}),e.jsxs("div",{className:"relative grid gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/38",children:a}),e.jsx("div",{className:"text-sm leading-6 text-white/56",children:s})]}),e.jsx("div",{className:"rounded-[18px] border border-white/10 bg-white/[0.05] p-3 text-white/80",children:e.jsx(l,{className:"size-5"})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-xl font-semibold text-white",children:t?d(t,t.latestValue):"No signal yet"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-white/56",children:[t?e.jsx(c,{className:r.badge,children:t.label}):null,t?e.jsx(c,{className:x("border-none",n==="up"?"bg-[rgba(111,232,195,0.14)] text-[rgb(190,255,231)]":n==="down"?"bg-[rgba(255,122,167,0.14)] text-[rgb(255,193,215)]":"bg-white/[0.08] text-white/72"),children:w(t)}):null,t?e.jsxs(c,{tone:"meta",children:[t.coverageDays," days tracked"]}):null]}),e.jsx("div",{className:"text-xs text-white/48",children:t?`Latest reading on ${m(t.latestDateKey)}`:i??"Forge will populate this card as soon as daily readings are available."})]})]})]})}function re({metric:a}){const[s,t]=u.useState(!1),i=D(a.metric),l=g(a.category),r=a.days.at(-1),n=b(a);return e.jsxs(v,{className:x("overflow-hidden rounded-[28px] border bg-[linear-gradient(180deg,rgba(12,18,36,0.94),rgba(8,12,24,0.98))] p-5",l.ring),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"rounded-[18px] border border-white/10 bg-white/[0.04] p-3 text-white/84",children:e.jsx(i,{className:"size-5"})}),e.jsxs("div",{className:"grid gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:a.category}),e.jsx("div",{className:"text-xl font-semibold text-white",children:a.label}),e.jsxs("div",{className:"text-sm text-white/52",children:[a.coverageDays," tracked day",a.coverageDays===1?"":"s"]})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:[e.jsx(c,{className:l.badge,children:a.aggregation}),e.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-2 rounded-full border border-white/10 bg-white/[0.055] px-3 py-1.5 text-xs font-medium text-white/72 transition hover:bg-white/[0.09] hover:text-white",onClick:()=>t(!0),children:[e.jsx(R,{className:"size-3.5"}),"Full screen"]})]})]}),e.jsxs("div",{className:"mt-5 grid gap-4 md:grid-cols-[minmax(0,0.95fr)_minmax(220px,1.05fr)]",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Latest"}),e.jsx("div",{className:"mt-1 text-3xl font-semibold text-white",children:d(a,a.latestValue)}),e.jsx("div",{className:"mt-1 text-sm text-white/52",children:a.latestDateKey?`Latest reading on ${m(a.latestDateKey)}`:"Waiting for the first successful reading"})]}),e.jsxs("div",{className:"grid gap-2 rounded-[22px] border border-white/8 bg-white/[0.03] p-4 text-sm text-white/70",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Baseline"}),e.jsx("span",{className:"font-medium text-white",children:d(a,a.baselineValue)})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Delta"}),e.jsx("span",{className:x("font-medium",a.deltaValue==null?"text-white/58":a.deltaValue>0?"text-[rgb(190,255,231)]":a.deltaValue<0?"text-[rgb(255,198,219)]":"text-white"),children:w(a)})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Latest samples"}),e.jsx("span",{className:"font-medium text-white",children:(r==null?void 0:r.sampleCount)??0})]})]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(k,{metric:a}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs text-white/48",children:[e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period min"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.minimum)})]}),e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period avg"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.average)})]}),e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period max"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.maximum)})]})]})]})]}),e.jsx(te,{metric:a,open:s,onOpenChange:t})]})}function ce({groups:a}){return e.jsx("section",{className:"grid gap-5",children:a.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/38",children:s.category}),e.jsxs("div",{className:"mt-1 text-2xl font-semibold text-white",children:[s.metrics.length," signals in this lane"]})]}),e.jsxs(c,{className:g(s.category).badge,children:[s.coverageDays," days of coverage"]})]}),e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:s.metrics.map(t=>e.jsx(re,{metric:t},t.metric))})]},s.category))})}export{ce as M,oe as S,m as f,g as m};
|
|
1
|
+
import{bU as j,j as e,d1 as M,d2 as V,aI as _,d3 as S,d4 as P,d5 as L,aG as T,aX as z,r as u,cX as R,aK as $}from"./vendor-DHkYh85p.js";import{R as K,P as F,O as B,C as O,T as A,D as W,a as I}from"./ui-C13Nbgas.js";import{C as v,Z as x,c}from"./index-CF4J4R9L.js";import{R as X,e as E,C as G,X as H,Y,d as U,T as Z,B as q,a as J}from"./charts-P7EVhIog.js";function m(a){return a?new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"No date yet"}function Q(a,s){return s==="cumulative"?a.total??a.latest??a.maximum??a.average:a.latest??a.average??a.maximum??a.minimum}function d(a,s){if(s==null)return"No reading";const t=a.unit==="steps"||a.unit==="flights"||a.unit==="kcal"||a.unit==="min"||a.unit==="swears"||a.unit==="conversations"||a.unit==="messages"?0:(a.unit==="%",1);return`${s.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t===0||s>=100?0:1})} ${a.unit}`}function w(a){return a.deltaValue==null?"No baseline yet":`${a.deltaValue>0?"+":""}${d(a,a.deltaValue)}`}function ee(a){return Math.round(a*10)/10}function N(a,s){return Q(a,s)}function b(a){const s=a.days.map(t=>N(t,a.aggregation)).filter(t=>t!=null);return s.length===0?{minimum:null,average:null,maximum:null,count:0}:{minimum:Math.min(...s),average:s.reduce((t,i)=>t+i,0)/s.length,maximum:Math.max(...s),count:s.length}}function y(a){return new Date(`${a}T12:00:00`).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function ae({active:a,payload:s,label:t,metric:i}){var r;if(!a||!(s!=null&&s.length)||typeof t!="string")return null;const l=((r=s.find(n=>typeof n.value=="number"))==null?void 0:r.value)??null;return e.jsxs("div",{className:"rounded-[18px] border border-white/10 bg-[rgba(9,13,24,0.94)] px-3 py-2 shadow-[0_18px_48px_rgba(0,0,0,0.38)] backdrop-blur-xl",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/40",children:y(t)}),e.jsx("div",{className:"mt-1 text-sm font-semibold text-white",children:d(i,l)})]})}function k({metric:a,height:s=180,detailed:t=!1}){const i=u.useMemo(()=>b(a),[a]),l=u.useMemo(()=>a.days.map(o=>({dateKey:o.dateKey,value:N(o,a.aggregation),sampleCount:o.sampleCount})),[a]),r=l.map(o=>o.value).filter(o=>o!=null),n=r.length>0?Math.min(...r):0,p=r.length>0?Math.max(...r):1,f=Math.max((p-n)*.12,a.unit==="%"?2:1),C=g(a.category),h=`metric-gradient-${a.metric.replace(/[^a-z0-9]/gi,"-")}`;return r.length===0?e.jsx("div",{className:"flex items-center justify-center rounded-[22px] border border-dashed border-white/8 bg-white/[0.025] text-sm text-white/40",style:{height:s},children:"Waiting for chart data"}):e.jsx("div",{className:x("overflow-hidden rounded-[22px] border bg-[radial-gradient(circle_at_top_left,rgba(171,232,255,0.08),transparent_34%),rgba(255,255,255,0.025)] p-3",C.ring),style:{height:s},children:e.jsx(X,{width:"100%",height:"100%",children:e.jsxs(E,{data:l,margin:{top:t?18:8,right:t?18:4,bottom:t?12:0,left:t?8:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:h,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"rgba(171,232,255,0.55)"}),e.jsx("stop",{offset:"56%",stopColor:"rgba(251,191,36,0.22)"}),e.jsx("stop",{offset:"100%",stopColor:"rgba(251,191,36,0.02)"})]})}),e.jsx(G,{stroke:"rgba(255,255,255,0.07)",vertical:t}),e.jsx(H,{dataKey:"dateKey",tickFormatter:y,minTickGap:t?22:34,tick:{fill:"rgba(255,255,255,0.46)",fontSize:11},axisLine:{stroke:"rgba(255,255,255,0.1)"},tickLine:!1}),e.jsx(Y,{width:t?62:36,domain:[Math.max(0,n-f),p+f],tickFormatter:o=>d(a,Number(o)).replace(` ${a.unit}`,""),tick:{fill:"rgba(255,255,255,0.46)",fontSize:11},axisLine:!1,tickLine:!1}),i.average!=null?e.jsx(U,{y:ee(i.average),stroke:"rgba(255,255,255,0.34)",strokeDasharray:"5 5",ifOverflow:"extendDomain"}):null,e.jsx(Z,{cursor:{stroke:"rgba(255,255,255,0.22)",strokeWidth:1},content:e.jsx(ae,{metric:a})}),a.aggregation==="cumulative"?e.jsx(q,{dataKey:"value",radius:[8,8,2,2],fill:`url(#${h})`,maxBarSize:t?34:20}):e.jsx(J,{type:"monotone",dataKey:"value",stroke:"rgba(171,232,255,0.92)",strokeWidth:t?3:2,fill:`url(#${h})`,dot:t?{r:3,fill:"rgba(251,191,36,0.9)"}:!1,activeDot:{r:5,fill:"rgba(251,191,36,0.95)"}})]})})})}function te({metric:a,open:s,onOpenChange:t}){const i=b(a),l=g(a.category);return e.jsx(K,{open:s,onOpenChange:t,children:e.jsxs(F,{children:[e.jsx(B,{className:"fixed inset-0 z-50 bg-[rgba(3,7,18,0.82)] backdrop-blur-xl"}),e.jsxs(O,{className:"fixed inset-3 z-[51] grid min-h-0 overflow-hidden rounded-[32px] border border-white/10 bg-[radial-gradient(circle_at_top_left,rgba(171,232,255,0.12),transparent_34%),linear-gradient(180deg,rgba(12,18,32,0.98),rgba(7,10,20,0.99))] shadow-[0_34px_110px_rgba(0,0,0,0.58)] sm:inset-5",children:[e.jsxs(A,{className:"sr-only",children:[a.label," chart"]}),e.jsx(W,{className:"sr-only",children:"Full-screen time-series chart for the selected daily metric."}),e.jsxs("div",{className:"grid min-h-0 grid-rows-[auto_minmax(0,1fr)]",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-white/8 px-5 py-4 sm:px-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:[a.category," time series"]}),e.jsx("div",{className:"mt-1 text-2xl font-semibold text-white sm:text-3xl",children:a.label}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-xs text-white/54",children:[e.jsx(c,{className:l.badge,children:a.aggregation}),e.jsxs(c,{tone:"meta",children:[a.coverageDays," tracked days"]}),e.jsxs(c,{tone:"meta",children:["latest ",m(a.latestDateKey)]})]})]}),e.jsx(I,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex size-11 items-center justify-center rounded-full border border-white/10 bg-white/[0.06] text-white/72 transition hover:bg-white/[0.1] hover:text-white","aria-label":"Close metric chart",children:e.jsx($,{className:"size-5"})})})]}),e.jsxs("div",{className:"grid min-h-0 gap-4 overflow-y-auto p-4 sm:p-6 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[e.jsx(k,{metric:a,height:560,detailed:!0}),e.jsx("div",{className:"grid content-start gap-3",children:[["Latest",a.latestValue],["Period min",i.minimum],["Period average",i.average],["Period max",i.maximum],["Baseline",a.baselineValue],["Delta",a.deltaValue]].map(([r,n])=>e.jsxs("div",{className:"rounded-[22px] border border-white/8 bg-white/[0.035] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:r}),e.jsx("div",{className:"mt-1 text-xl font-semibold text-white",children:d(a,typeof n=="number"?n:null)})]},String(r)))})]})]})]})]})})}function se(a){return a.deltaValue==null||a.deltaValue===0?"steady":a.deltaValue>0?"up":"down"}function g(a){switch(a){case"recovery":return{ring:"border-[rgba(255,122,167,0.18)]",badge:"bg-[rgba(255,122,167,0.16)] text-[rgb(255,179,205)]",glow:"from-[rgba(255,122,167,0.2)] via-[rgba(109,76,255,0.06)] to-transparent"};case"cardio":return{ring:"border-[rgba(109,173,255,0.22)]",badge:"bg-[rgba(109,173,255,0.16)] text-[rgb(186,220,255)]",glow:"from-[rgba(109,173,255,0.22)] via-[rgba(64,108,255,0.08)] to-transparent"};case"breathing":return{ring:"border-[rgba(111,232,195,0.2)]",badge:"bg-[rgba(111,232,195,0.15)] text-[rgb(195,255,237)]",glow:"from-[rgba(111,232,195,0.2)] via-[rgba(29,154,123,0.08)] to-transparent"};case"composition":return{ring:"border-[rgba(247,211,110,0.18)]",badge:"bg-[rgba(247,211,110,0.15)] text-[rgb(255,235,176)]",glow:"from-[rgba(247,211,110,0.18)] via-[rgba(184,128,24,0.08)] to-transparent"};case"temperature":return{ring:"border-[rgba(255,153,102,0.18)]",badge:"bg-[rgba(255,153,102,0.16)] text-[rgb(255,214,190)]",glow:"from-[rgba(255,153,102,0.2)] via-[rgba(255,91,46,0.06)] to-transparent"};case"conversationTone":return{ring:"border-[rgba(251,191,36,0.2)]",badge:"bg-[rgba(251,191,36,0.16)] text-[rgb(255,232,166)]",glow:"from-[rgba(251,191,36,0.18)] via-[rgba(244,114,182,0.08)] to-transparent"};default:return{ring:"border-[rgba(163,174,208,0.16)]",badge:"bg-[rgba(163,174,208,0.14)] text-[rgb(220,228,255)]",glow:"from-[rgba(163,174,208,0.14)] via-[rgba(112,120,167,0.06)] to-transparent"}}}function D(a){switch(a){case"restingHeartRate":case"walkingHeartRateAverage":case"heartRateRecoveryOneMinute":return z;case"heartRateVariabilitySDNN":case"vo2Max":return T;case"oxygenSaturation":case"respiratoryRate":return L;case"bodyMass":case"bodyFatPercentage":case"leanBodyMass":return P;case"stepCount":case"flightsClimbed":case"appleExerciseTime":return S;case"basalEnergyBurned":return _;case"swearingMessagePercent":return V;case"devrageSwearCount":return M;default:return j}}function oe({title:a,description:s,metric:t,emptyDescription:i}){const l=t?D(t.metric):j,r=g(t?t.category:"default"),n=t?se(t):"steady";return e.jsxs(v,{className:x("relative overflow-hidden rounded-[28px] border bg-[rgba(12,18,36,0.82)] p-5 shadow-[0_18px_60px_rgba(4,8,18,0.3)]",r.ring),children:[e.jsx("div",{className:x("pointer-events-none absolute inset-0 bg-gradient-to-br opacity-90",r.glow)}),e.jsxs("div",{className:"relative grid gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/38",children:a}),e.jsx("div",{className:"text-sm leading-6 text-white/56",children:s})]}),e.jsx("div",{className:"rounded-[18px] border border-white/10 bg-white/[0.05] p-3 text-white/80",children:e.jsx(l,{className:"size-5"})})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-xl font-semibold text-white",children:t?d(t,t.latestValue):"No signal yet"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-white/56",children:[t?e.jsx(c,{className:r.badge,children:t.label}):null,t?e.jsx(c,{className:x("border-none",n==="up"?"bg-[rgba(111,232,195,0.14)] text-[rgb(190,255,231)]":n==="down"?"bg-[rgba(255,122,167,0.14)] text-[rgb(255,193,215)]":"bg-white/[0.08] text-white/72"),children:w(t)}):null,t?e.jsxs(c,{tone:"meta",children:[t.coverageDays," days tracked"]}):null]}),e.jsx("div",{className:"text-xs text-white/48",children:t?`Latest reading on ${m(t.latestDateKey)}`:i??"Forge will populate this card as soon as daily readings are available."})]})]})]})}function re({metric:a}){const[s,t]=u.useState(!1),i=D(a.metric),l=g(a.category),r=a.days.at(-1),n=b(a);return e.jsxs(v,{className:x("overflow-hidden rounded-[28px] border bg-[linear-gradient(180deg,rgba(12,18,36,0.94),rgba(8,12,24,0.98))] p-5",l.ring),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"rounded-[18px] border border-white/10 bg-white/[0.04] p-3 text-white/84",children:e.jsx(i,{className:"size-5"})}),e.jsxs("div",{className:"grid gap-1",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:a.category}),e.jsx("div",{className:"text-xl font-semibold text-white",children:a.label}),e.jsxs("div",{className:"text-sm text-white/52",children:[a.coverageDays," tracked day",a.coverageDays===1?"":"s"]})]})]}),e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:[e.jsx(c,{className:l.badge,children:a.aggregation}),e.jsxs("button",{type:"button",className:"inline-flex min-h-9 items-center gap-2 rounded-full border border-white/10 bg-white/[0.055] px-3 py-1.5 text-xs font-medium text-white/72 transition hover:bg-white/[0.09] hover:text-white",onClick:()=>t(!0),children:[e.jsx(R,{className:"size-3.5"}),"Full screen"]})]})]}),e.jsxs("div",{className:"mt-5 grid gap-4 md:grid-cols-[minmax(0,0.95fr)_minmax(220px,1.05fr)]",children:[e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Latest"}),e.jsx("div",{className:"mt-1 text-3xl font-semibold text-white",children:d(a,a.latestValue)}),e.jsx("div",{className:"mt-1 text-sm text-white/52",children:a.latestDateKey?`Latest reading on ${m(a.latestDateKey)}`:"Waiting for the first successful reading"})]}),e.jsxs("div",{className:"grid gap-2 rounded-[22px] border border-white/8 bg-white/[0.03] p-4 text-sm text-white/70",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Baseline"}),e.jsx("span",{className:"font-medium text-white",children:d(a,a.baselineValue)})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Delta"}),e.jsx("span",{className:x("font-medium",a.deltaValue==null?"text-white/58":a.deltaValue>0?"text-[rgb(190,255,231)]":a.deltaValue<0?"text-[rgb(255,198,219)]":"text-white"),children:w(a)})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{children:"Latest samples"}),e.jsx("span",{className:"font-medium text-white",children:(r==null?void 0:r.sampleCount)??0})]})]})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx(k,{metric:a}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs text-white/48",children:[e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period min"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.minimum)})]}),e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period avg"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.average)})]}),e.jsxs("div",{className:"rounded-[16px] border border-white/8 bg-white/[0.025] px-3 py-2",children:[e.jsx("div",{children:"Period max"}),e.jsx("div",{className:"mt-1 font-medium text-white/78",children:d(a,n.maximum)})]})]})]})]}),e.jsx(te,{metric:a,open:s,onOpenChange:t})]})}function ce({groups:a}){return e.jsx("section",{className:"grid gap-5",children:a.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/38",children:s.category}),e.jsxs("div",{className:"mt-1 text-2xl font-semibold text-white",children:[s.metrics.length," signals in this lane"]})]}),e.jsxs(c,{className:g(s.category).badge,children:[s.coverageDays," days of coverage"]})]}),e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:s.metrics.map(t=>e.jsx(re,{metric:t},t.metric))})]},s.category))})}export{ce as M,oe as S,m as f,g as m};
|
package/dist/assets/{entity-note-count-link-BmGDB572.js → entity-note-count-link-DrhjJZ4i.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as l,j as i,aS as x}from"./vendor-DHkYh85p.js";import{ap as f,cQ as h}from"./index-
|
|
1
|
+
import{b5 as l,j as i,aS as x}from"./vendor-DHkYh85p.js";import{ap as f,cQ as h}from"./index-CF4J4R9L.js";function g({entityType:s,entityId:a,count:r,compact:o=!1,className:p=""}){const n=l(),e=f(s,a);return e?i.jsxs("span",{role:"link",tabIndex:0,className:`inline-flex items-center rounded-full border border-white/10 bg-white/[0.05] text-white/72 transition hover:bg-white/[0.09] hover:text-white ${o?"min-h-5 gap-1 px-2 py-0.5 text-[10px]":"min-h-10 gap-2 px-3 py-2 text-xs"} ${p}`,onClick:t=>{t.stopPropagation(),n(e)},onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),t.stopPropagation(),n(e))},children:[i.jsx(x,{className:o?"size-3":"size-3.5"}),h(r)]}):null}export{g as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e,b4 as $e,b3 as We,cR as Ke,ce as Xe,c7 as Pe}from"./vendor-DHkYh85p.js";import{j as Ye,i as x,k as X}from"./state-B-4sS1xO.js";import{u as Ze,bv as Y,cP as et,cq as m,ao as tt,bm as st,bn as at,C as it,aq as nt,c as j,cQ as rt,B as y,I as w,T as ze,bu as f,i as lt,bD as ot,bw as dt,bx as ct,by as mt,bz as ut,bA as pt,bB as ht,bC as xt}from"./index-BHTUu_4M.js";import{N as Z}from"./note-markdown-DiW2-5d3.js";import{n as ee,N as Fe,f as yt,p as gt,b as vt}from"./note-tags-input-DDLXf54U.js";function bt(o,d,c){return o.links.filter(p=>!(p.entityType===d&&p.entityId===c))}function jt(o,d){return o.entityType===d.entityType&&o.entityId===d.entityId&&(o.anchorKey??null)===(d.anchorKey??null)}function te(o){const d=new Set;return o.filter(c=>{const p=`${c.entityType}:${c.entityId}:${c.anchorKey??""}`;return d.has(p)?!1:(d.add(p),!0)})}function Me(o,d,c){return gt(o)??vt(d,c)}function St({entityType:o,entityId:d,anchorKey:c,includeAnchorlessWhenAnchored:p=!1,title:Qe="Notes",description:Be="Markdown notes linked to this entity stay searchable, editable, and visible alongside the work.",invalidateQueryKeys:Ve=[],compact:se=!1}){var Se,De,_e,Te,Le,Ie,Ee,qe,Ae;const u=Ze(),L=Ye(),[I,Oe]=l.useState(""),[ae,E]=l.useState(!1),[v,q]=l.useState(""),[ie,A]=l.useState(!1),[Ue,$]=l.useState({entityType:"goal",entityId:""}),[ne,K]=l.useState([]),[re,P]=l.useState([]),[le,z]=l.useState(""),[oe,F]=l.useState(""),[de,M]=l.useState("days"),[He,Q]=l.useState(null),[b,B]=l.useState(""),[ce,N]=l.useState(!1),[V,O]=l.useState([]),[Re,U]=l.useState({entityType:"goal",entityId:""}),[me,k]=l.useState([]),[ue,C]=l.useState(""),[pe,S]=l.useState(""),[he,D]=l.useState("days"),H=Y(c),xe=et(o,c),g=x({queryKey:["notes",o,d],queryFn:()=>ot({linkedEntityType:o,linkedEntityId:d,limit:100})}),ye=x({queryKey:["forge-psyche-values"],queryFn:dt}),ge=x({queryKey:["forge-psyche-patterns"],queryFn:ct}),ve=x({queryKey:["forge-psyche-behaviors"],queryFn:mt}),be=x({queryKey:["forge-psyche-beliefs"],queryFn:ut}),je=x({queryKey:["forge-psyche-modes"],queryFn:pt}),we=x({queryKey:["forge-psyche-flashcards"],queryFn:ht}),fe=x({queryKey:["forge-psyche-reports"],queryFn:xt}),R=l.useMemo(()=>{var t,r,i,a,h,n,_,T;return{goal:u.snapshot.goals.map(s=>({id:s.id,label:m(s.title,s.user)})),project:u.snapshot.dashboard.projects.map(s=>({id:s.id,label:m(s.title,s.user)})),task:u.snapshot.tasks.map(s=>({id:s.id,label:m(s.title,s.user)})),strategy:u.snapshot.strategies.map(s=>({id:s.id,label:m(s.title,s.user)})),habit:u.snapshot.habits.map(s=>({id:s.id,label:m(s.title,s.user)})),tag:u.snapshot.tags.map(s=>({id:s.id,label:m(s.name,s.user)})),note:(((t=g.data)==null?void 0:t.notes)??[]).map(s=>({id:s.id,label:s.contentPlain||s.contentMarkdown})),insight:[],psyche_value:(((r=ye.data)==null?void 0:r.values)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),behavior_pattern:(((i=ge.data)==null?void 0:i.patterns)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),behavior:(((a=ve.data)==null?void 0:a.behaviors)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),belief_entry:(((h=be.data)==null?void 0:h.beliefs)??[]).map(s=>({id:s.id,label:m(s.statement,s.user)})),mode_profile:(((n=je.data)==null?void 0:n.modes)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),flashcard:(((_=we.data)==null?void 0:_.flashcards)??[]).map(s=>({id:s.id,label:m(s.title||s.message,s.user)})),mode_guide_session:[],event_type:[],emotion_definition:[],trigger_report:(((T=fe.data)==null?void 0:T.reports)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),calendar_event:[],work_block_template:[],task_timebox:[],preference_catalog:[],preference_catalog_item:[],preference_context:[],preference_item:[],questionnaire_instrument:[],sleep_session:[],workout_session:[]}},[(Se=ve.data)==null?void 0:Se.behaviors,(De=be.data)==null?void 0:De.beliefs,(_e=we.data)==null?void 0:_e.flashcards,(Te=je.data)==null?void 0:Te.modes,(Le=g.data)==null?void 0:Le.notes,(Ie=ge.data)==null?void 0:Ie.patterns,(Ee=fe.data)==null?void 0:Ee.reports,u.snapshot.dashboard.projects,u.snapshot.goals,u.snapshot.habits,u.snapshot.strategies,u.snapshot.tags,u.snapshot.tasks,(qe=ye.data)==null?void 0:qe.values]),G=async()=>{await Promise.all([L.invalidateQueries({queryKey:["notes",o,d]}),lt(L),...Ve.map(t=>L.invalidateQueries({queryKey:t}))])},Ne=X({mutationFn:async t=>tt({contentMarkdown:t,tags:ee(re),destroyAt:Me(le,oe,de),links:te([{entityType:o,entityId:d,anchorKey:c??null},...ne])}),onSuccess:async()=>{q(""),A(!1),K([]),$({entityType:"goal",entityId:""}),P([]),z(""),F(""),M("days"),await G()}}),ke=X({mutationFn:async({noteId:t,contentMarkdown:r,links:i,tags:a,destroyAt:h})=>st(t,{contentMarkdown:r,links:i,tags:a,destroyAt:h}),onSuccess:async()=>{Q(null),B(""),N(!1),O([]),U({entityType:"goal",entityId:""}),k([]),C(""),S(""),D("days"),await G()}}),Ge=X({mutationFn:async t=>at(t),onSuccess:G}),J=l.useMemo(()=>{var r;return(((r=g.data)==null?void 0:r.notes)??[]).filter(i=>c===void 0?!0:i.links.some(a=>a.entityType===o&&a.entityId===d&&((a.anchorKey??null)===c||p&&(a.anchorKey??null)===null))).filter(i=>{const a=I.trim().toLowerCase();return a?`${i.contentPlain} ${i.author??""} ${(i.tags??[]).join(" ")}`.toLowerCase().includes(a):!0})},[c,d,o,p,(Ae=g.data)==null?void 0:Ae.notes,I]),Je=(t,r,i)=>{const a=t.entityId.trim();return a?(r(te([...i,{entityType:t.entityType,entityId:a,anchorKey:null}])),!0):!1},W=t=>{var i,a;const r=(i=R[t.entityType])==null?void 0:i.find(h=>h.id===t.entityId);return(a=r==null?void 0:r.label)!=null&&a.trim()?r.label.trim():`Deleted ${f(t.entityType)}`},Ce=(t,r,i,a,h)=>e.jsxs("div",{className:"rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Linked entities"}),e.jsxs(j,{className:"bg-white/[0.08] text-white/68",children:[t.length," linked"]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.map(n=>{const _=t.length>1;return e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.08] px-3 py-2 text-sm text-white/72",children:[e.jsxs("span",{children:[f(n.entityType)," · ",W(n)]}),n.anchorKey?e.jsx("span",{className:"rounded-full bg-white/[0.08] px-2 py-0.5 text-[11px] text-white/54",children:Y(n.anchorKey)}):null,e.jsx("button",{type:"button",disabled:!_,className:"text-white/44 transition hover:text-white disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>r(t.filter(T=>!jt(T,n))),"aria-label":`Remove ${f(n.entityType)} link to ${W(n)}`,children:e.jsx(Pe,{className:"size-3.5"})})]},`${h}-${n.entityType}-${n.entityId}-${n.anchorKey??""}`)})}),e.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-[minmax(0,11rem)_minmax(0,1fr)_auto]",children:[e.jsx("select",{className:"rounded-[14px] bg-white/[0.06] px-3 py-3 text-white",value:i.entityType,onChange:n=>a({...i,entityType:n.target.value,entityId:""}),children:["goal","project","task","strategy","habit","tag","note","psyche_value","behavior_pattern","behavior","belief_entry","mode_profile","mode_guide_session","flashcard","event_type","emotion_definition","trigger_report"].map(n=>e.jsx("option",{value:n,children:f(n)},n))}),e.jsxs("select",{className:"min-w-0 rounded-[14px] bg-white/[0.06] px-3 py-3 text-white",value:i.entityId,onChange:n=>a({...i,entityId:n.target.value}),children:[e.jsx("option",{value:"",children:(R[i.entityType]??[]).length>0?"Choose linked item":"No linked items available"}),(R[i.entityType]??[]).map(n=>e.jsx("option",{value:n.id,children:n.label},n.id))]}),e.jsx(y,{variant:"secondary",disabled:!i.entityId,onClick:()=>{Je(i,r,t)&&a({...i,entityId:""})},children:"Add link"})]})]});return e.jsx(it,{id:"notes",className:se?"min-w-0 overflow-hidden p-0":"min-w-0 overflow-hidden",children:e.jsxs("div",{className:se?"p-4":void 0,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:Qe}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/60",children:Be}),H?e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 rounded-full bg-white/[0.05] px-3 py-2 text-xs text-white/64",children:[e.jsxs("span",{children:["Pinned to ",H]}),xe?e.jsx(nt,{content:xe,label:`Explain ${H}`}):null]}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(j,{className:"bg-white/[0.08] text-white/72",children:rt(J.length)}),ae?null:e.jsxs(y,{type:"button",size:"sm",onClick:()=>E(!0),children:[e.jsx($e,{className:"size-4"}),"Add note"]})]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-[22px] border border-white/8 bg-white/[0.04] px-3 py-3",children:[e.jsx(We,{className:"size-4 text-white/34"}),e.jsx(w,{value:I,onChange:t=>Oe(t.target.value),placeholder:"Search notes by content, author, or note tag",className:"border-0 bg-transparent px-0 py-0"})]}),ae?e.jsxs("div",{className:"mt-4 rounded-[24px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white/70",children:[e.jsx($e,{className:"size-4 text-[var(--secondary)]"}),"Add note"]}),e.jsxs(y,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>A(t=>!t),children:[e.jsx(Ke,{className:"size-4"}),ie?"Back to editor":"Preview"]})]}),e.jsx("div",{className:"mt-3",children:ie?e.jsxs("div",{className:"rounded-[20px] bg-[rgba(9,14,25,0.78)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Preview"}),e.jsx("div",{className:"mt-3",children:v.trim()?e.jsx(Z,{markdown:v}):e.jsx("div",{className:"text-sm leading-6 text-white/42",children:"Markdown preview appears here once you have note content."})})]}):e.jsx(ze,{value:v,onChange:t=>q(t.target.value),placeholder:"Write in Markdown. Summaries, blockers, what changed, and why all work well here.",className:"min-h-[12rem]"})}),e.jsx("div",{className:"mt-3",children:Ce(te([{entityType:o,entityId:d,anchorKey:c??null},...ne]),t=>K(t.filter(r=>!(r.entityType===o&&r.entityId===d&&(r.anchorKey??null)===(c??null)))),Ue,$,"composer-note-links")}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(Fe,{value:re,onChange:P}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-white/46",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(w,{type:"datetime-local",value:le,onChange:t=>z(t.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(w,{type:"number",min:"1",value:oe,onChange:t=>F(t.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-white/10 bg-white/[0.04] px-3 py-3 text-sm text-white",value:de,onChange:t=>M(t.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(y,{type:"button",variant:"secondary",onClick:()=>{E(!1),A(!1),q(""),K([]),$({entityType:"goal",entityId:""}),P([]),z(""),F(""),M("days")},children:"Cancel"}),e.jsx(y,{pending:Ne.isPending,pendingLabel:"Saving",disabled:v.trim().length===0,onClick:async()=>{await Ne.mutateAsync(v.trim()),E(!1)},children:"Save note"})]})]}):null,e.jsxs("div",{className:"mt-4 grid gap-3",children:[g.isLoading?e.jsx("div",{className:"rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/56",children:"Loading notes…"}):null,!g.isLoading&&J.length===0?e.jsx("div",{className:"rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/56",children:"No notes are linked here yet."}):null,J.map(t=>{const r=He===t.id,i=bt(t,o,d);return e.jsxs("article",{className:"rounded-[24px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-xs uppercase tracking-[0.16em] text-white/38",children:[(t.author??"Unknown author").toString()," •"," ",new Date(t.updatedAt).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[i.map(a=>e.jsxs(j,{className:"bg-white/[0.08] text-white/68",wrap:!0,children:[f(a.entityType)," ·"," ",W(a),a.anchorKey?` · ${Y(a.anchorKey)}`:""]},`${t.id}-${a.entityType}-${a.entityId}-${a.anchorKey??""}`)),(t.tags??[]).map(a=>e.jsx(j,{className:"bg-cyan-400/10 text-cyan-50",wrap:!0,children:a},`${t.id}-tag-${a}`)),t.destroyAt?e.jsxs(j,{className:"bg-amber-400/10 text-amber-100",wrap:!0,children:["Ephemeral · deletes"," ",new Date(t.destroyAt).toLocaleString()]}):null]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-white/[0.06] text-white/60 transition hover:bg-white/[0.1] hover:text-white",onClick:()=>{Q(t.id),B(t.contentMarkdown),N(!1),O(t.links),U({entityType:"goal",entityId:""}),k(ee(t.tags??[])),C(yt(t.destroyAt??null)),S(""),D("days")},children:e.jsx(Xe,{className:"size-4"})}),e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-rose-500/10 text-rose-200 transition hover:bg-rose-500/16",onClick:()=>{Ge.mutateAsync(t.id)},children:e.jsx(Pe,{className:"size-4"})})]})]}),r?e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsxs(y,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>N(a=>!a),children:[e.jsx(Ke,{className:"size-4"}),ce?"Back to editor":"Preview"]})}),e.jsx("div",{className:"mt-3",children:ce?e.jsxs("div",{className:"rounded-[20px] bg-[rgba(9,14,25,0.78)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Preview"}),e.jsx("div",{className:"mt-3",children:b.trim()?e.jsx(Z,{markdown:b}):e.jsx("div",{className:"text-sm text-white/42",children:"No content yet."})})]}):e.jsx(ze,{value:b,onChange:a=>B(a.target.value),className:"min-h-[12rem]"})}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(Fe,{value:me,onChange:k}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-white/46",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(w,{type:"datetime-local",value:ue,onChange:a=>C(a.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(w,{type:"number",min:"1",value:pe,onChange:a=>S(a.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-white/10 bg-white/[0.04] px-3 py-3 text-sm text-white",value:he,onChange:a=>D(a.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsx("div",{className:"mt-3",children:Ce(V,O,Re,U,`edit-note-links-${t.id}`)}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(y,{variant:"secondary",onClick:()=>{Q(null),N(!1),k([]),C(""),S(""),D("days")},children:"Cancel"}),e.jsx(y,{pending:ke.isPending,pendingLabel:"Saving",disabled:b.trim().length===0||V.length===0,onClick:async()=>{await ke.mutateAsync({noteId:t.id,contentMarkdown:b.trim(),links:V,tags:ee(me),destroyAt:Me(ue,pe,he)})},children:"Save changes"})]})]}):e.jsx("div",{className:"mt-4",children:e.jsx(Z,{markdown:t.contentMarkdown})})]},t.id)})]})]})})}export{St as E};
|
|
1
|
+
import{r as l,j as e,b4 as $e,b3 as We,cR as Ke,ce as Xe,c7 as Pe}from"./vendor-DHkYh85p.js";import{j as Ye,i as x,k as X}from"./state-B-4sS1xO.js";import{u as Ze,bv as Y,cP as et,cq as m,ao as tt,bm as st,bn as at,C as it,aq as nt,c as j,cQ as rt,B as y,I as w,T as ze,bu as f,i as lt,bD as ot,bw as dt,bx as ct,by as mt,bz as ut,bA as pt,bB as ht,bC as xt}from"./index-CF4J4R9L.js";import{N as Z}from"./note-markdown-N-uxD3Xt.js";import{n as ee,N as Fe,f as yt,p as gt,b as vt}from"./note-tags-input-Cdu7wiw6.js";function bt(o,d,c){return o.links.filter(p=>!(p.entityType===d&&p.entityId===c))}function jt(o,d){return o.entityType===d.entityType&&o.entityId===d.entityId&&(o.anchorKey??null)===(d.anchorKey??null)}function te(o){const d=new Set;return o.filter(c=>{const p=`${c.entityType}:${c.entityId}:${c.anchorKey??""}`;return d.has(p)?!1:(d.add(p),!0)})}function Me(o,d,c){return gt(o)??vt(d,c)}function St({entityType:o,entityId:d,anchorKey:c,includeAnchorlessWhenAnchored:p=!1,title:Qe="Notes",description:Be="Markdown notes linked to this entity stay searchable, editable, and visible alongside the work.",invalidateQueryKeys:Ve=[],compact:se=!1}){var Se,De,_e,Te,Le,Ie,Ee,qe,Ae;const u=Ze(),L=Ye(),[I,Oe]=l.useState(""),[ae,E]=l.useState(!1),[v,q]=l.useState(""),[ie,A]=l.useState(!1),[Ue,$]=l.useState({entityType:"goal",entityId:""}),[ne,K]=l.useState([]),[re,P]=l.useState([]),[le,z]=l.useState(""),[oe,F]=l.useState(""),[de,M]=l.useState("days"),[He,Q]=l.useState(null),[b,B]=l.useState(""),[ce,N]=l.useState(!1),[V,O]=l.useState([]),[Re,U]=l.useState({entityType:"goal",entityId:""}),[me,k]=l.useState([]),[ue,C]=l.useState(""),[pe,S]=l.useState(""),[he,D]=l.useState("days"),H=Y(c),xe=et(o,c),g=x({queryKey:["notes",o,d],queryFn:()=>ot({linkedEntityType:o,linkedEntityId:d,limit:100})}),ye=x({queryKey:["forge-psyche-values"],queryFn:dt}),ge=x({queryKey:["forge-psyche-patterns"],queryFn:ct}),ve=x({queryKey:["forge-psyche-behaviors"],queryFn:mt}),be=x({queryKey:["forge-psyche-beliefs"],queryFn:ut}),je=x({queryKey:["forge-psyche-modes"],queryFn:pt}),we=x({queryKey:["forge-psyche-flashcards"],queryFn:ht}),fe=x({queryKey:["forge-psyche-reports"],queryFn:xt}),R=l.useMemo(()=>{var t,r,i,a,h,n,_,T;return{goal:u.snapshot.goals.map(s=>({id:s.id,label:m(s.title,s.user)})),project:u.snapshot.dashboard.projects.map(s=>({id:s.id,label:m(s.title,s.user)})),task:u.snapshot.tasks.map(s=>({id:s.id,label:m(s.title,s.user)})),strategy:u.snapshot.strategies.map(s=>({id:s.id,label:m(s.title,s.user)})),habit:u.snapshot.habits.map(s=>({id:s.id,label:m(s.title,s.user)})),tag:u.snapshot.tags.map(s=>({id:s.id,label:m(s.name,s.user)})),note:(((t=g.data)==null?void 0:t.notes)??[]).map(s=>({id:s.id,label:s.contentPlain||s.contentMarkdown})),insight:[],psyche_value:(((r=ye.data)==null?void 0:r.values)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),behavior_pattern:(((i=ge.data)==null?void 0:i.patterns)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),behavior:(((a=ve.data)==null?void 0:a.behaviors)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),belief_entry:(((h=be.data)==null?void 0:h.beliefs)??[]).map(s=>({id:s.id,label:m(s.statement,s.user)})),mode_profile:(((n=je.data)==null?void 0:n.modes)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),flashcard:(((_=we.data)==null?void 0:_.flashcards)??[]).map(s=>({id:s.id,label:m(s.title||s.message,s.user)})),mode_guide_session:[],event_type:[],emotion_definition:[],trigger_report:(((T=fe.data)==null?void 0:T.reports)??[]).map(s=>({id:s.id,label:m(s.title,s.user)})),calendar_event:[],work_block_template:[],task_timebox:[],preference_catalog:[],preference_catalog_item:[],preference_context:[],preference_item:[],questionnaire_instrument:[],sleep_session:[],workout_session:[]}},[(Se=ve.data)==null?void 0:Se.behaviors,(De=be.data)==null?void 0:De.beliefs,(_e=we.data)==null?void 0:_e.flashcards,(Te=je.data)==null?void 0:Te.modes,(Le=g.data)==null?void 0:Le.notes,(Ie=ge.data)==null?void 0:Ie.patterns,(Ee=fe.data)==null?void 0:Ee.reports,u.snapshot.dashboard.projects,u.snapshot.goals,u.snapshot.habits,u.snapshot.strategies,u.snapshot.tags,u.snapshot.tasks,(qe=ye.data)==null?void 0:qe.values]),G=async()=>{await Promise.all([L.invalidateQueries({queryKey:["notes",o,d]}),lt(L),...Ve.map(t=>L.invalidateQueries({queryKey:t}))])},Ne=X({mutationFn:async t=>tt({contentMarkdown:t,tags:ee(re),destroyAt:Me(le,oe,de),links:te([{entityType:o,entityId:d,anchorKey:c??null},...ne])}),onSuccess:async()=>{q(""),A(!1),K([]),$({entityType:"goal",entityId:""}),P([]),z(""),F(""),M("days"),await G()}}),ke=X({mutationFn:async({noteId:t,contentMarkdown:r,links:i,tags:a,destroyAt:h})=>st(t,{contentMarkdown:r,links:i,tags:a,destroyAt:h}),onSuccess:async()=>{Q(null),B(""),N(!1),O([]),U({entityType:"goal",entityId:""}),k([]),C(""),S(""),D("days"),await G()}}),Ge=X({mutationFn:async t=>at(t),onSuccess:G}),J=l.useMemo(()=>{var r;return(((r=g.data)==null?void 0:r.notes)??[]).filter(i=>c===void 0?!0:i.links.some(a=>a.entityType===o&&a.entityId===d&&((a.anchorKey??null)===c||p&&(a.anchorKey??null)===null))).filter(i=>{const a=I.trim().toLowerCase();return a?`${i.contentPlain} ${i.author??""} ${(i.tags??[]).join(" ")}`.toLowerCase().includes(a):!0})},[c,d,o,p,(Ae=g.data)==null?void 0:Ae.notes,I]),Je=(t,r,i)=>{const a=t.entityId.trim();return a?(r(te([...i,{entityType:t.entityType,entityId:a,anchorKey:null}])),!0):!1},W=t=>{var i,a;const r=(i=R[t.entityType])==null?void 0:i.find(h=>h.id===t.entityId);return(a=r==null?void 0:r.label)!=null&&a.trim()?r.label.trim():`Deleted ${f(t.entityType)}`},Ce=(t,r,i,a,h)=>e.jsxs("div",{className:"rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Linked entities"}),e.jsxs(j,{className:"bg-white/[0.08] text-white/68",children:[t.length," linked"]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:t.map(n=>{const _=t.length>1;return e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/[0.08] px-3 py-2 text-sm text-white/72",children:[e.jsxs("span",{children:[f(n.entityType)," · ",W(n)]}),n.anchorKey?e.jsx("span",{className:"rounded-full bg-white/[0.08] px-2 py-0.5 text-[11px] text-white/54",children:Y(n.anchorKey)}):null,e.jsx("button",{type:"button",disabled:!_,className:"text-white/44 transition hover:text-white disabled:cursor-not-allowed disabled:opacity-30",onClick:()=>r(t.filter(T=>!jt(T,n))),"aria-label":`Remove ${f(n.entityType)} link to ${W(n)}`,children:e.jsx(Pe,{className:"size-3.5"})})]},`${h}-${n.entityType}-${n.entityId}-${n.anchorKey??""}`)})}),e.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-[minmax(0,11rem)_minmax(0,1fr)_auto]",children:[e.jsx("select",{className:"rounded-[14px] bg-white/[0.06] px-3 py-3 text-white",value:i.entityType,onChange:n=>a({...i,entityType:n.target.value,entityId:""}),children:["goal","project","task","strategy","habit","tag","note","psyche_value","behavior_pattern","behavior","belief_entry","mode_profile","mode_guide_session","flashcard","event_type","emotion_definition","trigger_report"].map(n=>e.jsx("option",{value:n,children:f(n)},n))}),e.jsxs("select",{className:"min-w-0 rounded-[14px] bg-white/[0.06] px-3 py-3 text-white",value:i.entityId,onChange:n=>a({...i,entityId:n.target.value}),children:[e.jsx("option",{value:"",children:(R[i.entityType]??[]).length>0?"Choose linked item":"No linked items available"}),(R[i.entityType]??[]).map(n=>e.jsx("option",{value:n.id,children:n.label},n.id))]}),e.jsx(y,{variant:"secondary",disabled:!i.entityId,onClick:()=>{Je(i,r,t)&&a({...i,entityId:""})},children:"Add link"})]})]});return e.jsx(it,{id:"notes",className:se?"min-w-0 overflow-hidden p-0":"min-w-0 overflow-hidden",children:e.jsxs("div",{className:se?"p-4":void 0,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:Qe}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/60",children:Be}),H?e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 rounded-full bg-white/[0.05] px-3 py-2 text-xs text-white/64",children:[e.jsxs("span",{children:["Pinned to ",H]}),xe?e.jsx(nt,{content:xe,label:`Explain ${H}`}):null]}):null]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(j,{className:"bg-white/[0.08] text-white/72",children:rt(J.length)}),ae?null:e.jsxs(y,{type:"button",size:"sm",onClick:()=>E(!0),children:[e.jsx($e,{className:"size-4"}),"Add note"]})]})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-[22px] border border-white/8 bg-white/[0.04] px-3 py-3",children:[e.jsx(We,{className:"size-4 text-white/34"}),e.jsx(w,{value:I,onChange:t=>Oe(t.target.value),placeholder:"Search notes by content, author, or note tag",className:"border-0 bg-transparent px-0 py-0"})]}),ae?e.jsxs("div",{className:"mt-4 rounded-[24px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white/70",children:[e.jsx($e,{className:"size-4 text-[var(--secondary)]"}),"Add note"]}),e.jsxs(y,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>A(t=>!t),children:[e.jsx(Ke,{className:"size-4"}),ie?"Back to editor":"Preview"]})]}),e.jsx("div",{className:"mt-3",children:ie?e.jsxs("div",{className:"rounded-[20px] bg-[rgba(9,14,25,0.78)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Preview"}),e.jsx("div",{className:"mt-3",children:v.trim()?e.jsx(Z,{markdown:v}):e.jsx("div",{className:"text-sm leading-6 text-white/42",children:"Markdown preview appears here once you have note content."})})]}):e.jsx(ze,{value:v,onChange:t=>q(t.target.value),placeholder:"Write in Markdown. Summaries, blockers, what changed, and why all work well here.",className:"min-h-[12rem]"})}),e.jsx("div",{className:"mt-3",children:Ce(te([{entityType:o,entityId:d,anchorKey:c??null},...ne]),t=>K(t.filter(r=>!(r.entityType===o&&r.entityId===d&&(r.anchorKey??null)===(c??null)))),Ue,$,"composer-note-links")}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(Fe,{value:re,onChange:P}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-white/46",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(w,{type:"datetime-local",value:le,onChange:t=>z(t.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(w,{type:"number",min:"1",value:oe,onChange:t=>F(t.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-white/10 bg-white/[0.04] px-3 py-3 text-sm text-white",value:de,onChange:t=>M(t.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(y,{type:"button",variant:"secondary",onClick:()=>{E(!1),A(!1),q(""),K([]),$({entityType:"goal",entityId:""}),P([]),z(""),F(""),M("days")},children:"Cancel"}),e.jsx(y,{pending:Ne.isPending,pendingLabel:"Saving",disabled:v.trim().length===0,onClick:async()=>{await Ne.mutateAsync(v.trim()),E(!1)},children:"Save note"})]})]}):null,e.jsxs("div",{className:"mt-4 grid gap-3",children:[g.isLoading?e.jsx("div",{className:"rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/56",children:"Loading notes…"}):null,!g.isLoading&&J.length===0?e.jsx("div",{className:"rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/56",children:"No notes are linked here yet."}):null,J.map(t=>{const r=He===t.id,i=bt(t,o,d);return e.jsxs("article",{className:"rounded-[24px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-xs uppercase tracking-[0.16em] text-white/38",children:[(t.author??"Unknown author").toString()," •"," ",new Date(t.updatedAt).toLocaleString()]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[i.map(a=>e.jsxs(j,{className:"bg-white/[0.08] text-white/68",wrap:!0,children:[f(a.entityType)," ·"," ",W(a),a.anchorKey?` · ${Y(a.anchorKey)}`:""]},`${t.id}-${a.entityType}-${a.entityId}-${a.anchorKey??""}`)),(t.tags??[]).map(a=>e.jsx(j,{className:"bg-cyan-400/10 text-cyan-50",wrap:!0,children:a},`${t.id}-tag-${a}`)),t.destroyAt?e.jsxs(j,{className:"bg-amber-400/10 text-amber-100",wrap:!0,children:["Ephemeral · deletes"," ",new Date(t.destroyAt).toLocaleString()]}):null]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-white/[0.06] text-white/60 transition hover:bg-white/[0.1] hover:text-white",onClick:()=>{Q(t.id),B(t.contentMarkdown),N(!1),O(t.links),U({entityType:"goal",entityId:""}),k(ee(t.tags??[])),C(yt(t.destroyAt??null)),S(""),D("days")},children:e.jsx(Xe,{className:"size-4"})}),e.jsx("button",{type:"button",className:"inline-flex size-9 items-center justify-center rounded-full bg-rose-500/10 text-rose-200 transition hover:bg-rose-500/16",onClick:()=>{Ge.mutateAsync(t.id)},children:e.jsx(Pe,{className:"size-4"})})]})]}),r?e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsxs(y,{type:"button",variant:"secondary",size:"sm",className:"gap-2",onClick:()=>N(a=>!a),children:[e.jsx(Ke,{className:"size-4"}),ce?"Back to editor":"Preview"]})}),e.jsx("div",{className:"mt-3",children:ce?e.jsxs("div",{className:"rounded-[20px] bg-[rgba(9,14,25,0.78)] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Preview"}),e.jsx("div",{className:"mt-3",children:b.trim()?e.jsx(Z,{markdown:b}):e.jsx("div",{className:"text-sm text-white/42",children:"No content yet."})})]}):e.jsx(ze,{value:b,onChange:a=>B(a.target.value),className:"min-h-[12rem]"})}),e.jsxs("div",{className:"mt-3 grid gap-3 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsx(Fe,{value:me,onChange:k}),e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Ephemeral auto-destroy"}),e.jsx("div",{className:"mt-2 text-xs leading-5 text-white/46",children:"Set an exact destroy time or a relative delay. Leaving both blank keeps the note durable."})]}),e.jsx(w,{type:"datetime-local",value:ue,onChange:a=>C(a.target.value)}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_10rem]",children:[e.jsx(w,{type:"number",min:"1",value:pe,onChange:a=>S(a.target.value),placeholder:"Destroy after"}),e.jsxs("select",{className:"rounded-[14px] border border-white/10 bg-white/[0.04] px-3 py-3 text-sm text-white",value:he,onChange:a=>D(a.target.value),children:[e.jsx("option",{value:"hours",children:"Hours"}),e.jsx("option",{value:"days",children:"Days"})]})]})]})]}),e.jsx("div",{className:"mt-3",children:Ce(V,O,Re,U,`edit-note-links-${t.id}`)}),e.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2",children:[e.jsx(y,{variant:"secondary",onClick:()=>{Q(null),N(!1),k([]),C(""),S(""),D("days")},children:"Cancel"}),e.jsx(y,{pending:ke.isPending,pendingLabel:"Saving",disabled:b.trim().length===0||V.length===0,onClick:async()=>{await ke.mutateAsync({noteId:t.id,contentMarkdown:b.trim(),links:V,tags:ee(me),destroyAt:Me(ue,pe,he)})},children:"Save changes"})]})]}):e.jsx("div",{className:"mt-4",children:e.jsx(Z,{markdown:t.contentMarkdown})})]},t.id)})]})]})})}export{St as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as N,bg as Ke,ce as Qe,cb as Xe,cv as be,j as t,c7 as ve,b2 as pt,ca as Ze,cw as Fe,cx as Ye,bC as ht,bB as ft,c9 as gt,aO as bt,aP as we,bo as Ue,cy as wt}from"./vendor-DHkYh85p.js";import{u as jt,a as vt,D as yt,S as Pe,v as Ve,e as Nt,p as kt,f as St,P as _t,g as Te,b as et,C as tt}from"./board-BkDRaMp6.js";import{P as ye,C as it,B as qe,Z as W,_ as It,aR as at,b as le,c as S,V as nt,U as je}from"./index-BHTUu_4M.js";import{E as Ct}from"./entity-note-count-link-BmGDB572.js";import{F as zt}from"./floating-action-menu-CJkI2iFy.js";function Dt(e){if(typeof e=="number"&&Number.isInteger(e)&&e>0)return e;if(typeof e=="string"){const a=e.match(/(\d+)/);if(a){const l=Number.parseInt(a[1]??"",10);return Number.isInteger(l)&&l>0?l:null}}return null}function Ge(e){return e.split(/\r?\n/).map(a=>a.trim()).reduce((a,l)=>{const o=l.match(/^[-*+]\s+\[([ xX])\]\s+(.+)$/);if(o)return a.push({label:o[2].trim(),completed:o[1].toLowerCase()==="x"}),a;const c=l.match(/^(?:[-*+]|\d+\.)\s+(.+)$/);return c&&a.push({label:c[1].trim(),completed:null}),a},[]).filter(a=>a.label.length>0)}function $t(e){if(e.acceptanceCriteria.length>0)return{total:e.acceptanceCriteria.length,completed:e.status==="done"?e.acceptanceCriteria.length:0,source:"acceptance_criteria",items:e.acceptanceCriteria};const a=Ge(e.aiInstructions);if(a.length>0){const o=e.status==="done"?a.length:a.filter(c=>c.completed===!0).length;return{total:a.length,completed:o,source:"ai_instructions",items:a.map(c=>c.label)}}const l=Ge(e.description);if(l.length>0){const o=e.status==="done"?l.length:l.filter(c=>c.completed===!0).length;return{total:l.length,completed:o,source:"description",items:l.map(c=>c.label)}}return null}function He(e,a){return e.find(l=>l.refType===a)??null}function st(e,a=null){var x,h,j,D,k,I,$,U,B,M,E;const l=new Set(((x=e.completionReport)==null?void 0:x.linkedGitRefIds)??[]),o=He(e.gitRefs,"branch"),c=He(e.gitRefs,"pull_request"),u=(a==null?void 0:a.gitContext)??null,m=(u==null?void 0:u.pullRequestNumber)??Dt((c==null?void 0:c.refValue)??(c==null?void 0:c.displayTitle)??null);return{actor:(a==null?void 0:a.actor)??null,activeRun:a,stepSummary:$t(e),changedFileCount:((h=e.completionReport)==null?void 0:h.modifiedFiles.length)??0,changedFilesPreview:(((j=e.completionReport)==null?void 0:j.modifiedFiles)??[]).slice(0,2),git:{provider:((D=u==null?void 0:u.provider)==null?void 0:D.trim())||((k=o==null?void 0:o.provider)==null?void 0:k.trim())||((I=c==null?void 0:c.provider)==null?void 0:I.trim())||null,repository:(($=u==null?void 0:u.repository)==null?void 0:$.trim())||((U=o==null?void 0:o.repository)==null?void 0:U.trim())||((B=c==null?void 0:c.repository)==null?void 0:B.trim())||null,branch:((M=u==null?void 0:u.branch)==null?void 0:M.trim())||((E=o==null?void 0:o.refValue)==null?void 0:E.trim())||null,branchUrl:(u==null?void 0:u.branchUrl)??(o==null?void 0:o.url)??null,pullRequestNumber:m,pullRequestUrl:(u==null?void 0:u.pullRequestUrl)??(c==null?void 0:c.url)??null,compareUrl:(u==null?void 0:u.compareUrl)??null,linkedRefCount:l.size}}}const _=["backlog","focus","in_progress","blocked","done"];function Bt({task:e,onOpenTask:a,onEditTask:l,onLinkTask:o,onCreateTaskForIssue:c,onCreateSubtaskForTask:u,onMove:m,onDeleteTask:x,deletePendingTaskId:h,onRequestDelete:j}){const D=e.level==="issue"?{id:"create-task",label:"Create task",description:"Add a focused execution task under this issue.",icon:be,onSelect:()=>c==null?void 0:c(e.id)}:e.level==="task"?{id:"create-subtask",label:"Create subtask",description:"Add a granular child step under this task.",icon:be,onSelect:()=>u==null?void 0:u(e.id)}:null;return[{id:"open-task",label:"Open",description:"Jump to the work-item detail view.",icon:Ke,onSelect:()=>a==null?void 0:a(e.id)},{id:"edit-task",label:"Edit",description:"Open the guided work-item editor.",icon:Qe,onSelect:()=>l==null?void 0:l(e.id)},{id:"link-task",label:"Link",description:"Open the placement step to relink this work item.",icon:Xe,onSelect:()=>o==null?void 0:o(e.id)},...D?[D]:[],{id:"delete-task",label:e.level==="issue"?"Delete issue":e.level==="subtask"?"Delete subtask":"Delete task",description:"Remove this work item directly from the board menu.",icon:ve,tone:"danger",disabled:!x||h===e.id,onSelect:()=>j(e)},..._.filter(k=>k!==e.status).map(k=>({id:`move-task-${k}`,label:`Move to ${k.replaceAll("_"," ")}`,description:"Update the workflow lane for this work item.",onSelect:()=>void m(e.id,k)}))]}function rt(e){return e.startsWith("lane:")||e.includes(":lane:")}function Mt(e){var a,l;return((l=(a=e.data)==null?void 0:a.current)==null?void 0:l.type)==="lane"||rt(String(e.id))}function At(e){var a,l;return((l=(a=e.data)==null?void 0:a.current)==null?void 0:l.type)==="trash"}function Lt(e,a){const l=Math.max(0,Math.min(e.right,a.right)-Math.max(e.left,a.left)),o=Math.max(0,Math.min(e.bottom,a.bottom)-Math.max(e.top,a.top));return l*o}const Rt=e=>{const a=kt(e),l=a.find(m=>{const x=e.droppableContainers.find(h=>h.id===m.id);return x?At(x):!1});if(l)return[l];const o=a.find(m=>rt(String(m.id)));if(o)return[o];const u=e.droppableContainers.filter(m=>Mt(m)).map(m=>{const x=e.droppableRects.get(m.id);if(!x)return null;const h=Lt(e.collisionRect,x);return h<=0?null:{id:m.id,data:{droppableContainer:m,value:h}}}).filter(Boolean).sort((m,x)=>{var h,j;return(((h=x==null?void 0:x.data)==null?void 0:h.value)??0)-(((j=m==null?void 0:m.data)==null?void 0:j.value)??0)});return u.length>0?u:a.length>0?a:St(e)};function Et(e,a){return a&&a.trim().length>0?a:e!=null&&e.actor?`${e.actor} session`:"Active work"}function Ot(e,a){return[(e==null?void 0:e.actor)??null,a].filter(Boolean).join(" · ")}function We(e){e.preventDefault(),e.stopPropagation()}function lt({task:e,goal:a,tags:l,activeRun:o,isSelected:c,isDragging:u=!1,isOverlay:m=!1,style:x,setNodeRef:h,dragAttributes:j,dragListeners:D,isMobile:k=!1,onSelect:I,onStartTask:$,onStopTask:U,onQuickReopen:B,onStepTask:M,onSplitTask:E,onOpenMenu:G,notesSummaryByEntity:C}){var X;const{t:ee,formatDate:ne}=ye(),v=st(e,o??null),z=v.stepSummary,b=_[_.indexOf(e.status)-1]??null,A=_[_.indexOf(e.status)+1]??null,oe=It(C,"task",e.id).count,L=e.level==="issue"?"issue":"task",ce=at(L),te=e.level==="subtask"?"136,146,255":ce.colorToken.rgb.join(", "),P=e.dueDate&&!Number.isNaN(Date.parse(e.dueDate))?ne(e.dueDate):"No due date",J=z&&z.total>0?Math.max(8,Math.round(z.completed/z.total*100)):null,g=v.git.branch,K=v.git.branchUrl,V=v.git.pullRequestNumber?`PR #${v.git.pullRequestNumber}`:null,Q=v.git.pullRequestUrl;return t.jsxs("article",{ref:h,style:{...x,"--board-card-accent":te},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",k&&"touch-none select-none",m&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[0_28px_80px_rgba(8,12,24,0.42),inset_0_0_0_1px_rgba(var(--board-card-accent),0.28)]",u&&!m&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",c?"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.18),rgba(var(--board-card-accent),0.06))] shadow-[0_16px_40px_rgba(8,12,24,0.32),inset_0_0_0_1px_rgba(var(--board-card-accent),0.26)]":"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),rgba(255,255,255,0.03))]"),"data-dragging":u?"true":"false","data-testid":`task-card-${e.id}`,onClick:()=>I(e.id),...j,...D,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${te}, 0.96), rgba(${te}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:L,label:e.level,compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 text-[10px] text-[var(--tertiary)]",children:e.priority}),v.actor?t.jsxs(S,{size:"xs",className:"shrink-0 bg-cyan-400/12 text-cyan-100",children:[t.jsx(pt,{className:"mr-1 size-3"}),v.actor]}):null]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[G?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white",onClick:f=>{f.preventDefault(),f.stopPropagation(),G(f,e)},children:t.jsx(Ze,{className:"size-3.5"})}):null,k?t.jsxs("div",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!b,onClick:()=>{b&&(M==null||M(e.id,"previous"))},children:t.jsx(Fe,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!A,onClick:()=>{A&&(M==null||M(e.id,"next"))},children:t.jsx(Ye,{className:"size-3.5"})})]}):null,o?t.jsx("button",{type:"button","aria-label":`Stop work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-rose-500/16 text-rose-200 transition hover:bg-rose-500/24",onClick:f=>{f.preventDefault(),f.stopPropagation(),U==null||U(o)},children:t.jsx(ht,{className:"size-3.5 fill-current"})}):e.status!=="done"?t.jsx("button",{type:"button","aria-label":`Start work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-[var(--primary)]/16 text-[var(--primary)] transition hover:bg-[var(--primary)]/24",onClick:f=>{f.preventDefault(),f.stopPropagation(),$==null||$(e.id)},children:t.jsx(ft,{className:"size-4 fill-current"})}):null,(X=e.splitSuggestion)!=null&&X.shouldSplit&&E?t.jsxs("button",{type:"button","aria-label":`Split ${e.title}`,className:"inline-flex items-center gap-1 rounded-full bg-amber-400/12 px-2.5 py-1 text-[10px] font-medium tracking-[0.14em] text-amber-100 transition hover:bg-amber-400/18",onClick:f=>{f.preventDefault(),f.stopPropagation(),E(e.id)},children:[t.jsx(gt,{className:"size-3.5"}),"Split it"]}):null,t.jsxs("span",{className:"shrink-0 text-[11px] text-white/44",children:[e.points," xp"]})]})]}),t.jsx(nt,{kind:L,label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-white/62",children:e.description||ee("common.executionBoard.noExecutionNote")}),z?t.jsxs("div",{className:"mt-3 rounded-[16px] border border-white/8 bg-white/[0.045] p-3",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 text-[11px] text-white/58",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(bt,{className:"size-3.5 text-sky-200"}),z.total," step",z.total===1?"":"s"]}),t.jsxs("span",{className:"tabular-nums text-white/72",children:[z.completed,"/",z.total]})]}),t.jsx("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-white/8",children:t.jsx("div",{className:"h-full rounded-full bg-[linear-gradient(90deg,rgba(56,189,248,0.96),rgba(125,211,252,0.62))]",style:{width:`${J??0}%`}})}),t.jsx("div",{className:"mt-2 grid gap-1.5",children:z.items.slice(0,2).map(f=>t.jsx("div",{className:"truncate text-[11px] text-white/55",children:f},`${e.id}-${f}`))})]}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[g?K?t.jsxs("a",{href:K,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-sky-300/18 bg-sky-400/12 px-2.5 py-1 text-[11px] text-sky-50 transition hover:bg-sky-400/18",onClick:We,children:[t.jsx(we,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:g})]}):t.jsxs(S,{size:"xs",className:"min-w-0 max-w-full bg-sky-400/12 text-sky-50",children:[t.jsx(we,{className:"mr-1 size-3"}),t.jsx("span",{className:"truncate",children:g})]}):null,V?Q?t.jsxs("a",{href:Q,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-fuchsia-300/18 bg-fuchsia-400/12 px-2.5 py-1 text-[11px] text-fuchsia-50 transition hover:bg-fuchsia-400/18",onClick:We,children:[t.jsx(Ue,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:V})]}):t.jsxs(S,{size:"xs",className:"bg-fuchsia-400/12 text-fuchsia-50",children:[t.jsx(Ue,{className:"mr-1 size-3"}),V]}):null,v.changedFileCount>0?t.jsxs(S,{size:"xs",className:"bg-amber-400/12 text-amber-50",children:[t.jsx(wt,{className:"mr-1 size-3"}),v.changedFileCount," file",v.changedFileCount===1?"":"s"]}):null,v.git.repository?t.jsx(S,{size:"xs",className:"bg-white/8 text-white/70",children:v.git.repository}):null]}),v.changedFilesPreview.length>0?t.jsx("div",{className:"mt-2 flex min-w-0 flex-wrap gap-1.5",children:v.changedFilesPreview.map(f=>t.jsx(S,{size:"xs",wrap:!0,className:"min-w-0 max-w-full bg-white/[0.06] font-mono text-[10px] text-white/65",children:f},f))}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[a?t.jsx(le,{kind:"goal",label:a.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(je,{user:e.user,compact:!0,size:"xs"}),t.jsx(Ct,{entityType:"task",entityId:e.id,count:oe,compact:!0}),e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[Math.round(e.actionPointSummary.totalCostAp)," AP"]}):null,e.actionPointSummary?t.jsx(S,{size:"xs",className:"bg-white/8 text-white/72",children:e.actionPointSummary.costBand}):null,e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[Math.round(e.actionPointSummary.expectedDurationSeconds/3600)," h target"]}):null,e.time.totalCreditedSeconds>0?t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[Math.floor(e.time.totalCreditedSeconds/60)," min"]}):null,e.time.activeRunCount>0?t.jsxs(S,{size:"xs",className:"bg-emerald-500/12 text-emerald-200",children:[e.time.activeRunCount," live"]}):null,l.slice(0,2).map(f=>t.jsx(S,{size:"xs",className:"bg-white/8",style:{color:f.color},children:f.name},f.id))]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-white/45",children:[t.jsxs("span",{className:"min-w-0 truncate",children:[e.effort," / ",e.energy]}),t.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-2 text-right",children:[e.status==="done"&&B?t.jsx("button",{type:"button",className:"rounded-full bg-white/8 px-3 py-1 text-[10px] tracking-[0.16em] text-white transition hover:bg-white/12",onClick:f=>{f.preventDefault(),f.stopPropagation(),B(e.id)},children:ee("common.executionBoard.reopen")}):null,t.jsx("span",{children:P})]})]})]})}function fe(e){const{task:a,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:x,isDragging:h}=et({id:l,data:{type:"task",taskId:a.id,status:a.status}});return t.jsx(lt,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:h,isMobile:e.isMobile,onStartTask:e.onStartTask,onStopTask:e.onStopTask,onStepTask:e.onStepTask,onSplitTask:e.onSplitTask,notesSummaryByEntity:e.notesSummaryByEntity,style:{transform:tt.Transform.toString(m),transition:x}})}function ot({project:e,goal:a,isDragging:l=!1,isOverlay:o=!1,style:c,setNodeRef:u,dragAttributes:m,dragListeners:x,isMobile:h=!1,onStepProject:j,onOpenMenu:D}){const{formatDate:k}=ye(),I=_[_.indexOf(e.workflowStatus)-1]??null,$=_[_.indexOf(e.workflowStatus)+1]??null,B=at("project").colorToken.rgb.join(", "),M=e.workflowStatus.replaceAll("_"," "),E=e.status.replaceAll("_"," "),G=e.updatedAt&&!Number.isNaN(Date.parse(e.updatedAt))?k(e.updatedAt):"No recent update";return t.jsxs("article",{ref:u,style:{...c,"--board-card-accent":B},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",h&&"touch-none select-none",o&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[0_28px_80px_rgba(8,12,24,0.42),inset_0_0_0_1px_rgba(var(--board-card-accent),0.28)]",l&&!o&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",!l&&!o&&"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),rgba(255,255,255,0.03))]"),"data-testid":`project-card-${e.id}`,...m,...x,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${B}, 0.96), rgba(${B}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:"project",label:"project",compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 bg-[var(--primary)]/12 text-[var(--primary)]",children:M}),t.jsx(S,{size:"xs",className:"shrink-0 bg-white/8 text-white/72",children:E})]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[D?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white",onClick:C=>{C.preventDefault(),C.stopPropagation(),D(C,e)},children:t.jsx(Ze,{className:"size-3.5"})}):null,h?t.jsxs("div",{className:"flex items-center gap-1",onClick:C=>C.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!I,onClick:()=>{I&&(j==null||j(e.id,"previous"))},children:t.jsx(Fe,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!$,onClick:()=>{$&&(j==null||j(e.id,"next"))},children:t.jsx(Ye,{className:"size-3.5"})})]}):null]})]}),t.jsx(nt,{kind:"project",label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-white/62",children:e.description||"PRD-backed initiative spanning multiple work items."}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[a?t.jsx(le,{kind:"goal",label:a.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(je,{user:e.user,compact:!0,size:"xs"}),(e.assignees??[]).slice(0,2).map(C=>t.jsx(je,{user:C,compact:!0,size:"xs"},C.id)),t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[e.progress,"% progress"]}),t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[e.totalTasks," linked tasks"]})]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-white/45",children:[t.jsx("span",{className:"min-w-0 truncate",children:e.goalTitle}),t.jsx("span",{children:G})]})]})}function ge(e){const{project:a,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:x,isDragging:h}=et({id:l,data:{type:"project",projectId:a.id,status:a.workflowStatus}});return t.jsx(ot,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:h,style:{transform:tt.Transform.toString(m),transition:x}})}function Je({droppableId:e,status:a,title:l,detail:o,count:c,dragging:u,children:m}){const{setNodeRef:x,isOver:h}=Te({id:e,data:{type:"lane",status:a}});return t.jsx("div",{ref:x,className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[24px] transition",h&&"scale-[1.005]"),"data-lane-id":a,"data-testid":`kanban-lane-${a}`,"data-lane-hover":h?"true":"false",children:t.jsxs(it,{className:W("h-full w-full max-w-full min-w-0 overflow-hidden p-3 transition-[background-color,box-shadow,border-color,transform]",u&&"border border-white/8",h?"border border-[rgba(125,211,252,0.38)] bg-[linear-gradient(180deg,rgba(125,211,252,0.12),rgba(125,211,252,0.05))] shadow-[0_18px_54px_rgba(14,165,233,0.12)]":"border border-transparent"),children:[t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"type-label text-white/45",children:o}),t.jsx("h3",{className:"mt-1 break-words text-[1.45rem] leading-[1] text-white",children:l})]}),t.jsx("div",{className:"shrink-0 font-display text-[1.45rem] text-[var(--primary)]",children:c})]}),t.jsx("div",{className:W("grid w-full max-w-full min-w-0 min-h-48 content-start gap-2 rounded-[18px] p-2 transition",h?"bg-[rgba(125,211,252,0.08)]":"bg-white/[0.02]"),children:m})]})})}function Ut({title:e,detail:a,children:l}){return t.jsxs("div",{className:"rounded-[20px] border border-cyan-300/20 bg-[linear-gradient(180deg,rgba(34,211,238,0.11),rgba(11,23,34,0.34))] p-2.5 shadow-[inset_0_0_0_1px_rgba(34,211,238,0.08)]",children:[t.jsx("div",{className:"mb-2 flex items-start justify-between gap-3 px-1",children:t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"inline-flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-cyan-100/86",children:[t.jsx(we,{className:"size-3.5"}),t.jsx("span",{className:"truncate",children:e})]}),a?t.jsx("div",{className:"mt-1 text-[11px] text-white/45",children:a}):null]})}),t.jsx("div",{className:"grid gap-2",children:l})]})}function Pt({droppableId:e,title:a,detail:l}){const{setNodeRef:o,isOver:c}=Te({id:e,data:{type:"trash"}});return t.jsx("div",{ref:o,className:W("pointer-events-auto fixed right-4 top-4 z-50 w-[min(18rem,calc(100vw-2rem))] rounded-[28px] border px-5 py-4 shadow-[0_24px_80px_rgba(6,10,20,0.48)] backdrop-blur-2xl transition lg:right-6 lg:top-6",c?"border-rose-300/38 bg-[linear-gradient(180deg,rgba(244,63,94,0.28),rgba(120,24,42,0.46))] text-white scale-[1.02]":"border-white/10 bg-[linear-gradient(180deg,rgba(18,24,38,0.96),rgba(10,14,24,0.94))] text-white/84"),"data-testid":"kanban-trash-dropzone","data-trash-hover":c?"true":"false",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:W("flex size-12 items-center justify-center rounded-full border transition",c?"border-white/28 bg-white/12":"border-white/12 bg-white/6"),children:t.jsx(ve,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.2em] text-white/55",children:"Bin"}),t.jsx("div",{className:"mt-1 text-base font-medium text-white",children:a}),t.jsx("div",{className:"mt-1 text-sm leading-5 text-white/62",children:l})]})]})})}function Jt({tasks:e,projects:a=[],activeRuns:l=[],goals:o,tags:c,selectedTaskId:u,onMove:m,onMoveProject:x,onSelectTask:h,onStartTask:j,onStopTask:D,onQuickReopenTask:k,onDeleteTask:I,onOpenProject:$,onOpenTask:U,onEditProject:B,onEditTask:M,onLinkProject:E,onLinkTask:G,onCreateIssueForProject:C,onCreateTaskForIssue:ee,onCreateSubtaskForTask:ne,onSplitTask:v,notesSummaryByEntity:z}){var $e,Be;const{t:b}=ye(),A=N.useId(),oe=`${A}:trash`,[L,ce]=N.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 1023px)").matches),te=jt(vt(_t,{activationConstraint:{distance:6}})),[P,J]=N.useState(null),[g,K]=N.useState(null),[V,Q]=N.useState(null),[X,f]=N.useState(null),[Ne,ct]=N.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("forge.kanban-skip-delete-confirmation")==="true"),[ke,se]=N.useState(!1),[Se,Z]=N.useState({}),[_e,ie]=N.useState({}),re={backlog:{title:b("common.executionBoard.laneBacklogTitle"),detail:b("common.executionBoard.laneBacklogDetail")},focus:{title:b("common.executionBoard.laneFocusTitle"),detail:b("common.executionBoard.laneFocusDetail")},in_progress:{title:b("common.executionBoard.laneProgressTitle"),detail:b("common.executionBoard.laneProgressDetail")},blocked:{title:b("common.executionBoard.laneBlockedTitle"),detail:b("common.executionBoard.laneBlockedDetail")},done:{title:b("common.executionBoard.laneDoneTitle"),detail:b("common.executionBoard.laneDoneDetail")}},F=N.useMemo(()=>e.map(i=>{const n=Se[i.id];return n?{...i,status:n}:i}),[Se,e]),Y=N.useMemo(()=>a.map(i=>{const n=_e[i.id];return n?{...i,workflowStatus:n}:i}),[_e,a]),Ie=N.useMemo(()=>{const i=new Map;for(const n of l){if(n.status!=="active")continue;const s=i.get(n.taskId);(!s||n.isCurrent||n.updatedAt>s.updatedAt)&&i.set(n.taskId,n)}return i},[l]),H=N.useMemo(()=>[...Y.map(i=>({kind:"project",id:i.id,status:i.workflowStatus,project:i,goal:o.find(n=>n.id===i.goalId)})),...F.map(i=>({kind:"task",id:i.id,status:i.status,task:i,goal:o.find(n=>n.id===i.goalId),tags:i.tagIds.map(n=>c.find(s=>s.id===n)).filter(Boolean),activeRun:Ie.get(i.id)??null}))],[Ie,Y,F,o,c]),O=P?H.find(i=>i.id===P)??null:null,dt=N.useMemo(()=>{if(!g)return[];if(g.kind==="project"){const n=Y.find(s=>s.id===g.entityId);return n?[{id:"open-project",label:"Open",description:"Jump to the project detail view.",icon:Ke,onSelect:()=>$==null?void 0:$(n.id)},{id:"edit-project",label:"Edit",description:"Open the guided project editor.",icon:Qe,onSelect:()=>B==null?void 0:B(n.id)},{id:"link-project",label:"Link",description:"Open the anchor step to relink the project to its goal.",icon:Xe,onSelect:()=>E==null?void 0:E(n.id)},{id:"create-issue",label:"Create issue",description:"Break this project into a new vertical slice issue.",icon:be,onSelect:()=>C==null?void 0:C(n.id)},..._.filter(s=>s!==n.workflowStatus).map(s=>({id:`move-project-${s}`,label:`Move to ${s.replaceAll("_"," ")}`,description:"Update the project workflow lane without leaving the board.",onSelect:()=>void(x==null?void 0:x(n.id,s))}))]:[]}const i=F.find(n=>n.id===g.entityId);return i?Bt({task:i,onOpenTask:U,onEditTask:M,onLinkTask:G,onCreateTaskForIssue:ee,onCreateSubtaskForTask:ne,onMove:m,onDeleteTask:I,deletePendingTaskId:X,onRequestDelete:De}):[]},[Y,F,g,C,ne,ee,B,M,E,G,m,x,I,$,U,X,Ne]);function Ce(i){var s;if(i.length===0)return t.jsx("div",{className:"w-full max-w-full rounded-[18px] border border-dashed border-white/8 px-4 py-8 text-center text-sm text-white/35",children:b("common.executionBoard.emptyLane")});if(((s=i[0])==null?void 0:s.status)!=="in_progress")return i.map(d=>d.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${d.task.id}`,task:d.task,goal:d.goal,tags:d.tags,activeRun:d.activeRun,isSelected:u===d.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},d.task.id):t.jsx(ge,{sortableId:`${A}:project:${d.project.id}`,project:d.project,goal:d.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},d.project.id));const n=new Map;for(const d of i){if(d.kind!=="task"||!d.activeRun){const R=n.get("ungrouped");R?R.items.push(d):n.set("ungrouped",{title:"Active work",detail:"Tasks in progress without a tracked branch",items:[d]});continue}const p=st(d.task,d.activeRun),r=[d.activeRun.actor,p.git.repository??"",p.git.branch??""].join("::"),w=n.get(r);if(w){w.items.push(d);continue}n.set(r,{title:Et(d.activeRun,p.git.branch),detail:Ot(d.activeRun,p.git.repository),items:[d]})}return Array.from(n.entries()).map(([d,p])=>d==="ungrouped"?p.items.map(r=>r.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${r.task.id}`,task:r.task,goal:r.goal,tags:r.tags,activeRun:r.activeRun,isSelected:u===r.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},r.task.id):t.jsx(ge,{sortableId:`${A}:project:${r.project.id}`,project:r.project,goal:r.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},r.project.id)):t.jsx(Ut,{title:p.title,detail:p.detail,children:p.items.map(r=>r.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${r.task.id}`,task:r.task,goal:r.goal,tags:r.tags,activeRun:r.activeRun,isSelected:u===r.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},r.task.id):t.jsx(ge,{sortableId:`${A}:project:${r.project.id}`,project:r.project,goal:r.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},r.project.id))},d))}N.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const i=window.matchMedia("(max-width: 1023px)"),n=s=>{ce(s?s.matches:i.matches)};return n(),typeof i.addEventListener=="function"?(i.addEventListener("change",n),()=>i.removeEventListener("change",n)):(i.addListener(n),()=>i.removeListener(n))},[]),N.useEffect(()=>{if(!P){document.body.style.cursor="";return}return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[P]),N.useEffect(()=>{Z(i=>{const n=new Set(e.map(p=>p.id));let s=!1;const d={};for(const[p,r]of Object.entries(i)){const w=e.find(R=>R.id===p);if(!n.has(p)||!w||w.status===r){s=!0;continue}d[p]=r}return s?d:i})},[e]),N.useEffect(()=>{ie(i=>{const n=new Set(a.map(p=>p.id));let s=!1;const d={};for(const[p,r]of Object.entries(i)){const w=a.find(R=>R.id===p);if(!n.has(p)||!w||w.workflowStatus===r){s=!0;continue}d[p]=r}return s?d:i})},[a]);function ut(i){var d,p;const n=(d=i.active.data.current)==null?void 0:d.taskId,s=(p=i.active.data.current)==null?void 0:p.projectId;typeof n=="string"?J(n):typeof s=="string"&&J(s)}const mt=i=>{ct(i),typeof window<"u"&&window.localStorage.setItem("forge.kanban-skip-delete-confirmation","true")},ze=async(i,n)=>{if(I){f(i.id);try{n&&mt(!0),await I(i.id),Q(null),se(!1),Z(s=>{const d={...s};return delete d[i.id],d})}finally{f(null)}}};function De(i){if(I){if(Ne){ze(i,!1);return}se(!1),Q(i)}}async function xt(i){var Me,Ae,Le,Re,Ee,Oe;const{active:n,over:s}=i;if(J(null),!s||n.id===s.id)return;const d=typeof((Me=n.data.current)==null?void 0:Me.taskId)=="string"?n.data.current.taskId:null,p=typeof((Ae=n.data.current)==null?void 0:Ae.projectId)=="string"?n.data.current.projectId:null,r=(d?H.find(y=>y.kind==="task"&&y.id===d):null)??(p?H.find(y=>y.kind==="project"&&y.id===p):null);if(!r)return;if(((Le=s.data.current)==null?void 0:Le.type)==="trash"){if(r.kind!=="task"||!I)return;De(r.task);return}const w=typeof((Re=s.data.current)==null?void 0:Re.status)=="string"?s.data.current.status:null,R=typeof((Ee=s.data.current)==null?void 0:Ee.taskId)=="string"?s.data.current.taskId:null,q=typeof((Oe=s.data.current)==null?void 0:Oe.projectId)=="string"?s.data.current.projectId:null,pe=(R?H.find(y=>y.kind==="task"&&y.id===R):null)??(q?H.find(y=>y.kind==="project"&&y.id===q):null),T=w??(pe==null?void 0:pe.status)??r.status;if(!(T===r.status||!_.includes(T))){if(r.kind==="task"){Z(y=>({...y,[r.task.id]:T}));try{await m(r.task.id,T)}catch(y){throw Z(he=>{const ae={...he};return delete ae[r.task.id],ae}),y}return}if(x){ie(y=>({...y,[r.project.id]:T}));try{await x(r.project.id,T)}catch(y){throw ie(he=>{const ae={...he};return delete ae[r.project.id],ae}),y}}}}async function de(i,n){const s=F.find(w=>w.id===i);if(!s)return;const d=_.indexOf(s.status),p=n==="previous"?d-1:d+1,r=_[p]??null;if(!(!r||r===s.status)){Z(w=>({...w,[s.id]:r}));try{await m(s.id,r)}catch(w){throw Z(R=>{const q={...R};return delete q[s.id],q}),w}}}async function ue(i,n){const s=Y.find(w=>w.id===i);if(!s||!x)return;const d=_.indexOf(s.workflowStatus),p=n==="previous"?d-1:d+1,r=_[p]??null;if(!(!r||r===s.workflowStatus)){ie(w=>({...w,[s.id]:r}));try{await x(s.id,r)}catch(w){throw ie(R=>{const q={...R};return delete q[s.id],q}),w}}}function me(i,n){const s=i.currentTarget.getBoundingClientRect();K({kind:"task",entityId:n.id,position:{x:s.right-8,y:s.bottom+8}})}function xe(i,n){const s=i.currentTarget.getBoundingClientRect();K({kind:"project",entityId:n.id,position:{x:s.right-8,y:s.bottom+8}})}return t.jsxs(yt,{sensors:te,collisionDetection:Rt,onDragStart:ut,onDragCancel:()=>J(null),onDragEnd:i=>void xt(i),children:[(O==null?void 0:O.kind)==="task"&&I?t.jsx(Pt,{droppableId:oe,title:b("common.executionBoard.deleteDropTitle"),detail:b("common.executionBoard.deleteDropDetail")}):null,t.jsx("div",{className:"w-full max-w-full min-w-0 pb-2",children:L?t.jsx("div",{className:"grid w-full max-w-full min-w-0 gap-2",children:_.map(i=>{const n=H.filter(s=>s.status===i);return t.jsx(Pe,{items:n.map(s=>`${A}:${s.kind}:${s.id}`),strategy:Ve,children:t.jsx(Je,{droppableId:`${A}:lane:${i}`,status:i,title:re[i].title,detail:re[i].detail,count:n.length,dragging:P!==null,children:Ce(n)})},i)})}):t.jsx("div",{className:"grid w-full min-w-0 gap-0.5 xl:grid-cols-[repeat(5,minmax(0,1fr))]",children:_.map(i=>{const n=H.filter(s=>s.status===i);return t.jsx(Pe,{items:n.map(s=>`${A}:${s.kind}:${s.id}`),strategy:Ve,children:t.jsx(Je,{droppableId:`${A}:lane:${i}`,status:i,title:re[i].title,detail:re[i].detail,count:n.length,dragging:P!==null,children:Ce(n)})},i)})})}),t.jsx(Nt,{adjustScale:!1,dropAnimation:null,children:O?t.jsx("div",{className:"w-[20rem] max-w-[calc(100vw-2rem)]",children:O.kind==="task"?t.jsx(lt,{task:O.task,goal:O.goal,tags:O.tags,activeRun:O.activeRun,isSelected:u===O.task.id,isDragging:!0,isOverlay:!0,isMobile:L,onSelect:()=>{},onStartTask:j,onSplitTask:v,notesSummaryByEntity:z}):t.jsx(ot,{project:O.project,goal:O.goal,isDragging:!0,isOverlay:!0,isMobile:L})}):null}),t.jsx(zt,{open:g!==null,title:(g==null?void 0:g.kind)==="project"?(($e=Y.find(i=>i.id===g.entityId))==null?void 0:$e.title)??"Project actions":((Be=F.find(i=>i.id===(g==null?void 0:g.entityId)))==null?void 0:Be.title)??"Work item actions",subtitle:(g==null?void 0:g.kind)==="project"?"Edit, relink, move, or break this project into issues.":"Edit, relink, move, or create the next child work item.",items:dt,position:(g==null?void 0:g.position)??null,onClose:()=>K(null)}),V?t.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-[rgba(5,8,18,0.74)] p-4 backdrop-blur-xl",children:t.jsxs(it,{className:"w-full max-w-md border border-white/10 bg-[linear-gradient(180deg,rgba(16,22,36,0.96),rgba(9,13,22,0.98))] shadow-[0_32px_90px_rgba(5,8,18,0.58)]",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 flex size-11 shrink-0 items-center justify-center rounded-full bg-rose-500/14 text-rose-100",children:t.jsx(ve,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-display text-[1.35rem] leading-tight text-white",children:b("common.executionBoard.deleteConfirmTitle")}),t.jsx("div",{className:"mt-2 text-sm leading-6 text-white/64",children:b("common.executionBoard.deleteConfirmDescription",{title:V.title})})]})]}),t.jsxs("label",{className:"mt-5 flex items-center gap-3 rounded-[18px] bg-white/[0.05] px-4 py-3 text-sm text-white/76",children:[t.jsx("input",{type:"checkbox",checked:ke,onChange:i=>se(i.target.checked),className:"size-4 rounded border-white/20 bg-transparent text-[var(--primary)]"}),t.jsx("span",{children:b("common.executionBoard.deleteConfirmCheckbox")})]}),t.jsxs("div",{className:"mt-5 flex flex-wrap justify-end gap-3",children:[t.jsx(qe,{variant:"secondary",onClick:()=>{Q(null),se(!1)},children:b("common.executionBoard.deleteConfirmCancel")}),t.jsx(qe,{className:"bg-[linear-gradient(135deg,rgba(251,113,133,0.3),rgba(190,24,93,0.26))] text-white shadow-[0_16px_36px_rgba(190,24,93,0.18)]",pending:X===V.id,pendingLabel:b("common.executionBoard.deletingTask"),onClick:()=>void ze(V,ke),children:b("common.executionBoard.deleteConfirmSubmit")})]})]})}):null]})}export{Jt as E};
|
|
1
|
+
import{r as N,bg as Ke,ce as Qe,cb as Xe,cv as be,j as t,c7 as ve,b2 as pt,ca as Ze,cw as Fe,cx as Ye,bC as ht,bB as ft,c9 as gt,aO as bt,aP as we,bo as Ue,cy as wt}from"./vendor-DHkYh85p.js";import{u as jt,a as vt,D as yt,S as Pe,v as Ve,e as Nt,p as kt,f as St,P as _t,g as Te,b as et,C as tt}from"./board-BkDRaMp6.js";import{P as ye,C as it,B as qe,Z as W,_ as It,aR as at,b as le,c as S,V as nt,U as je}from"./index-CF4J4R9L.js";import{E as Ct}from"./entity-note-count-link-DrhjJZ4i.js";import{F as zt}from"./floating-action-menu-Fs_ZiUMo.js";function Dt(e){if(typeof e=="number"&&Number.isInteger(e)&&e>0)return e;if(typeof e=="string"){const a=e.match(/(\d+)/);if(a){const l=Number.parseInt(a[1]??"",10);return Number.isInteger(l)&&l>0?l:null}}return null}function Ge(e){return e.split(/\r?\n/).map(a=>a.trim()).reduce((a,l)=>{const o=l.match(/^[-*+]\s+\[([ xX])\]\s+(.+)$/);if(o)return a.push({label:o[2].trim(),completed:o[1].toLowerCase()==="x"}),a;const c=l.match(/^(?:[-*+]|\d+\.)\s+(.+)$/);return c&&a.push({label:c[1].trim(),completed:null}),a},[]).filter(a=>a.label.length>0)}function $t(e){if(e.acceptanceCriteria.length>0)return{total:e.acceptanceCriteria.length,completed:e.status==="done"?e.acceptanceCriteria.length:0,source:"acceptance_criteria",items:e.acceptanceCriteria};const a=Ge(e.aiInstructions);if(a.length>0){const o=e.status==="done"?a.length:a.filter(c=>c.completed===!0).length;return{total:a.length,completed:o,source:"ai_instructions",items:a.map(c=>c.label)}}const l=Ge(e.description);if(l.length>0){const o=e.status==="done"?l.length:l.filter(c=>c.completed===!0).length;return{total:l.length,completed:o,source:"description",items:l.map(c=>c.label)}}return null}function He(e,a){return e.find(l=>l.refType===a)??null}function st(e,a=null){var x,h,j,D,k,I,$,U,B,M,E;const l=new Set(((x=e.completionReport)==null?void 0:x.linkedGitRefIds)??[]),o=He(e.gitRefs,"branch"),c=He(e.gitRefs,"pull_request"),u=(a==null?void 0:a.gitContext)??null,m=(u==null?void 0:u.pullRequestNumber)??Dt((c==null?void 0:c.refValue)??(c==null?void 0:c.displayTitle)??null);return{actor:(a==null?void 0:a.actor)??null,activeRun:a,stepSummary:$t(e),changedFileCount:((h=e.completionReport)==null?void 0:h.modifiedFiles.length)??0,changedFilesPreview:(((j=e.completionReport)==null?void 0:j.modifiedFiles)??[]).slice(0,2),git:{provider:((D=u==null?void 0:u.provider)==null?void 0:D.trim())||((k=o==null?void 0:o.provider)==null?void 0:k.trim())||((I=c==null?void 0:c.provider)==null?void 0:I.trim())||null,repository:(($=u==null?void 0:u.repository)==null?void 0:$.trim())||((U=o==null?void 0:o.repository)==null?void 0:U.trim())||((B=c==null?void 0:c.repository)==null?void 0:B.trim())||null,branch:((M=u==null?void 0:u.branch)==null?void 0:M.trim())||((E=o==null?void 0:o.refValue)==null?void 0:E.trim())||null,branchUrl:(u==null?void 0:u.branchUrl)??(o==null?void 0:o.url)??null,pullRequestNumber:m,pullRequestUrl:(u==null?void 0:u.pullRequestUrl)??(c==null?void 0:c.url)??null,compareUrl:(u==null?void 0:u.compareUrl)??null,linkedRefCount:l.size}}}const _=["backlog","focus","in_progress","blocked","done"];function Bt({task:e,onOpenTask:a,onEditTask:l,onLinkTask:o,onCreateTaskForIssue:c,onCreateSubtaskForTask:u,onMove:m,onDeleteTask:x,deletePendingTaskId:h,onRequestDelete:j}){const D=e.level==="issue"?{id:"create-task",label:"Create task",description:"Add a focused execution task under this issue.",icon:be,onSelect:()=>c==null?void 0:c(e.id)}:e.level==="task"?{id:"create-subtask",label:"Create subtask",description:"Add a granular child step under this task.",icon:be,onSelect:()=>u==null?void 0:u(e.id)}:null;return[{id:"open-task",label:"Open",description:"Jump to the work-item detail view.",icon:Ke,onSelect:()=>a==null?void 0:a(e.id)},{id:"edit-task",label:"Edit",description:"Open the guided work-item editor.",icon:Qe,onSelect:()=>l==null?void 0:l(e.id)},{id:"link-task",label:"Link",description:"Open the placement step to relink this work item.",icon:Xe,onSelect:()=>o==null?void 0:o(e.id)},...D?[D]:[],{id:"delete-task",label:e.level==="issue"?"Delete issue":e.level==="subtask"?"Delete subtask":"Delete task",description:"Remove this work item directly from the board menu.",icon:ve,tone:"danger",disabled:!x||h===e.id,onSelect:()=>j(e)},..._.filter(k=>k!==e.status).map(k=>({id:`move-task-${k}`,label:`Move to ${k.replaceAll("_"," ")}`,description:"Update the workflow lane for this work item.",onSelect:()=>void m(e.id,k)}))]}function rt(e){return e.startsWith("lane:")||e.includes(":lane:")}function Mt(e){var a,l;return((l=(a=e.data)==null?void 0:a.current)==null?void 0:l.type)==="lane"||rt(String(e.id))}function At(e){var a,l;return((l=(a=e.data)==null?void 0:a.current)==null?void 0:l.type)==="trash"}function Lt(e,a){const l=Math.max(0,Math.min(e.right,a.right)-Math.max(e.left,a.left)),o=Math.max(0,Math.min(e.bottom,a.bottom)-Math.max(e.top,a.top));return l*o}const Rt=e=>{const a=kt(e),l=a.find(m=>{const x=e.droppableContainers.find(h=>h.id===m.id);return x?At(x):!1});if(l)return[l];const o=a.find(m=>rt(String(m.id)));if(o)return[o];const u=e.droppableContainers.filter(m=>Mt(m)).map(m=>{const x=e.droppableRects.get(m.id);if(!x)return null;const h=Lt(e.collisionRect,x);return h<=0?null:{id:m.id,data:{droppableContainer:m,value:h}}}).filter(Boolean).sort((m,x)=>{var h,j;return(((h=x==null?void 0:x.data)==null?void 0:h.value)??0)-(((j=m==null?void 0:m.data)==null?void 0:j.value)??0)});return u.length>0?u:a.length>0?a:St(e)};function Et(e,a){return a&&a.trim().length>0?a:e!=null&&e.actor?`${e.actor} session`:"Active work"}function Ot(e,a){return[(e==null?void 0:e.actor)??null,a].filter(Boolean).join(" · ")}function We(e){e.preventDefault(),e.stopPropagation()}function lt({task:e,goal:a,tags:l,activeRun:o,isSelected:c,isDragging:u=!1,isOverlay:m=!1,style:x,setNodeRef:h,dragAttributes:j,dragListeners:D,isMobile:k=!1,onSelect:I,onStartTask:$,onStopTask:U,onQuickReopen:B,onStepTask:M,onSplitTask:E,onOpenMenu:G,notesSummaryByEntity:C}){var X;const{t:ee,formatDate:ne}=ye(),v=st(e,o??null),z=v.stepSummary,b=_[_.indexOf(e.status)-1]??null,A=_[_.indexOf(e.status)+1]??null,oe=It(C,"task",e.id).count,L=e.level==="issue"?"issue":"task",ce=at(L),te=e.level==="subtask"?"136,146,255":ce.colorToken.rgb.join(", "),P=e.dueDate&&!Number.isNaN(Date.parse(e.dueDate))?ne(e.dueDate):"No due date",J=z&&z.total>0?Math.max(8,Math.round(z.completed/z.total*100)):null,g=v.git.branch,K=v.git.branchUrl,V=v.git.pullRequestNumber?`PR #${v.git.pullRequestNumber}`:null,Q=v.git.pullRequestUrl;return t.jsxs("article",{ref:h,style:{...x,"--board-card-accent":te},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",k&&"touch-none select-none",m&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[0_28px_80px_rgba(8,12,24,0.42),inset_0_0_0_1px_rgba(var(--board-card-accent),0.28)]",u&&!m&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",c?"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.18),rgba(var(--board-card-accent),0.06))] shadow-[0_16px_40px_rgba(8,12,24,0.32),inset_0_0_0_1px_rgba(var(--board-card-accent),0.26)]":"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),rgba(255,255,255,0.03))]"),"data-dragging":u?"true":"false","data-testid":`task-card-${e.id}`,onClick:()=>I(e.id),...j,...D,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${te}, 0.96), rgba(${te}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:L,label:e.level,compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 text-[10px] text-[var(--tertiary)]",children:e.priority}),v.actor?t.jsxs(S,{size:"xs",className:"shrink-0 bg-cyan-400/12 text-cyan-100",children:[t.jsx(pt,{className:"mr-1 size-3"}),v.actor]}):null]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[G?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white",onClick:f=>{f.preventDefault(),f.stopPropagation(),G(f,e)},children:t.jsx(Ze,{className:"size-3.5"})}):null,k?t.jsxs("div",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!b,onClick:()=>{b&&(M==null||M(e.id,"previous"))},children:t.jsx(Fe,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!A,onClick:()=>{A&&(M==null||M(e.id,"next"))},children:t.jsx(Ye,{className:"size-3.5"})})]}):null,o?t.jsx("button",{type:"button","aria-label":`Stop work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-rose-500/16 text-rose-200 transition hover:bg-rose-500/24",onClick:f=>{f.preventDefault(),f.stopPropagation(),U==null||U(o)},children:t.jsx(ht,{className:"size-3.5 fill-current"})}):e.status!=="done"?t.jsx("button",{type:"button","aria-label":`Start work on ${e.title}`,className:"inline-flex size-8 items-center justify-center rounded-full bg-[var(--primary)]/16 text-[var(--primary)] transition hover:bg-[var(--primary)]/24",onClick:f=>{f.preventDefault(),f.stopPropagation(),$==null||$(e.id)},children:t.jsx(ft,{className:"size-4 fill-current"})}):null,(X=e.splitSuggestion)!=null&&X.shouldSplit&&E?t.jsxs("button",{type:"button","aria-label":`Split ${e.title}`,className:"inline-flex items-center gap-1 rounded-full bg-amber-400/12 px-2.5 py-1 text-[10px] font-medium tracking-[0.14em] text-amber-100 transition hover:bg-amber-400/18",onClick:f=>{f.preventDefault(),f.stopPropagation(),E(e.id)},children:[t.jsx(gt,{className:"size-3.5"}),"Split it"]}):null,t.jsxs("span",{className:"shrink-0 text-[11px] text-white/44",children:[e.points," xp"]})]})]}),t.jsx(nt,{kind:L,label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-white/62",children:e.description||ee("common.executionBoard.noExecutionNote")}),z?t.jsxs("div",{className:"mt-3 rounded-[16px] border border-white/8 bg-white/[0.045] p-3",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 text-[11px] text-white/58",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx(bt,{className:"size-3.5 text-sky-200"}),z.total," step",z.total===1?"":"s"]}),t.jsxs("span",{className:"tabular-nums text-white/72",children:[z.completed,"/",z.total]})]}),t.jsx("div",{className:"mt-2 h-1.5 overflow-hidden rounded-full bg-white/8",children:t.jsx("div",{className:"h-full rounded-full bg-[linear-gradient(90deg,rgba(56,189,248,0.96),rgba(125,211,252,0.62))]",style:{width:`${J??0}%`}})}),t.jsx("div",{className:"mt-2 grid gap-1.5",children:z.items.slice(0,2).map(f=>t.jsx("div",{className:"truncate text-[11px] text-white/55",children:f},`${e.id}-${f}`))})]}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[g?K?t.jsxs("a",{href:K,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-sky-300/18 bg-sky-400/12 px-2.5 py-1 text-[11px] text-sky-50 transition hover:bg-sky-400/18",onClick:We,children:[t.jsx(we,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:g})]}):t.jsxs(S,{size:"xs",className:"min-w-0 max-w-full bg-sky-400/12 text-sky-50",children:[t.jsx(we,{className:"mr-1 size-3"}),t.jsx("span",{className:"truncate",children:g})]}):null,V?Q?t.jsxs("a",{href:Q,target:"_blank",rel:"noreferrer",className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-fuchsia-300/18 bg-fuchsia-400/12 px-2.5 py-1 text-[11px] text-fuchsia-50 transition hover:bg-fuchsia-400/18",onClick:We,children:[t.jsx(Ue,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"truncate",children:V})]}):t.jsxs(S,{size:"xs",className:"bg-fuchsia-400/12 text-fuchsia-50",children:[t.jsx(Ue,{className:"mr-1 size-3"}),V]}):null,v.changedFileCount>0?t.jsxs(S,{size:"xs",className:"bg-amber-400/12 text-amber-50",children:[t.jsx(wt,{className:"mr-1 size-3"}),v.changedFileCount," file",v.changedFileCount===1?"":"s"]}):null,v.git.repository?t.jsx(S,{size:"xs",className:"bg-white/8 text-white/70",children:v.git.repository}):null]}),v.changedFilesPreview.length>0?t.jsx("div",{className:"mt-2 flex min-w-0 flex-wrap gap-1.5",children:v.changedFilesPreview.map(f=>t.jsx(S,{size:"xs",wrap:!0,className:"min-w-0 max-w-full bg-white/[0.06] font-mono text-[10px] text-white/65",children:f},f))}):null,t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[a?t.jsx(le,{kind:"goal",label:a.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(je,{user:e.user,compact:!0,size:"xs"}),t.jsx(Ct,{entityType:"task",entityId:e.id,count:oe,compact:!0}),e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[Math.round(e.actionPointSummary.totalCostAp)," AP"]}):null,e.actionPointSummary?t.jsx(S,{size:"xs",className:"bg-white/8 text-white/72",children:e.actionPointSummary.costBand}):null,e.actionPointSummary?t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[Math.round(e.actionPointSummary.expectedDurationSeconds/3600)," h target"]}):null,e.time.totalCreditedSeconds>0?t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[Math.floor(e.time.totalCreditedSeconds/60)," min"]}):null,e.time.activeRunCount>0?t.jsxs(S,{size:"xs",className:"bg-emerald-500/12 text-emerald-200",children:[e.time.activeRunCount," live"]}):null,l.slice(0,2).map(f=>t.jsx(S,{size:"xs",className:"bg-white/8",style:{color:f.color},children:f.name},f.id))]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-white/45",children:[t.jsxs("span",{className:"min-w-0 truncate",children:[e.effort," / ",e.energy]}),t.jsxs("div",{className:"flex min-w-0 shrink-0 items-center gap-2 text-right",children:[e.status==="done"&&B?t.jsx("button",{type:"button",className:"rounded-full bg-white/8 px-3 py-1 text-[10px] tracking-[0.16em] text-white transition hover:bg-white/12",onClick:f=>{f.preventDefault(),f.stopPropagation(),B(e.id)},children:ee("common.executionBoard.reopen")}):null,t.jsx("span",{children:P})]})]})]})}function fe(e){const{task:a,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:x,isDragging:h}=et({id:l,data:{type:"task",taskId:a.id,status:a.status}});return t.jsx(lt,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:h,isMobile:e.isMobile,onStartTask:e.onStartTask,onStopTask:e.onStopTask,onStepTask:e.onStepTask,onSplitTask:e.onSplitTask,notesSummaryByEntity:e.notesSummaryByEntity,style:{transform:tt.Transform.toString(m),transition:x}})}function ot({project:e,goal:a,isDragging:l=!1,isOverlay:o=!1,style:c,setNodeRef:u,dragAttributes:m,dragListeners:x,isMobile:h=!1,onStepProject:j,onOpenMenu:D}){const{formatDate:k}=ye(),I=_[_.indexOf(e.workflowStatus)-1]??null,$=_[_.indexOf(e.workflowStatus)+1]??null,B=at("project").colorToken.rgb.join(", "),M=e.workflowStatus.replaceAll("_"," "),E=e.status.replaceAll("_"," "),G=e.updatedAt&&!Number.isNaN(Date.parse(e.updatedAt))?k(e.updatedAt):"No recent update";return t.jsxs("article",{ref:u,style:{...c,"--board-card-accent":B},className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[18px] p-3 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.12)] transition cursor-grab active:cursor-grabbing",h&&"touch-none select-none",o&&"rotate-[0.5deg] bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.22),rgba(var(--board-card-accent),0.08))] shadow-[0_28px_80px_rgba(8,12,24,0.42),inset_0_0_0_1px_rgba(var(--board-card-accent),0.28)]",l&&!o&&"opacity-35 shadow-[inset_0_0_0_1px_rgba(var(--board-card-accent),0.08)]",!l&&!o&&"bg-[linear-gradient(180deg,rgba(var(--board-card-accent),0.08),rgba(255,255,255,0.03))]"),"data-testid":`project-card-${e.id}`,...m,...x,children:[t.jsx("div",{className:"mb-3 h-px w-full rounded-full",style:{background:`linear-gradient(90deg, rgba(${B}, 0.96), rgba(${B}, 0.18))`}}),t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[t.jsx(le,{kind:"project",label:"project",compact:!0,size:"xs",gradient:!1,className:"shrink-0"}),t.jsx(S,{size:"xs",className:"shrink-0 bg-[var(--primary)]/12 text-[var(--primary)]",children:M}),t.jsx(S,{size:"xs",className:"shrink-0 bg-white/8 text-white/72",children:E})]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5",children:[D?t.jsx("button",{type:"button","aria-label":`Open ${e.title} actions`,className:"inline-flex size-8 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white",onClick:C=>{C.preventDefault(),C.stopPropagation(),D(C,e)},children:t.jsx(Ze,{className:"size-3.5"})}):null,h?t.jsxs("div",{className:"flex items-center gap-1",onClick:C=>C.stopPropagation(),children:[t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the previous lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!I,onClick:()=>{I&&(j==null||j(e.id,"previous"))},children:t.jsx(Fe,{className:"size-3.5"})}),t.jsx("button",{type:"button","aria-label":`Move ${e.title} to the next lane`,className:"inline-flex size-7 items-center justify-center rounded-full bg-white/8 text-white/62 transition hover:bg-white/12 hover:text-white disabled:opacity-35",disabled:!$,onClick:()=>{$&&(j==null||j(e.id,"next"))},children:t.jsx(Ye,{className:"size-3.5"})})]}):null]})]}),t.jsx(nt,{kind:"project",label:e.title,className:"max-w-full",lines:3,labelClassName:"[overflow-wrap:anywhere]"}),t.jsx("p",{className:"mt-1.5 line-clamp-3 [overflow-wrap:anywhere] text-[12px] leading-5 text-white/62",children:e.description||"PRD-backed initiative spanning multiple work items."}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 flex-wrap gap-1.5",children:[a?t.jsx(le,{kind:"goal",label:a.title,compact:!0,size:"xs",wrap:!0,className:"min-w-0 max-w-full"}):null,t.jsx(je,{user:e.user,compact:!0,size:"xs"}),(e.assignees??[]).slice(0,2).map(C=>t.jsx(je,{user:C,compact:!0,size:"xs"},C.id)),t.jsxs(S,{size:"xs",className:"bg-[var(--primary)]/12 text-[var(--primary)]",children:[e.progress,"% progress"]}),t.jsxs(S,{size:"xs",className:"bg-white/8 text-white/72",children:[e.totalTasks," linked tasks"]})]}),t.jsxs("div",{className:"mt-2.5 flex min-w-0 items-center justify-between gap-2 text-[11px] text-white/45",children:[t.jsx("span",{className:"min-w-0 truncate",children:e.goalTitle}),t.jsx("span",{children:G})]})]})}function ge(e){const{project:a,sortableId:l}=e,{attributes:o,listeners:c,setNodeRef:u,transform:m,transition:x,isDragging:h}=et({id:l,data:{type:"project",projectId:a.id,status:a.workflowStatus}});return t.jsx(ot,{...e,setNodeRef:u,dragAttributes:o,dragListeners:c,isDragging:h,style:{transform:tt.Transform.toString(m),transition:x}})}function Je({droppableId:e,status:a,title:l,detail:o,count:c,dragging:u,children:m}){const{setNodeRef:x,isOver:h}=Te({id:e,data:{type:"lane",status:a}});return t.jsx("div",{ref:x,className:W("w-full max-w-full min-w-0 overflow-hidden rounded-[24px] transition",h&&"scale-[1.005]"),"data-lane-id":a,"data-testid":`kanban-lane-${a}`,"data-lane-hover":h?"true":"false",children:t.jsxs(it,{className:W("h-full w-full max-w-full min-w-0 overflow-hidden p-3 transition-[background-color,box-shadow,border-color,transform]",u&&"border border-white/8",h?"border border-[rgba(125,211,252,0.38)] bg-[linear-gradient(180deg,rgba(125,211,252,0.12),rgba(125,211,252,0.05))] shadow-[0_18px_54px_rgba(14,165,233,0.12)]":"border border-transparent"),children:[t.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"type-label text-white/45",children:o}),t.jsx("h3",{className:"mt-1 break-words text-[1.45rem] leading-[1] text-white",children:l})]}),t.jsx("div",{className:"shrink-0 font-display text-[1.45rem] text-[var(--primary)]",children:c})]}),t.jsx("div",{className:W("grid w-full max-w-full min-w-0 min-h-48 content-start gap-2 rounded-[18px] p-2 transition",h?"bg-[rgba(125,211,252,0.08)]":"bg-white/[0.02]"),children:m})]})})}function Ut({title:e,detail:a,children:l}){return t.jsxs("div",{className:"rounded-[20px] border border-cyan-300/20 bg-[linear-gradient(180deg,rgba(34,211,238,0.11),rgba(11,23,34,0.34))] p-2.5 shadow-[inset_0_0_0_1px_rgba(34,211,238,0.08)]",children:[t.jsx("div",{className:"mb-2 flex items-start justify-between gap-3 px-1",children:t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"inline-flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-cyan-100/86",children:[t.jsx(we,{className:"size-3.5"}),t.jsx("span",{className:"truncate",children:e})]}),a?t.jsx("div",{className:"mt-1 text-[11px] text-white/45",children:a}):null]})}),t.jsx("div",{className:"grid gap-2",children:l})]})}function Pt({droppableId:e,title:a,detail:l}){const{setNodeRef:o,isOver:c}=Te({id:e,data:{type:"trash"}});return t.jsx("div",{ref:o,className:W("pointer-events-auto fixed right-4 top-4 z-50 w-[min(18rem,calc(100vw-2rem))] rounded-[28px] border px-5 py-4 shadow-[0_24px_80px_rgba(6,10,20,0.48)] backdrop-blur-2xl transition lg:right-6 lg:top-6",c?"border-rose-300/38 bg-[linear-gradient(180deg,rgba(244,63,94,0.28),rgba(120,24,42,0.46))] text-white scale-[1.02]":"border-white/10 bg-[linear-gradient(180deg,rgba(18,24,38,0.96),rgba(10,14,24,0.94))] text-white/84"),"data-testid":"kanban-trash-dropzone","data-trash-hover":c?"true":"false",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:W("flex size-12 items-center justify-center rounded-full border transition",c?"border-white/28 bg-white/12":"border-white/12 bg-white/6"),children:t.jsx(ve,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.2em] text-white/55",children:"Bin"}),t.jsx("div",{className:"mt-1 text-base font-medium text-white",children:a}),t.jsx("div",{className:"mt-1 text-sm leading-5 text-white/62",children:l})]})]})})}function Jt({tasks:e,projects:a=[],activeRuns:l=[],goals:o,tags:c,selectedTaskId:u,onMove:m,onMoveProject:x,onSelectTask:h,onStartTask:j,onStopTask:D,onQuickReopenTask:k,onDeleteTask:I,onOpenProject:$,onOpenTask:U,onEditProject:B,onEditTask:M,onLinkProject:E,onLinkTask:G,onCreateIssueForProject:C,onCreateTaskForIssue:ee,onCreateSubtaskForTask:ne,onSplitTask:v,notesSummaryByEntity:z}){var $e,Be;const{t:b}=ye(),A=N.useId(),oe=`${A}:trash`,[L,ce]=N.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 1023px)").matches),te=jt(vt(_t,{activationConstraint:{distance:6}})),[P,J]=N.useState(null),[g,K]=N.useState(null),[V,Q]=N.useState(null),[X,f]=N.useState(null),[Ne,ct]=N.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("forge.kanban-skip-delete-confirmation")==="true"),[ke,se]=N.useState(!1),[Se,Z]=N.useState({}),[_e,ie]=N.useState({}),re={backlog:{title:b("common.executionBoard.laneBacklogTitle"),detail:b("common.executionBoard.laneBacklogDetail")},focus:{title:b("common.executionBoard.laneFocusTitle"),detail:b("common.executionBoard.laneFocusDetail")},in_progress:{title:b("common.executionBoard.laneProgressTitle"),detail:b("common.executionBoard.laneProgressDetail")},blocked:{title:b("common.executionBoard.laneBlockedTitle"),detail:b("common.executionBoard.laneBlockedDetail")},done:{title:b("common.executionBoard.laneDoneTitle"),detail:b("common.executionBoard.laneDoneDetail")}},F=N.useMemo(()=>e.map(i=>{const n=Se[i.id];return n?{...i,status:n}:i}),[Se,e]),Y=N.useMemo(()=>a.map(i=>{const n=_e[i.id];return n?{...i,workflowStatus:n}:i}),[_e,a]),Ie=N.useMemo(()=>{const i=new Map;for(const n of l){if(n.status!=="active")continue;const s=i.get(n.taskId);(!s||n.isCurrent||n.updatedAt>s.updatedAt)&&i.set(n.taskId,n)}return i},[l]),H=N.useMemo(()=>[...Y.map(i=>({kind:"project",id:i.id,status:i.workflowStatus,project:i,goal:o.find(n=>n.id===i.goalId)})),...F.map(i=>({kind:"task",id:i.id,status:i.status,task:i,goal:o.find(n=>n.id===i.goalId),tags:i.tagIds.map(n=>c.find(s=>s.id===n)).filter(Boolean),activeRun:Ie.get(i.id)??null}))],[Ie,Y,F,o,c]),O=P?H.find(i=>i.id===P)??null:null,dt=N.useMemo(()=>{if(!g)return[];if(g.kind==="project"){const n=Y.find(s=>s.id===g.entityId);return n?[{id:"open-project",label:"Open",description:"Jump to the project detail view.",icon:Ke,onSelect:()=>$==null?void 0:$(n.id)},{id:"edit-project",label:"Edit",description:"Open the guided project editor.",icon:Qe,onSelect:()=>B==null?void 0:B(n.id)},{id:"link-project",label:"Link",description:"Open the anchor step to relink the project to its goal.",icon:Xe,onSelect:()=>E==null?void 0:E(n.id)},{id:"create-issue",label:"Create issue",description:"Break this project into a new vertical slice issue.",icon:be,onSelect:()=>C==null?void 0:C(n.id)},..._.filter(s=>s!==n.workflowStatus).map(s=>({id:`move-project-${s}`,label:`Move to ${s.replaceAll("_"," ")}`,description:"Update the project workflow lane without leaving the board.",onSelect:()=>void(x==null?void 0:x(n.id,s))}))]:[]}const i=F.find(n=>n.id===g.entityId);return i?Bt({task:i,onOpenTask:U,onEditTask:M,onLinkTask:G,onCreateTaskForIssue:ee,onCreateSubtaskForTask:ne,onMove:m,onDeleteTask:I,deletePendingTaskId:X,onRequestDelete:De}):[]},[Y,F,g,C,ne,ee,B,M,E,G,m,x,I,$,U,X,Ne]);function Ce(i){var s;if(i.length===0)return t.jsx("div",{className:"w-full max-w-full rounded-[18px] border border-dashed border-white/8 px-4 py-8 text-center text-sm text-white/35",children:b("common.executionBoard.emptyLane")});if(((s=i[0])==null?void 0:s.status)!=="in_progress")return i.map(d=>d.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${d.task.id}`,task:d.task,goal:d.goal,tags:d.tags,activeRun:d.activeRun,isSelected:u===d.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},d.task.id):t.jsx(ge,{sortableId:`${A}:project:${d.project.id}`,project:d.project,goal:d.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},d.project.id));const n=new Map;for(const d of i){if(d.kind!=="task"||!d.activeRun){const R=n.get("ungrouped");R?R.items.push(d):n.set("ungrouped",{title:"Active work",detail:"Tasks in progress without a tracked branch",items:[d]});continue}const p=st(d.task,d.activeRun),r=[d.activeRun.actor,p.git.repository??"",p.git.branch??""].join("::"),w=n.get(r);if(w){w.items.push(d);continue}n.set(r,{title:Et(d.activeRun,p.git.branch),detail:Ot(d.activeRun,p.git.repository),items:[d]})}return Array.from(n.entries()).map(([d,p])=>d==="ungrouped"?p.items.map(r=>r.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${r.task.id}`,task:r.task,goal:r.goal,tags:r.tags,activeRun:r.activeRun,isSelected:u===r.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},r.task.id):t.jsx(ge,{sortableId:`${A}:project:${r.project.id}`,project:r.project,goal:r.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},r.project.id)):t.jsx(Ut,{title:p.title,detail:p.detail,children:p.items.map(r=>r.kind==="task"?t.jsx(fe,{sortableId:`${A}:task:${r.task.id}`,task:r.task,goal:r.goal,tags:r.tags,activeRun:r.activeRun,isSelected:u===r.task.id,isMobile:L,onSelect:h,onStartTask:j,onStopTask:D,onQuickReopen:k,onStepTask:de,onOpenMenu:me,onSplitTask:v,notesSummaryByEntity:z},r.task.id):t.jsx(ge,{sortableId:`${A}:project:${r.project.id}`,project:r.project,goal:r.goal,isMobile:L,onStepProject:ue,onOpenMenu:xe},r.project.id))},d))}N.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const i=window.matchMedia("(max-width: 1023px)"),n=s=>{ce(s?s.matches:i.matches)};return n(),typeof i.addEventListener=="function"?(i.addEventListener("change",n),()=>i.removeEventListener("change",n)):(i.addListener(n),()=>i.removeListener(n))},[]),N.useEffect(()=>{if(!P){document.body.style.cursor="";return}return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[P]),N.useEffect(()=>{Z(i=>{const n=new Set(e.map(p=>p.id));let s=!1;const d={};for(const[p,r]of Object.entries(i)){const w=e.find(R=>R.id===p);if(!n.has(p)||!w||w.status===r){s=!0;continue}d[p]=r}return s?d:i})},[e]),N.useEffect(()=>{ie(i=>{const n=new Set(a.map(p=>p.id));let s=!1;const d={};for(const[p,r]of Object.entries(i)){const w=a.find(R=>R.id===p);if(!n.has(p)||!w||w.workflowStatus===r){s=!0;continue}d[p]=r}return s?d:i})},[a]);function ut(i){var d,p;const n=(d=i.active.data.current)==null?void 0:d.taskId,s=(p=i.active.data.current)==null?void 0:p.projectId;typeof n=="string"?J(n):typeof s=="string"&&J(s)}const mt=i=>{ct(i),typeof window<"u"&&window.localStorage.setItem("forge.kanban-skip-delete-confirmation","true")},ze=async(i,n)=>{if(I){f(i.id);try{n&&mt(!0),await I(i.id),Q(null),se(!1),Z(s=>{const d={...s};return delete d[i.id],d})}finally{f(null)}}};function De(i){if(I){if(Ne){ze(i,!1);return}se(!1),Q(i)}}async function xt(i){var Me,Ae,Le,Re,Ee,Oe;const{active:n,over:s}=i;if(J(null),!s||n.id===s.id)return;const d=typeof((Me=n.data.current)==null?void 0:Me.taskId)=="string"?n.data.current.taskId:null,p=typeof((Ae=n.data.current)==null?void 0:Ae.projectId)=="string"?n.data.current.projectId:null,r=(d?H.find(y=>y.kind==="task"&&y.id===d):null)??(p?H.find(y=>y.kind==="project"&&y.id===p):null);if(!r)return;if(((Le=s.data.current)==null?void 0:Le.type)==="trash"){if(r.kind!=="task"||!I)return;De(r.task);return}const w=typeof((Re=s.data.current)==null?void 0:Re.status)=="string"?s.data.current.status:null,R=typeof((Ee=s.data.current)==null?void 0:Ee.taskId)=="string"?s.data.current.taskId:null,q=typeof((Oe=s.data.current)==null?void 0:Oe.projectId)=="string"?s.data.current.projectId:null,pe=(R?H.find(y=>y.kind==="task"&&y.id===R):null)??(q?H.find(y=>y.kind==="project"&&y.id===q):null),T=w??(pe==null?void 0:pe.status)??r.status;if(!(T===r.status||!_.includes(T))){if(r.kind==="task"){Z(y=>({...y,[r.task.id]:T}));try{await m(r.task.id,T)}catch(y){throw Z(he=>{const ae={...he};return delete ae[r.task.id],ae}),y}return}if(x){ie(y=>({...y,[r.project.id]:T}));try{await x(r.project.id,T)}catch(y){throw ie(he=>{const ae={...he};return delete ae[r.project.id],ae}),y}}}}async function de(i,n){const s=F.find(w=>w.id===i);if(!s)return;const d=_.indexOf(s.status),p=n==="previous"?d-1:d+1,r=_[p]??null;if(!(!r||r===s.status)){Z(w=>({...w,[s.id]:r}));try{await m(s.id,r)}catch(w){throw Z(R=>{const q={...R};return delete q[s.id],q}),w}}}async function ue(i,n){const s=Y.find(w=>w.id===i);if(!s||!x)return;const d=_.indexOf(s.workflowStatus),p=n==="previous"?d-1:d+1,r=_[p]??null;if(!(!r||r===s.workflowStatus)){ie(w=>({...w,[s.id]:r}));try{await x(s.id,r)}catch(w){throw ie(R=>{const q={...R};return delete q[s.id],q}),w}}}function me(i,n){const s=i.currentTarget.getBoundingClientRect();K({kind:"task",entityId:n.id,position:{x:s.right-8,y:s.bottom+8}})}function xe(i,n){const s=i.currentTarget.getBoundingClientRect();K({kind:"project",entityId:n.id,position:{x:s.right-8,y:s.bottom+8}})}return t.jsxs(yt,{sensors:te,collisionDetection:Rt,onDragStart:ut,onDragCancel:()=>J(null),onDragEnd:i=>void xt(i),children:[(O==null?void 0:O.kind)==="task"&&I?t.jsx(Pt,{droppableId:oe,title:b("common.executionBoard.deleteDropTitle"),detail:b("common.executionBoard.deleteDropDetail")}):null,t.jsx("div",{className:"w-full max-w-full min-w-0 pb-2",children:L?t.jsx("div",{className:"grid w-full max-w-full min-w-0 gap-2",children:_.map(i=>{const n=H.filter(s=>s.status===i);return t.jsx(Pe,{items:n.map(s=>`${A}:${s.kind}:${s.id}`),strategy:Ve,children:t.jsx(Je,{droppableId:`${A}:lane:${i}`,status:i,title:re[i].title,detail:re[i].detail,count:n.length,dragging:P!==null,children:Ce(n)})},i)})}):t.jsx("div",{className:"grid w-full min-w-0 gap-0.5 xl:grid-cols-[repeat(5,minmax(0,1fr))]",children:_.map(i=>{const n=H.filter(s=>s.status===i);return t.jsx(Pe,{items:n.map(s=>`${A}:${s.kind}:${s.id}`),strategy:Ve,children:t.jsx(Je,{droppableId:`${A}:lane:${i}`,status:i,title:re[i].title,detail:re[i].detail,count:n.length,dragging:P!==null,children:Ce(n)})},i)})})}),t.jsx(Nt,{adjustScale:!1,dropAnimation:null,children:O?t.jsx("div",{className:"w-[20rem] max-w-[calc(100vw-2rem)]",children:O.kind==="task"?t.jsx(lt,{task:O.task,goal:O.goal,tags:O.tags,activeRun:O.activeRun,isSelected:u===O.task.id,isDragging:!0,isOverlay:!0,isMobile:L,onSelect:()=>{},onStartTask:j,onSplitTask:v,notesSummaryByEntity:z}):t.jsx(ot,{project:O.project,goal:O.goal,isDragging:!0,isOverlay:!0,isMobile:L})}):null}),t.jsx(zt,{open:g!==null,title:(g==null?void 0:g.kind)==="project"?(($e=Y.find(i=>i.id===g.entityId))==null?void 0:$e.title)??"Project actions":((Be=F.find(i=>i.id===(g==null?void 0:g.entityId)))==null?void 0:Be.title)??"Work item actions",subtitle:(g==null?void 0:g.kind)==="project"?"Edit, relink, move, or break this project into issues.":"Edit, relink, move, or create the next child work item.",items:dt,position:(g==null?void 0:g.position)??null,onClose:()=>K(null)}),V?t.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-[rgba(5,8,18,0.74)] p-4 backdrop-blur-xl",children:t.jsxs(it,{className:"w-full max-w-md border border-white/10 bg-[linear-gradient(180deg,rgba(16,22,36,0.96),rgba(9,13,22,0.98))] shadow-[0_32px_90px_rgba(5,8,18,0.58)]",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("div",{className:"mt-1 flex size-11 shrink-0 items-center justify-center rounded-full bg-rose-500/14 text-rose-100",children:t.jsx(ve,{className:"size-5"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"font-display text-[1.35rem] leading-tight text-white",children:b("common.executionBoard.deleteConfirmTitle")}),t.jsx("div",{className:"mt-2 text-sm leading-6 text-white/64",children:b("common.executionBoard.deleteConfirmDescription",{title:V.title})})]})]}),t.jsxs("label",{className:"mt-5 flex items-center gap-3 rounded-[18px] bg-white/[0.05] px-4 py-3 text-sm text-white/76",children:[t.jsx("input",{type:"checkbox",checked:ke,onChange:i=>se(i.target.checked),className:"size-4 rounded border-white/20 bg-transparent text-[var(--primary)]"}),t.jsx("span",{children:b("common.executionBoard.deleteConfirmCheckbox")})]}),t.jsxs("div",{className:"mt-5 flex flex-wrap justify-end gap-3",children:[t.jsx(qe,{variant:"secondary",onClick:()=>{Q(null),se(!1)},children:b("common.executionBoard.deleteConfirmCancel")}),t.jsx(qe,{className:"bg-[linear-gradient(135deg,rgba(251,113,133,0.3),rgba(190,24,93,0.26))] text-white shadow-[0_16px_36px_rgba(190,24,93,0.18)]",pending:X===V.id,pendingLabel:b("common.executionBoard.deletingTask"),onClick:()=>void ze(V,ke),children:b("common.executionBoard.deleteConfirmSubmit")})]})]})}):null]})}export{Jt as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as w,j as t,aK as D,b3 as _}from"./vendor-DHkYh85p.js";import{Z as r}from"./index-
|
|
1
|
+
import{r as w,j as t,aK as D,b3 as _}from"./vendor-DHkYh85p.js";import{Z as r}from"./index-CF4J4R9L.js";function B(o){return o.trim().toLowerCase()}function A({title:o,description:m,query:x,onQueryChange:b,onQuerySubmit:f,options:p,selectedOptionIds:i,onSelectedOptionIdsChange:c,resultSummary:M,clearLabel:j="Clear filters",submitLabel:v="Search",placeholder:E="Search title, alias, domain, source, or filter chip",emptyStateMessage:C="Keep typing to search the library or pick one of the suggested filter chips.",compact:l=!1,minimal:a=!1,hideSummary:F=!1}){const[$,n]=w.useState(!1),[g,d]=w.useState(0),N=w.useMemo(()=>i.map(e=>p.find(s=>s.id===e)).filter(Boolean),[p,i]),u=w.useMemo(()=>{const e=B(x),s=p.filter(h=>!i.includes(h.id));return e?s.filter(h=>`${h.label} ${h.description??""} ${h.searchText??""}`.toLowerCase().includes(e)).slice(0,12):s.slice(0,12)},[p,x,i]),y=e=>{i.includes(e)||(c([...i,e]),b(""),n(!1),d(0))},k=e=>{c(i.filter(s=>s!==e))},z=()=>{b(""),c([]),d(0),n(!1)};return t.jsxs("div",{className:r("rounded-[28px] border border-white/8 bg-[linear-gradient(135deg,rgba(19,30,42,0.92),rgba(9,15,24,0.98))] shadow-[0_30px_80px_rgba(3,8,18,0.28)]",a?"overflow-hidden rounded-full border-white/10 bg-[rgba(8,12,20,0.82)] px-3 py-1.5 shadow-[0_18px_50px_rgba(0,0,0,0.26)] backdrop-blur":l?"rounded-[24px] p-2.5":"p-4 sm:p-5"),children:[t.jsxs("div",{className:r("flex flex-wrap items-start justify-between gap-3",a&&"hidden"),children:[t.jsxs("div",{children:[o.trim().length>0?t.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.2em] text-white/42",children:o}):null,m.trim().length>0?t.jsx("div",{className:"mt-2 max-w-3xl text-sm leading-6 text-white/62",children:m}):null]}),i.length>0||x.trim().length>0?t.jsx("button",{type:"button",onClick:z,className:r("rounded-full border border-white/8 bg-white/[0.04] text-white/62 transition hover:bg-white/[0.08] hover:text-white",l?"px-2.5 py-1.5 text-[11px]":"px-3 py-2 text-sm"),children:j}):null]}),t.jsxs("div",{className:r("rounded-[24px] border border-white/8 bg-white/[0.04]",a?"rounded-full border-0 bg-transparent px-0 py-0":l?"mt-1.5 rounded-[18px] px-2.5 py-2":"mt-4 px-4 py-3"),children:[N.length>0?t.jsx("div",{className:r("flex flex-wrap gap-2",a?"mb-0 mr-2 inline-flex max-w-[38%] flex-nowrap items-center gap-1 overflow-hidden":l?"mb-2":"mb-3"),children:N.map(e=>t.jsxs("span",{className:r("inline-flex items-center gap-2 rounded-full border border-white/8 bg-white/[0.06]",a?"max-w-full shrink-0 border-white/10 bg-white/[0.08] px-2 py-0.5":l?"px-2 py-0.5":"px-2.5 py-1.5"),children:[e.badge??t.jsx("span",{className:"text-sm text-white/78",children:e.label}),t.jsx("button",{type:"button",className:"rounded-full text-white/52 transition hover:text-white",onClick:()=>k(e.id),"aria-label":`Remove ${e.label}`,children:t.jsx(D,{className:"size-3.5"})})]},e.id))}):null,t.jsxs("div",{className:"relative",children:[t.jsxs("div",{className:r("flex items-center",a?"gap-2 whitespace-nowrap":l?"gap-2":"gap-3"),children:[t.jsx(_,{className:r("text-white/36",l?"size-3.5":"size-4")}),t.jsx("input",{value:x,onChange:e=>{b(e.target.value),n(!0),d(0)},onFocus:()=>n(!0),onBlur:()=>window.setTimeout(()=>n(!1),120),onKeyDown:e=>{if(e.key==="Backspace"&&!x&&i.length>0){k(i[i.length-1]);return}if(e.key==="ArrowDown"){e.preventDefault(),n(!0),d(s=>u.length===0?0:Math.min(u.length-1,s+1));return}if(e.key==="ArrowUp"){e.preventDefault(),d(s=>Math.max(0,s-1));return}if(e.key==="Escape"){n(!1);return}if(e.key==="Enter"&&f){e.preventDefault(),f(x),n(!1);return}e.key==="Enter"&&u[g]&&(e.preventDefault(),y(u[g].id))},placeholder:E,className:r("min-w-0 flex-1 bg-transparent text-white placeholder:text-white/34 focus:outline-none",a||l?"text-[12px]":"text-sm")}),a&&(i.length>0||x.trim().length>0)?t.jsx("button",{type:"button",onClick:z,className:"inline-flex size-6 items-center justify-center rounded-full border border-white/10 bg-white/[0.06] text-white/62 transition hover:text-white","aria-label":j,children:t.jsx(D,{className:"size-3.5"})}):null,f?t.jsx("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>{f(x),n(!1)},className:r("inline-flex items-center justify-center rounded-full border border-white/10 bg-white/[0.08] text-white/72 transition hover:bg-white/[0.14] hover:text-white",a?"size-6":l?"size-7":"size-8"),"aria-label":v,title:v,children:t.jsx(_,{className:r(l?"size-3.5":"size-4")})}):null]}),$?t.jsx("div",{className:r("absolute top-full z-20 w-full border border-white/8 bg-[rgba(8,13,24,0.96)] shadow-[0_26px_60px_rgba(4,8,18,0.32)] backdrop-blur-xl",l?"mt-1.5 rounded-[18px] p-1.5":"mt-2 rounded-[22px] p-2"),children:u.length>0?u.map((e,s)=>t.jsx("button",{type:"button",className:r("flex w-full items-start justify-between gap-3 text-left transition",l?"rounded-[14px] px-2.5 py-2":"rounded-[18px] px-3 py-2.5",s===g?"bg-white/[0.1] text-white":"text-white/70 hover:bg-white/[0.06] hover:text-white"),onMouseEnter:()=>d(s),onMouseDown:h=>h.preventDefault(),onClick:()=>y(e.id),children:t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:r("truncate font-medium",l?"text-[12px]":"text-sm"),children:e.badge??e.label}),e.description?t.jsx("div",{className:r("mt-1 text-white/46",l?"text-[11px] leading-[1.125rem]":"text-xs leading-5"),children:e.description}):null]})},e.id)):t.jsx("div",{className:r("text-white/42",l?"px-2.5 py-2 text-[12px]":"px-3 py-2.5 text-sm"),children:C})}):null]})]}),F?null:t.jsx("div",{className:r("text-white/52",l?"mt-2 text-xs":"mt-3 text-sm"),children:M})]})}export{A as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aC as l,b8 as b}from"./vendor-DHkYh85p.js";import{Z as i,c as m}from"./index-
|
|
1
|
+
import{j as e,aC as l,b8 as b}from"./vendor-DHkYh85p.js";import{Z as i,c as m}from"./index-CF4J4R9L.js";import{m as h}from"./motion-BeD44FeG.js";function f({eyebrow:n,title:g,description:c,items:t,tone:a="core",className:x}){return e.jsxs("section",{className:i("min-w-0 overflow-hidden rounded-[28px] border border-white/6 shadow-[0_20px_54px_rgba(4,8,18,0.24)]",a==="core"?"bg-[linear-gradient(180deg,rgba(22,28,46,0.98),rgba(12,17,30,0.95))]":"bg-[linear-gradient(180deg,rgba(16,29,33,0.98),rgba(12,22,27,0.95))]",x),children:[e.jsxs("div",{className:i("grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,26rem)] lg:px-5",a==="core"?"bg-[radial-gradient(circle_at_top_right,rgba(192,193,255,0.12),transparent_36%),linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]":"bg-[radial-gradient(circle_at_top_right,rgba(110,231,183,0.1),transparent_36%),linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0))]"),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:i("font-label text-[11px] uppercase tracking-[0.2em]",a==="core"?"text-[var(--secondary)]":"text-[rgba(110,231,183,0.82)]"),children:n}),e.jsx("h2",{className:"mt-2 max-w-3xl font-display text-[clamp(1.35rem,2vw,1.9rem)] leading-none text-white",children:g}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-white/60",children:c})]}),e.jsx("div",{className:"grid min-w-0 gap-2 sm:grid-cols-3",children:t.slice(0,3).map(r=>r.href?e.jsxs(l,{to:r.href,className:i("min-w-0 rounded-[20px] border border-white/6 px-3 py-3 backdrop-blur-sm transition hover:bg-white/[0.08]",a==="core"?"bg-[linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.025))]":"bg-[linear-gradient(180deg,rgba(110,231,183,0.08),rgba(255,255,255,0.02))]"),children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:r.label}),e.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-white",children:r.title})]},r.id):e.jsxs("div",{className:i("min-w-0 rounded-[20px] border border-white/6 px-3 py-3 backdrop-blur-sm",a==="core"?"bg-[linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.025))]":"bg-[linear-gradient(180deg,rgba(110,231,183,0.08),rgba(255,255,255,0.02))]"),children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:r.label}),e.jsx("div",{className:"mt-1.5 min-w-0 font-medium text-white",children:r.title})]},r.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-3 px-4 py-4 lg:grid-cols-2 lg:px-5",children:t.map((r,o)=>{const s=i("group flex min-h-[13.5rem] min-w-0 flex-col overflow-hidden rounded-[24px] border border-white/7 p-0 transition hover:-translate-y-0.5 hover:shadow-[0_22px_46px_rgba(3,8,18,0.28)] sm:min-h-[15.5rem]",a==="core"?"bg-[linear-gradient(180deg,rgba(19,26,42,0.98),rgba(11,16,28,0.96))] hover:border-white/12 hover:bg-[linear-gradient(180deg,rgba(24,31,50,0.98),rgba(13,19,33,0.97))]":"bg-[linear-gradient(180deg,rgba(17,29,32,0.98),rgba(9,18,22,0.97))] hover:border-white/12 hover:bg-[linear-gradient(180deg,rgba(21,36,40,0.98),rgba(11,22,27,0.97))]"),d=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:i("flex min-w-0 flex-1 flex-col p-4",a==="core"?"bg-[radial-gradient(circle_at_top_left,rgba(192,193,255,0.1),transparent_28%),linear-gradient(180deg,rgba(255,255,255,0.025),rgba(255,255,255,0))]":"bg-[radial-gradient(circle_at_top_left,rgba(110,231,183,0.08),transparent_28%),linear-gradient(180deg,rgba(255,255,255,0.025),rgba(255,255,255,0))]"),children:[e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:r.label}),e.jsx("div",{className:"mt-2.5 min-w-0 font-display text-[1.25rem] leading-tight text-white sm:text-[1.4rem]",children:r.title})]}),r.badge?e.jsx(m,{wrap:!0,className:"max-w-[10rem] shrink-0 self-start bg-white/[0.08] text-white/72",children:r.badge}):null]}),e.jsx("div",{className:"mt-2.5 text-sm leading-6 text-white/60",children:r.detail}),e.jsx("div",{className:"flex-1"})]}),r.href?e.jsx("div",{className:"border-t border-white/6 bg-[linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01))] px-4 py-3",children:e.jsxs("div",{className:"inline-flex min-h-10 min-w-0 max-w-full items-center gap-2 rounded-full border border-white/8 bg-white/[0.05] px-4 text-sm text-white/68 transition group-hover:border-white/14 group-hover:bg-white/[0.08] group-hover:text-white",children:[r.actionLabel??"Open",e.jsx(b,{className:"size-3.5"})]})}):null]});return e.jsx(h.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.22,delay:.04*o,ease:"easeOut"},children:r.href?e.jsx(l,{to:r.href,className:s,children:d}):e.jsx("div",{className:s,children:d})},r.id)})})]})}export{f as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as h,o as m,j as t,aK as p}from"./vendor-DHkYh85p.js";import{Z as l}from"./index-
|
|
1
|
+
import{r as h,o as m,j as t,aK as p}from"./vendor-DHkYh85p.js";import{Z as l}from"./index-CF4J4R9L.js";function f({open:s,title:c,subtitle:a,items:x,position:i,onClose:n}){return h.useEffect(()=>{if(!s)return;let e=!1;const r=window.setTimeout(()=>{e=!0},0),o=w=>{w.key==="Escape"&&n()},d=()=>{e&&n()};return window.addEventListener("keydown",o),window.addEventListener("pointerdown",d),()=>{window.clearTimeout(r),window.removeEventListener("keydown",o),window.removeEventListener("pointerdown",d)}},[n,s]),!s||!i||typeof document>"u"?null:m.createPortal(t.jsx("div",{className:"fixed inset-0 z-[70]","aria-hidden":"true",children:t.jsxs("div",{className:"fixed z-[71] flex max-h-[min(34rem,calc(100dvh-1.5rem))] w-[min(22rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-[26px] border border-white/10 bg-[rgba(10,15,27,0.97)] p-2 shadow-[0_28px_80px_rgba(4,8,18,0.4)] backdrop-blur-xl",style:{left:Math.min(i.x,window.innerWidth-24-352),top:Math.min(i.y,window.innerHeight-24-544)},onPointerDown:e=>e.stopPropagation(),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-[20px] bg-white/[0.03] px-4 py-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-white",children:c}),a?t.jsx("div",{className:"mt-1 text-xs leading-5 text-white/50",children:a}):null]}),t.jsx("button",{type:"button",className:"rounded-full bg-white/[0.04] p-2 text-white/55 transition hover:bg-white/[0.08] hover:text-white",onClick:n,children:t.jsx(p,{className:"size-4"})})]}),t.jsx("div",{className:"mt-2 min-h-0 overflow-y-auto overscroll-contain pr-1",children:t.jsx("div",{className:"grid gap-1",children:x.map(e=>{const r=e.icon;return t.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>{e.disabled||(e.onSelect(),n())},className:l("flex w-full items-start gap-3 rounded-[20px] px-4 py-3 text-left transition",e.disabled?"cursor-not-allowed bg-white/[0.02] text-white/28":e.tone==="danger"?"bg-rose-400/[0.05] text-rose-100 hover:bg-rose-400/[0.12]":"bg-white/[0.03] text-white/76 hover:bg-white/[0.08] hover:text-white"),children:[r?t.jsx("span",{className:l("mt-0.5 rounded-[14px] p-2",e.disabled?"bg-white/[0.03] text-white/28":e.tone==="danger"?"bg-rose-400/[0.12] text-rose-100":"bg-[var(--primary)]/12 text-[var(--primary)]"),children:t.jsx(r,{className:"size-4"})}):null,t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:"block text-sm font-medium",children:e.label}),e.description?t.jsx("span",{className:"mt-1 block text-xs leading-5 text-white/48",children:e.description}):null]})]},e.id)})})})]})}),document.body)}export{f as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cc as F,b5 as q,r as o,j as e,aC as p}from"./vendor-DHkYh85p.js";import{j as A,k as H}from"./state-B-4sS1xO.js";import{P as L,u as z,s as K,i as Q,R as $,a as X,V as T,U as C,B as g,C as v,b as w,c as h,W as _,X as V,Y as W}from"./index-BHTUu_4M.js";import{O as Y}from"./open-in-graph-button-Cg5VrKsC.js";import{N as J}from"./note-markdown-DiW2-5d3.js";import{E as Z}from"./entity-notes-surface-DgEgicaE.js";import{P as ee}from"./preference-entity-handoff-button-D4WAs9pC.js";import{b as te,f as se,P as ae}from"./project-collections-DvaX20q_.js";import{P as ie}from"./page-hero-CQWo1Mm_.js";import{g as le,a as ne}from"./activity-copy-Bj4h9OcF.js";import{g as oe}from"./entity-links-DwpxhW2H.js";import"./board-BkDRaMp6.js";import"./ui-C13Nbgas.js";import"./motion-BeD44FeG.js";import"./forms-BFlTgZ3W.js";import"./graph-D6JLqDbD.js";import"./note-tags-input-DDLXf54U.js";function ke(){const{t:s}=L(),i=z(),d=F(),G=q(),u=A(),[O,N]=o.useState(!1),[S,y]=o.useState(!1),[m,B]=o.useState("active"),j=K(i.selectedUserIds),[E,b]=o.useState(null),D=H({mutationFn:()=>$(d.goalId),onSuccess:async()=>{await Promise.all([Q(u),u.invalidateQueries({queryKey:["project-board"]}),u.invalidateQueries({queryKey:["task-context"]})]),G("/goals")}}),a=i.snapshot.dashboard.goals.find(t=>t.id===d.goalId)??null,x=o.useMemo(()=>i.snapshot.dashboard.projects.filter(t=>t.goalId===d.goalId),[d.goalId,i.snapshot.dashboard.projects]),R=o.useMemo(()=>te(x),[x]),n=o.useMemo(()=>se(x,m),[x,m]),k=new Set(x.map(t=>t.id)),I=new Set(i.snapshot.tasks.filter(t=>k.has(t.projectId??"")).map(t=>t.id)),f=i.snapshot.activity.filter(t=>t.entityId===d.goalId||k.has(t.entityId)||I.has(t.entityId)||t.entityType==="task_run"&&typeof t.metadata.taskId=="string"&&I.has(t.metadata.taskId));if(!a)return e.jsx(X,{eyebrow:s("common.goalDetail.eyebrow"),title:s("common.goalDetail.missingTitle"),description:s("common.goalDetail.missingDescription"),action:e.jsx(p,{to:"/goals",className:"inline-flex min-h-10 min-w-0 max-w-full items-center justify-center whitespace-nowrap rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-slate-950 transition hover:opacity-90",children:s("common.goalDetail.backToGoals")})});const l=n.find(t=>t.nextTaskTitle)??n[0]??null,r=i.snapshot.overview.neglectedGoals.find(t=>t.goalId===a.id)??null,c=f[0]??null,M=async t=>{b(t);try{await i.patchProject(t,{status:"active"})}finally{b(null)}},U=async()=>{window.confirm(s("common.goalDetail.deleteGoalConfirm",{title:a.title}))&&await D.mutateAsync()};return e.jsxs("div",{className:"grid min-w-0 gap-5",children:[e.jsx(ie,{entityKind:"goal",title:e.jsx(T,{kind:"goal",label:a.title,variant:"heading",size:"lg"}),titleText:a.title,description:a.description?e.jsx(J,{markdown:a.description,className:"[&>p]:text-[13px] [&>p]:leading-6 [&>blockquote]:text-[13px] [&>ul]:text-[13px] [&>ol]:text-[13px]"}):"No strategic description yet.",badge:s(n.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:n.length}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(ee,{userId:j,domain:"projects",entityType:"goal",entityId:a.id,label:a.title,description:a.description}),e.jsx(Y,{entityType:"goal",entityId:a.id})]})}),a.user?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-white/62",children:[e.jsx("span",{className:"text-white/42",children:"Owned by"}),e.jsx(C,{user:a.user})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(g,{onClick:()=>N(!0),children:s("common.goalDetail.edit")}),e.jsx(g,{variant:"secondary",onClick:()=>y(!0),children:s("common.goalDetail.addProject")}),e.jsx(g,{variant:"ghost",className:"text-rose-200 hover:bg-rose-500/10",pending:D.isPending,pendingLabel:s("common.goalDetail.deleting"),onClick:()=>void U(),children:s("common.goalDetail.deleteGoal")})]}),e.jsxs("section",{className:"grid min-w-0 gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionProjects")}),e.jsx(ae,{value:m,counts:R,onChange:B,className:"justify-end"})]}),n.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/58",children:m==="active"?s("common.goalDetail.noProjects"):"No projects match this lifecycle filter yet. Switch filters or restart one to make it active again."}):e.jsx("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:n.map(t=>e.jsxs("div",{className:"rounded-[22px] bg-white/[0.04] p-5 transition hover:bg-white/[0.08]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(w,{kind:"project",compact:!0,gradient:!1}),t.user?e.jsx(C,{user:t.user,compact:!0}):null]}),e.jsx(h,{children:t.status})]}),e.jsx("div",{className:"mt-4",children:e.jsx(p,{to:`/projects/${t.id}`,className:"transition hover:opacity-90",children:e.jsx(T,{kind:"project",label:t.title,variant:"heading",size:"lg"})})}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-white/58",children:t.description}),e.jsx("div",{className:"mt-4",children:e.jsx(_,{value:t.progress})}),e.jsx("div",{className:"mt-4 text-[11px] uppercase tracking-[0.16em] text-white/40",children:t.nextTaskTitle?s("common.goalDetail.nextMove",{value:t.nextTaskTitle}):s("common.goalDetail.addNextTask")}),e.jsxs("div",{className:"mt-4 flex flex-wrap justify-between gap-3",children:[e.jsx(p,{to:`/projects/${t.id}`,children:e.jsx(g,{variant:"ghost",children:"Open project"})}),m!=="active"&&t.status!=="active"?e.jsx(g,{variant:"secondary",size:"sm",pending:E===t.id,pendingLabel:"Restarting…",onClick:()=>void M(t.id),children:"Restart"}):null]})]},t.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-5",children:e.jsxs(v,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionHealth")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(w,{kind:"goal",compact:!0,gradient:!1}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s("common.goalDetail.progressTitle",{progress:a.progress,count:a.completedTasks})}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s("common.goalDetail.progressDetail",{xp:a.earnedPoints})}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s(n.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:n.length})})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldProgress")}),e.jsxs("div",{className:"mt-2 font-display text-xl text-white",children:[a.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldCompletedTasks")}),e.jsx("div",{className:"mt-2 font-display text-xl text-white",children:a.completedTasks})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldXpBanked")}),e.jsx("div",{className:"mt-2 font-display text-xl text-white",children:a.earnedPoints})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalNext")}),l?e.jsx(w,{kind:"project",compact:!0,gradient:!1}):null]}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(l==null?void 0:l.title)??s("common.goalDetail.noProject")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:l!=null&&l.nextTaskTitle?s("common.goalDetail.nextMove",{value:l.nextTaskTitle}):(l==null?void 0:l.description)||s("common.goalDetail.noProjectDetail")})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalRisk")}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(r==null?void 0:r.title)??s("common.goalDetail.noRisk")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:(r==null?void 0:r.summary)||s("common.goalDetail.noRiskDetail")})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalEvidence")}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(c==null?void 0:c.title)??s("common.goalDetail.noEvidence")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:(c==null?void 0:c.description)||s("common.goalDetail.noEvidenceDetail")})]})]})]})]})})]}),e.jsx(Z,{entityType:"goal",entityId:a.id,title:"Goal notes",description:"Use notes to capture strategy changes, meaning shifts, and progress context that belongs at the goal level."}),e.jsxs(v,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionEvidence")}),f.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/58",children:s("common.goalDetail.noEvidenceLogged")}):e.jsx("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:f.slice(0,6).map(t=>e.jsxs(p,{to:oe(t)??`/activity?eventId=${t.id}`,className:"rounded-[18px] bg-white/[0.04] p-4 transition hover:bg-white/[0.08]",children:[e.jsx("div",{className:"font-medium text-white",children:le(t)}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:ne(t)})]},t.id))})]}),e.jsx(V,{open:O,editingGoal:a,tags:i.snapshot.tags,users:i.snapshot.users,defaultUserId:a.userId??j,onOpenChange:N,onSubmit:async(t,P)=>{P&&await i.patchGoal(P,t)}}),e.jsx(W,{open:S,goals:i.snapshot.goals,users:i.snapshot.users,editingProject:null,initialGoalId:a.id,defaultUserId:a.userId??j,onOpenChange:y,onSubmit:async t=>{await i.createProject(t)}})]})}export{ke as GoalDetailPage};
|
|
1
|
+
import{cc as F,b5 as q,r as o,j as e,aC as p}from"./vendor-DHkYh85p.js";import{j as A,k as H}from"./state-B-4sS1xO.js";import{P as L,u as z,s as K,i as Q,R as $,a as X,V as T,U as C,B as g,C as v,b as w,c as h,W as _,X as V,Y as W}from"./index-CF4J4R9L.js";import{O as Y}from"./open-in-graph-button-IXe9SGth.js";import{N as J}from"./note-markdown-N-uxD3Xt.js";import{E as Z}from"./entity-notes-surface-CkcRsKJQ.js";import{P as ee}from"./preference-entity-handoff-button-5PzUn42S.js";import{b as te,f as se,P as ae}from"./project-collections-xPz2mlRr.js";import{P as ie}from"./page-hero-DRy5b2MU.js";import{g as le,a as ne}from"./activity-copy-Bj4h9OcF.js";import{g as oe}from"./entity-links-DwpxhW2H.js";import"./board-BkDRaMp6.js";import"./ui-C13Nbgas.js";import"./motion-BeD44FeG.js";import"./forms-BFlTgZ3W.js";import"./graph-D6JLqDbD.js";import"./note-tags-input-Cdu7wiw6.js";function ke(){const{t:s}=L(),i=z(),d=F(),G=q(),u=A(),[O,N]=o.useState(!1),[S,y]=o.useState(!1),[m,B]=o.useState("active"),j=K(i.selectedUserIds),[E,b]=o.useState(null),D=H({mutationFn:()=>$(d.goalId),onSuccess:async()=>{await Promise.all([Q(u),u.invalidateQueries({queryKey:["project-board"]}),u.invalidateQueries({queryKey:["task-context"]})]),G("/goals")}}),a=i.snapshot.dashboard.goals.find(t=>t.id===d.goalId)??null,x=o.useMemo(()=>i.snapshot.dashboard.projects.filter(t=>t.goalId===d.goalId),[d.goalId,i.snapshot.dashboard.projects]),R=o.useMemo(()=>te(x),[x]),n=o.useMemo(()=>se(x,m),[x,m]),k=new Set(x.map(t=>t.id)),I=new Set(i.snapshot.tasks.filter(t=>k.has(t.projectId??"")).map(t=>t.id)),f=i.snapshot.activity.filter(t=>t.entityId===d.goalId||k.has(t.entityId)||I.has(t.entityId)||t.entityType==="task_run"&&typeof t.metadata.taskId=="string"&&I.has(t.metadata.taskId));if(!a)return e.jsx(X,{eyebrow:s("common.goalDetail.eyebrow"),title:s("common.goalDetail.missingTitle"),description:s("common.goalDetail.missingDescription"),action:e.jsx(p,{to:"/goals",className:"inline-flex min-h-10 min-w-0 max-w-full items-center justify-center whitespace-nowrap rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-slate-950 transition hover:opacity-90",children:s("common.goalDetail.backToGoals")})});const l=n.find(t=>t.nextTaskTitle)??n[0]??null,r=i.snapshot.overview.neglectedGoals.find(t=>t.goalId===a.id)??null,c=f[0]??null,M=async t=>{b(t);try{await i.patchProject(t,{status:"active"})}finally{b(null)}},U=async()=>{window.confirm(s("common.goalDetail.deleteGoalConfirm",{title:a.title}))&&await D.mutateAsync()};return e.jsxs("div",{className:"grid min-w-0 gap-5",children:[e.jsx(ie,{entityKind:"goal",title:e.jsx(T,{kind:"goal",label:a.title,variant:"heading",size:"lg"}),titleText:a.title,description:a.description?e.jsx(J,{markdown:a.description,className:"[&>p]:text-[13px] [&>p]:leading-6 [&>blockquote]:text-[13px] [&>ul]:text-[13px] [&>ol]:text-[13px]"}):"No strategic description yet.",badge:s(n.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:n.length}),actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(ee,{userId:j,domain:"projects",entityType:"goal",entityId:a.id,label:a.title,description:a.description}),e.jsx(Y,{entityType:"goal",entityId:a.id})]})}),a.user?e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-white/62",children:[e.jsx("span",{className:"text-white/42",children:"Owned by"}),e.jsx(C,{user:a.user})]}):null,e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(g,{onClick:()=>N(!0),children:s("common.goalDetail.edit")}),e.jsx(g,{variant:"secondary",onClick:()=>y(!0),children:s("common.goalDetail.addProject")}),e.jsx(g,{variant:"ghost",className:"text-rose-200 hover:bg-rose-500/10",pending:D.isPending,pendingLabel:s("common.goalDetail.deleting"),onClick:()=>void U(),children:s("common.goalDetail.deleteGoal")})]}),e.jsxs("section",{className:"grid min-w-0 gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]",children:[e.jsxs(v,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionProjects")}),e.jsx(ae,{value:m,counts:R,onChange:B,className:"justify-end"})]}),n.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/58",children:m==="active"?s("common.goalDetail.noProjects"):"No projects match this lifecycle filter yet. Switch filters or restart one to make it active again."}):e.jsx("div",{className:"mt-4 grid gap-4 lg:grid-cols-2",children:n.map(t=>e.jsxs("div",{className:"rounded-[22px] bg-white/[0.04] p-5 transition hover:bg-white/[0.08]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(w,{kind:"project",compact:!0,gradient:!1}),t.user?e.jsx(C,{user:t.user,compact:!0}):null]}),e.jsx(h,{children:t.status})]}),e.jsx("div",{className:"mt-4",children:e.jsx(p,{to:`/projects/${t.id}`,className:"transition hover:opacity-90",children:e.jsx(T,{kind:"project",label:t.title,variant:"heading",size:"lg"})})}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-white/58",children:t.description}),e.jsx("div",{className:"mt-4",children:e.jsx(_,{value:t.progress})}),e.jsx("div",{className:"mt-4 text-[11px] uppercase tracking-[0.16em] text-white/40",children:t.nextTaskTitle?s("common.goalDetail.nextMove",{value:t.nextTaskTitle}):s("common.goalDetail.addNextTask")}),e.jsxs("div",{className:"mt-4 flex flex-wrap justify-between gap-3",children:[e.jsx(p,{to:`/projects/${t.id}`,children:e.jsx(g,{variant:"ghost",children:"Open project"})}),m!=="active"&&t.status!=="active"?e.jsx(g,{variant:"secondary",size:"sm",pending:E===t.id,pendingLabel:"Restarting…",onClick:()=>void M(t.id),children:"Restart"}):null]})]},t.id))})]}),e.jsx("div",{className:"grid min-w-0 gap-5",children:e.jsxs(v,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionHealth")}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(w,{kind:"goal",compact:!0,gradient:!1}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s("common.goalDetail.progressTitle",{progress:a.progress,count:a.completedTasks})}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s("common.goalDetail.progressDetail",{xp:a.earnedPoints})}),e.jsx(h,{className:"bg-white/[0.08] text-white/72",children:s(n.length===1?"common.goalDetail.heroBadgeOne":"common.goalDetail.heroBadgeOther",{count:n.length})})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldProgress")}),e.jsxs("div",{className:"mt-2 font-display text-xl text-white",children:[a.progress,"%"]})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldCompletedTasks")}),e.jsx("div",{className:"mt-2 font-display text-xl text-white",children:a.completedTasks})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] px-4 py-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/42",children:s("common.goalDetail.fieldXpBanked")}),e.jsx("div",{className:"mt-2 font-display text-xl text-white",children:a.earnedPoints})]})]}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalNext")}),l?e.jsx(w,{kind:"project",compact:!0,gradient:!1}):null]}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(l==null?void 0:l.title)??s("common.goalDetail.noProject")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:l!=null&&l.nextTaskTitle?s("common.goalDetail.nextMove",{value:l.nextTaskTitle}):(l==null?void 0:l.description)||s("common.goalDetail.noProjectDetail")})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalRisk")}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(r==null?void 0:r.title)??s("common.goalDetail.noRisk")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:(r==null?void 0:r.summary)||s("common.goalDetail.noRiskDetail")})]}),e.jsxs("div",{className:"rounded-[18px] bg-white/[0.04] p-4",children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/42",children:s("common.goalDetail.signalEvidence")}),e.jsx("div",{className:"mt-2 font-medium text-white",children:(c==null?void 0:c.title)??s("common.goalDetail.noEvidence")}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:(c==null?void 0:c.description)||s("common.goalDetail.noEvidenceDetail")})]})]})]})]})})]}),e.jsx(Z,{entityType:"goal",entityId:a.id,title:"Goal notes",description:"Use notes to capture strategy changes, meaning shifts, and progress context that belongs at the goal level."}),e.jsxs(v,{children:[e.jsx("div",{className:"font-label text-[11px] uppercase tracking-[0.18em] text-white/45",children:s("common.goalDetail.sectionEvidence")}),f.length===0?e.jsx("div",{className:"mt-4 rounded-[20px] bg-white/[0.04] p-4 text-sm text-white/58",children:s("common.goalDetail.noEvidenceLogged")}):e.jsx("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:f.slice(0,6).map(t=>e.jsxs(p,{to:oe(t)??`/activity?eventId=${t.id}`,className:"rounded-[18px] bg-white/[0.04] p-4 transition hover:bg-white/[0.08]",children:[e.jsx("div",{className:"font-medium text-white",children:le(t)}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:ne(t)})]},t.id))})]}),e.jsx(V,{open:O,editingGoal:a,tags:i.snapshot.tags,users:i.snapshot.users,defaultUserId:a.userId??j,onOpenChange:N,onSubmit:async(t,P)=>{P&&await i.patchGoal(P,t)}}),e.jsx(W,{open:S,goals:i.snapshot.goals,users:i.snapshot.users,editingProject:null,initialGoalId:a.id,defaultUserId:a.userId??j,onOpenChange:y,onSubmit:async t=>{await i.createProject(t)}})]})}export{ke as GoalDetailPage};
|