kanban-lite 1.0.9 → 1.0.13

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.
Files changed (38) hide show
  1. package/dist/cli.js +1015 -407
  2. package/dist/extension.js +897 -347
  3. package/dist/mcp-server.js +550 -189
  4. package/dist/sdk/index.cjs +1223 -0
  5. package/dist/sdk/index.mjs +1168 -0
  6. package/dist/sdk/sdk/KanbanSDK.d.ts +39 -21
  7. package/dist/sdk/sdk/index.d.ts +4 -3
  8. package/dist/sdk/sdk/migration.d.ts +6 -0
  9. package/dist/sdk/sdk/types.d.ts +3 -5
  10. package/dist/sdk/shared/config.d.ts +23 -10
  11. package/dist/sdk/shared/types.d.ts +18 -4
  12. package/dist/standalone-webview/index.js +27 -27
  13. package/dist/standalone-webview/index.js.map +1 -1
  14. package/dist/standalone-webview/style.css +1 -1
  15. package/dist/standalone.js +831 -328
  16. package/dist/webview/index.js +45 -45
  17. package/dist/webview/index.js.map +1 -1
  18. package/dist/webview/style.css +1 -1
  19. package/package.json +4 -3
  20. package/src/cli/index.ts +217 -95
  21. package/src/extension/KanbanPanel.ts +49 -22
  22. package/src/mcp-server/index.ts +138 -62
  23. package/src/sdk/KanbanSDK.ts +283 -77
  24. package/src/sdk/__tests__/KanbanSDK.test.ts +5 -5
  25. package/src/sdk/__tests__/migration.test.ts +269 -0
  26. package/src/sdk/__tests__/multi-board.test.ts +449 -0
  27. package/src/sdk/index.ts +4 -3
  28. package/src/sdk/migration.ts +52 -0
  29. package/src/sdk/types.ts +3 -6
  30. package/src/shared/config.ts +144 -22
  31. package/src/shared/types.ts +14 -5
  32. package/src/standalone/__tests__/server.integration.test.ts +38 -37
  33. package/src/standalone/server.ts +239 -21
  34. package/src/webview/App.tsx +17 -7
  35. package/src/webview/components/Toolbar.tsx +99 -3
  36. package/src/webview/store/index.ts +11 -3
  37. package/.kanban/backlog/1-test1.md +0 -30
  38. package/.kanban.json +0 -42
@@ -1,4 +1,4 @@
1
- var yr=Object.defineProperty;var wr=(t,e,r)=>e in t?yr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var $=(t,e,r)=>wr(t,typeof e!="symbol"?e+"":e,r);import{r as m,R as Te,F as At,P as qe,C as Ve,a as Ye,b as Fe,E as jr,c as Lt,T as Je,X as te,d as zr,e as Cr,S as Sr,M as Nr,H as Tr,B as Dr,I as Ar,Q as Lr,f as Mr,L as Er,g as Rr,h as $r,i as Fr,j as Mt,k as Et,U as Rt,l as $t,m as Ie,W as Ir,n as Br,o as Pr,p as _r,q as Or,s as qr,t as Kr}from"./icons-BUWXsIxt.js";import{r as Ur}from"./react-vendor-DD6VaYq_.js";var Ft={exports:{}},Be={};/**
1
+ var jr=Object.defineProperty;var zr=(t,e,r)=>e in t?jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var F=(t,e,r)=>zr(t,typeof e!="symbol"?e+"":e,r);import{r as x,R as Le,F as Mt,P as He,C as et,a as _e,b as Se,E as Cr,c as Rt,T as tt,X as le,d as Sr,e as Nr,S as Tr,M as Dr,H as Ar,B as Er,I as Lr,Q as Mr,f as Rr,L as $r,g as Fr,h as Br,i as Ir,j as $t,k as Ft,U as Bt,l as It,m as Te,W as Pr,n as _r,o as Or,p as qr,q as Kr,s as Ur,t as Gr}from"./icons-BUWXsIxt.js";import{r as Hr}from"./react-vendor-DD6VaYq_.js";var Pt={exports:{}},Oe={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,12 +6,12 @@ var yr=Object.defineProperty;var wr=(t,e,r)=>e in t?yr(t,e,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Gr=m,Hr=Symbol.for("react.element"),Wr=Symbol.for("react.fragment"),Zr=Object.prototype.hasOwnProperty,Qr=Gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Vr={key:!0,ref:!0,__self:!0,__source:!0};function It(t,e,r){var s,o={},i=null,a=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(s in e)Zr.call(e,s)&&!Vr.hasOwnProperty(s)&&(o[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)o[s]===void 0&&(o[s]=e[s]);return{$$typeof:Hr,type:t,key:i,ref:a,props:o,_owner:Qr.current}}Be.Fragment=Wr;Be.jsx=It;Be.jsxs=It;Ft.exports=Be;var n=Ft.exports;const je=new WebSocket(`ws://${window.location.host}/ws`),Ke=[];let Xe=!1;je.addEventListener("open",()=>{Xe=!0;for(const t of Ke)je.send(t);Ke.length=0});je.addEventListener("message",t=>{try{const e=JSON.parse(t.data);window.postMessage(e,"*")}catch{}});je.addEventListener("close",()=>{Xe=!1});let Ue=null;try{const t=sessionStorage.getItem("kanban-standalone-state");t&&(Ue=JSON.parse(t))}catch{}function Yr(t){const e=document.createElement("input");e.type="file",e.multiple=!0,e.style.display="none",document.body.appendChild(e);const r=()=>{e.remove()};e.onchange=async()=>{if(!e.files||e.files.length===0){r();return}const s=[];for(const o of Array.from(e.files)){const i=await o.arrayBuffer(),a=new Uint8Array(i);let l="";for(let p=0;p<a.length;p++)l+=String.fromCharCode(a[p]);s.push({name:o.name,data:btoa(l)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureId:t,files:s})})}catch(o){console.error("Failed to upload attachment:",o)}r()},e.click()}function Jr(t,e){const r=`/api/attachment?featureId=${encodeURIComponent(t)}&filename=${encodeURIComponent(e)}`;window.open(r,"_blank")}window.acquireVsCodeApi=()=>({postMessage(t){const e=t;if(e.type==="addAttachment"){Yr(e.featureId);return}if(e.type==="openAttachment"){Jr(e.featureId,e.attachment);return}if(e.type==="toggleTheme"){const s=document.body.classList.contains("vscode-dark");Me(!s);return}const r=JSON.stringify(t);Xe?je.send(r):Ke.push(r)},getState(){return Ue},setState(t){Ue=t;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(t))}catch{}}});const Ge=window.matchMedia("(prefers-color-scheme: dark)");function Me(t){document.body.classList.toggle("vscode-dark",t),document.body.classList.toggle("vscode-light",!t)}Ge.addEventListener("change",t=>Me(t.matches));document.body?Me(Ge.matches):document.addEventListener("DOMContentLoaded",()=>Me(Ge.matches));var Bt,ut=Ur;Bt=ut.createRoot,ut.hydrateRoot;const Xr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function pe(t,e,r){const s=r[0];if(e!=null&&t>=e)throw new Error(t+" >= "+e);if(t.slice(-1)===s||e&&e.slice(-1)===s)throw new Error("trailing zero");if(e){let a=0;for(;(t[a]||s)===e[a];)a++;if(a>0)return e.slice(0,a)+pe(t.slice(a),e.slice(a),r)}const o=t?r.indexOf(t[0]):0,i=e!=null?r.indexOf(e[0]):r.length;if(i-o>1){const a=Math.round(.5*(o+i));return r[a]}else return e&&e.length>1?e.slice(0,1):r[o]+pe(t.slice(1),null,r)}function Pt(t){if(t.length!==_t(t[0]))throw new Error("invalid integer part of order key: "+t)}function _t(t){if(t>="a"&&t<="z")return t.charCodeAt(0)-97+2;if(t>="A"&&t<="Z")return 90-t.charCodeAt(0)+2;throw new Error("invalid order key head: "+t)}function ye(t){const e=_t(t[0]);if(e>t.length)throw new Error("invalid order key: "+t);return t.slice(0,e)}function pt(t,e){if(t==="A"+e[0].repeat(26))throw new Error("invalid order key: "+t);const r=ye(t);if(t.slice(r.length).slice(-1)===e[0])throw new Error("invalid order key: "+t)}function ht(t,e){Pt(t);const[r,...s]=t.split("");let o=!0;for(let i=s.length-1;o&&i>=0;i--){const a=e.indexOf(s[i])+1;a===e.length?s[i]=e[0]:(s[i]=e[a],o=!1)}if(o){if(r==="Z")return"a"+e[0];if(r==="z")return null;const i=String.fromCharCode(r.charCodeAt(0)+1);return i>"a"?s.push(e[0]):s.pop(),i+s.join("")}else return r+s.join("")}function es(t,e){Pt(t);const[r,...s]=t.split("");let o=!0;for(let i=s.length-1;o&&i>=0;i--){const a=e.indexOf(s[i])-1;a===-1?s[i]=e.slice(-1):(s[i]=e[a],o=!1)}if(o){if(r==="a")return"Z"+e.slice(-1);if(r==="A")return null;const i=String.fromCharCode(r.charCodeAt(0)-1);return i<"Z"?s.push(e.slice(-1)):s.pop(),i+s.join("")}else return r+s.join("")}function ts(t,e,r=Xr){if(t!=null&&pt(t,r),e!=null&&pt(e,r),t!=null&&e!=null&&t>=e)throw new Error(t+" >= "+e);if(t==null){if(e==null)return"a"+r[0];const p=ye(e),c=e.slice(p.length);if(p==="A"+r[0].repeat(26))return p+pe("",c,r);if(p<e)return p;const u=es(p,r);if(u==null)throw new Error("cannot decrement any more");return u}if(e==null){const p=ye(t),c=t.slice(p.length),u=ht(p,r);return u??p+pe(c,null,r)}const s=ye(t),o=t.slice(s.length),i=ye(e),a=e.slice(i.length);if(s===i)return s+pe(o,a,r);const l=ht(s,r);if(l==null)throw new Error("cannot increment any more");return l<e?l:s+pe(o,null,r)}const gt=t=>{let e;const r=new Set,s=(c,u)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const g=e;e=u??(typeof h!="object"||h===null)?h:Object.assign({},e,h),r.forEach(d=>d(e,g))}},o=()=>e,l={setState:s,getState:o,getInitialState:()=>p,subscribe:c=>(r.add(c),()=>r.delete(c))},p=e=t(s,o,l);return l},rs=t=>t?gt(t):gt,ss=t=>t;function ns(t,e=ss){const r=Te.useSyncExternalStore(t.subscribe,Te.useCallback(()=>e(t.getState()),[t,e]),Te.useCallback(()=>e(t.getInitialState()),[t,e]));return Te.useDebugValue(r),r}const ft=t=>{const e=rs(t),r=s=>ns(e,s);return Object.assign(r,e),r},os=t=>t?ft(t):ft,as=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,ls=t=>{const e=new Date;return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()},is=t=>{const e=new Date,r=new Date(e);r.setDate(e.getDate()-e.getDay()),r.setHours(0,0,0,0);const s=new Date(r);return s.setDate(r.getDate()+7),t>=r&&t<s},cs=t=>{const e=new Date;return e.setHours(0,0,0,0),t<e},K=os((t,e)=>({features:[],columns:[],isDarkMode:as(),searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all",layout:"horizontal",cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,defaultPriority:"medium",defaultStatus:"backlog"},settingsOpen:!1,setFeatures:r=>t({features:r}),setColumns:r=>t({columns:r}),setIsDarkMode:r=>t({isDarkMode:r}),setCardSettings:r=>t({cardSettings:r}),setSettingsOpen:r=>t({settingsOpen:r}),setSearchQuery:r=>t({searchQuery:r}),setPriorityFilter:r=>t({priorityFilter:r}),setAssigneeFilter:r=>t({assigneeFilter:r}),setLabelFilter:r=>t({labelFilter:r}),setDueDateFilter:r=>t({dueDateFilter:r}),setLayout:r=>t({layout:r}),toggleLayout:()=>t(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>t({searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all"}),addFeature:r=>t(s=>({features:[...s.features,r]})),updateFeature:(r,s)=>t(o=>({features:o.features.map(i=>i.id===r?{...i,...s}:i)})),removeFeature:r=>t(s=>({features:s.features.filter(o=>o.id!==r)})),getFeaturesByStatus:r=>{const{features:s}=e();return s.filter(o=>o.status===r).sort((o,i)=>o.order<i.order?-1:o.order>i.order?1:0)},getFilteredFeaturesByStatus:r=>{const{features:s,searchQuery:o,priorityFilter:i,assigneeFilter:a,labelFilter:l,dueDateFilter:p}=e();return s.filter(c=>{if(c.status!==r||i!=="all"&&c.priority!==i)return!1;if(a!=="all"){if(a==="unassigned"){if(c.assignee)return!1}else if(c.assignee!==a)return!1}if(l!=="all"&&!c.labels.includes(l))return!1;if(p!=="all")if(p==="no-date"){if(c.dueDate)return!1}else if(c.dueDate){const u=new Date(c.dueDate);if(p==="overdue"&&!cs(u)||p==="today"&&!ls(u)||p==="this-week"&&!is(u))return!1}else return!1;if(o){const u=o.toLowerCase();return c.content.toLowerCase().includes(u)||c.id.toLowerCase().includes(u)||c.assignee&&c.assignee.toLowerCase().includes(u)||c.labels.some(h=>h.toLowerCase().includes(u))}return!0}).sort((c,u)=>c.order<u.order?-1:c.order>u.order?1:0)},getUniqueAssignees:()=>{const{features:r}=e(),s=new Set;return r.forEach(o=>{o.assignee&&s.add(o.assignee)}),Array.from(s).sort()},getUniqueLabels:()=>{const{features:r}=e(),s=new Set;return r.forEach(o=>{o.labels.forEach(i=>s.add(i))}),Array.from(s).sort()},hasActiveFilters:()=>{const{searchQuery:r,priorityFilter:s,assigneeFilter:o,labelFilter:i,dueDateFilter:a}=e();return r!==""||s!=="all"||o!=="all"||i!=="all"||a!=="all"}}));function et(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ie=et();function Ot(t){ie=t}var ae={exec:()=>null};function E(t,e=""){let r=typeof t=="string"?t:t.source,s={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(U.caret,"$1"),r=r.replace(o,a),s},getRegex:()=>new RegExp(r,e)};return s}var ds=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),U={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},us=/^(?:[ \t]*(?:\n|$))+/,ps=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,tt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,qt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kt=E(qt).replace(/bull/g,tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fs=E(qt).replace(/bull/g,tt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),rt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,xs=/^[^\n]+/,st=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ms=E(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",st).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bs=E(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,tt).getRegex(),Pe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",nt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vs=E("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",nt).replace("tag",Pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=E(rt).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pe).getRegex(),ks=E(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ut).getRegex(),ot={blockquote:ks,code:ps,def:ms,fences:hs,heading:gs,hr:ze,html:vs,lheading:Kt,list:bs,newline:us,paragraph:Ut,table:ae,text:xs},xt=E("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pe).getRegex(),ys={...ot,lheading:fs,table:xt,paragraph:E(rt).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Pe).getRegex()},ws={...ot,html:E(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ae,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:E(rt).replace("hr",ze).replace("heading",` *#{1,6} *[^
10
- ]`).replace("lheading",Kt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},js=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gt=/^( {2,}|\\)\n(?!\s*$)/,Cs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_e=/[\p{P}\p{S}]/u,at=/[\s\p{P}\p{S}]/u,Ht=/[^\s\p{P}\p{S}]/u,Ss=E(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,at).getRegex(),Wt=/(?!~)[\p{P}\p{S}]/u,Ns=/(?!~)[\s\p{P}\p{S}]/u,Ts=/(?:[^\s\p{P}\p{S}]|~)/u,Zt=/(?![*_])[\p{P}\p{S}]/u,Ds=/(?![*_])[\s\p{P}\p{S}]/u,As=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ls=E(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ds?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ms=E(Qt,"u").replace(/punct/g,_e).getRegex(),Es=E(Qt,"u").replace(/punct/g,Wt).getRegex(),Vt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Rs=E(Vt,"gu").replace(/notPunctSpace/g,Ht).replace(/punctSpace/g,at).replace(/punct/g,_e).getRegex(),$s=E(Vt,"gu").replace(/notPunctSpace/g,Ts).replace(/punctSpace/g,Ns).replace(/punct/g,Wt).getRegex(),Fs=E("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ht).replace(/punctSpace/g,at).replace(/punct/g,_e).getRegex(),Is=E(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Zt).getRegex(),Bs="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ps=E(Bs,"gu").replace(/notPunctSpace/g,As).replace(/punctSpace/g,Ds).replace(/punct/g,Zt).getRegex(),_s=E(/\\(punct)/,"gu").replace(/punct/g,_e).getRegex(),Os=E(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),qs=E(nt).replace("(?:-->|$)","-->").getRegex(),Ks=E("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",qs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ee=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Us=E(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ee).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yt=E(/^!?\[(label)\]\[(ref)\]/).replace("label",Ee).replace("ref",st).getRegex(),Jt=E(/^!?\[(ref)\](?:\[\])?/).replace("ref",st).getRegex(),Gs=E("reflink|nolink(?!\\()","g").replace("reflink",Yt).replace("nolink",Jt).getRegex(),mt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lt={_backpedal:ae,anyPunctuation:_s,autolink:Os,blockSkip:Ls,br:Gt,code:zs,del:ae,delLDelim:ae,delRDelim:ae,emStrongLDelim:Ms,emStrongRDelimAst:Rs,emStrongRDelimUnd:Fs,escape:js,link:Us,nolink:Jt,punctuation:Ss,reflink:Yt,reflinkSearch:Gs,tag:Ks,text:Cs,url:ae},Hs={...lt,link:E(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee).getRegex(),reflink:E(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee).getRegex()},He={...lt,emStrongRDelimAst:$s,emStrongLDelim:Es,delLDelim:Is,delRDelim:Ps,url:E(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",mt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:E(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",mt).getRegex()},Ws={...He,br:E(Gt).replace("{2,}","*").getRegex(),text:E(He.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},De={normal:ot,gfm:ys,pedantic:ws},xe={normal:lt,gfm:He,breaks:Ws,pedantic:Hs},Zs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},bt=t=>Zs[t];function Y(t,e){if(e){if(U.escapeTest.test(t))return t.replace(U.escapeReplace,bt)}else if(U.escapeTestNoEncode.test(t))return t.replace(U.escapeReplaceNoEncode,bt);return t}function vt(t){try{t=encodeURI(t).replace(U.percentDecode,"%")}catch{return null}return t}function kt(t,e){var i;let r=t.replace(U.findPipe,(a,l,p)=>{let c=!1,u=l;for(;--u>=0&&p[u]==="\\";)c=!c;return c?"|":" |"}),s=r.split(U.splitPipe),o=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(U.slashPipe,"|");return s}function me(t,e,r){let s=t.length;if(s===0)return"";let o=0;for(;o<s&&t.charAt(s-o-1)===e;)o++;return t.slice(0,s-o)}function Qs(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])r++;else if(t[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function Vs(t,e=0){let r=e,s="";for(let o of t)if(o===" "){let i=4-r%4;s+=" ".repeat(i),r+=i}else s+=o,r++;return s}function yt(t,e,r,s,o){let i=e.href,a=e.title||null,l=t[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;let p={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,p}function Ys(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let o=s[1];return e.split(`
9
+ */var Wr=x,Zr=Symbol.for("react.element"),Qr=Symbol.for("react.fragment"),Vr=Object.prototype.hasOwnProperty,Yr=Wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Jr={key:!0,ref:!0,__self:!0,__source:!0};function _t(t,e,r){var s,o={},i=null,a=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(s in e)Vr.call(e,s)&&!Jr.hasOwnProperty(s)&&(o[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)o[s]===void 0&&(o[s]=e[s]);return{$$typeof:Zr,type:t,key:i,ref:a,props:o,_owner:Yr.current}}Oe.Fragment=Qr;Oe.jsx=_t;Oe.jsxs=_t;Pt.exports=Oe;var n=Pt.exports;const Ne=new WebSocket(`ws://${window.location.host}/ws`),We=[];let rt=!1;Ne.addEventListener("open",()=>{rt=!0;for(const t of We)Ne.send(t);We.length=0});Ne.addEventListener("message",t=>{try{const e=JSON.parse(t.data);window.postMessage(e,"*")}catch{}});Ne.addEventListener("close",()=>{rt=!1});let Ze=null;try{const t=sessionStorage.getItem("kanban-standalone-state");t&&(Ze=JSON.parse(t))}catch{}function Xr(t){const e=document.createElement("input");e.type="file",e.multiple=!0,e.style.display="none",document.body.appendChild(e);const r=()=>{e.remove()};e.onchange=async()=>{if(!e.files||e.files.length===0){r();return}const s=[];for(const o of Array.from(e.files)){const i=await o.arrayBuffer(),a=new Uint8Array(i);let l="";for(let p=0;p<a.length;p++)l+=String.fromCharCode(a[p]);s.push({name:o.name,data:btoa(l)})}try{await fetch("/api/upload-attachment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureId:t,files:s})})}catch(o){console.error("Failed to upload attachment:",o)}r()},e.click()}function es(t,e){const r=`/api/attachment?featureId=${encodeURIComponent(t)}&filename=${encodeURIComponent(e)}`;window.open(r,"_blank")}window.acquireVsCodeApi=()=>({postMessage(t){const e=t;if(e.type==="addAttachment"){Xr(e.featureId);return}if(e.type==="openAttachment"){es(e.featureId,e.attachment);return}if(e.type==="toggleTheme"){const s=document.body.classList.contains("vscode-dark");Fe(!s);return}const r=JSON.stringify(t);rt?Ne.send(r):We.push(r)},getState(){return Ze},setState(t){Ze=t;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(t))}catch{}}});const Qe=window.matchMedia("(prefers-color-scheme: dark)");function Fe(t){document.body.classList.toggle("vscode-dark",t),document.body.classList.toggle("vscode-light",!t)}Qe.addEventListener("change",t=>Fe(t.matches));document.body?Fe(Qe.matches):document.addEventListener("DOMContentLoaded",()=>Fe(Qe.matches));var Ot,gt=Hr;Ot=gt.createRoot,gt.hydrateRoot;const ts="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function xe(t,e,r){const s=r[0];if(e!=null&&t>=e)throw new Error(t+" >= "+e);if(t.slice(-1)===s||e&&e.slice(-1)===s)throw new Error("trailing zero");if(e){let a=0;for(;(t[a]||s)===e[a];)a++;if(a>0)return e.slice(0,a)+xe(t.slice(a),e.slice(a),r)}const o=t?r.indexOf(t[0]):0,i=e!=null?r.indexOf(e[0]):r.length;if(i-o>1){const a=Math.round(.5*(o+i));return r[a]}else return e&&e.length>1?e.slice(0,1):r[o]+xe(t.slice(1),null,r)}function qt(t){if(t.length!==Kt(t[0]))throw new Error("invalid integer part of order key: "+t)}function Kt(t){if(t>="a"&&t<="z")return t.charCodeAt(0)-97+2;if(t>="A"&&t<="Z")return 90-t.charCodeAt(0)+2;throw new Error("invalid order key head: "+t)}function ze(t){const e=Kt(t[0]);if(e>t.length)throw new Error("invalid order key: "+t);return t.slice(0,e)}function ft(t,e){if(t==="A"+e[0].repeat(26))throw new Error("invalid order key: "+t);const r=ze(t);if(t.slice(r.length).slice(-1)===e[0])throw new Error("invalid order key: "+t)}function xt(t,e){qt(t);const[r,...s]=t.split("");let o=!0;for(let i=s.length-1;o&&i>=0;i--){const a=e.indexOf(s[i])+1;a===e.length?s[i]=e[0]:(s[i]=e[a],o=!1)}if(o){if(r==="Z")return"a"+e[0];if(r==="z")return null;const i=String.fromCharCode(r.charCodeAt(0)+1);return i>"a"?s.push(e[0]):s.pop(),i+s.join("")}else return r+s.join("")}function rs(t,e){qt(t);const[r,...s]=t.split("");let o=!0;for(let i=s.length-1;o&&i>=0;i--){const a=e.indexOf(s[i])-1;a===-1?s[i]=e.slice(-1):(s[i]=e[a],o=!1)}if(o){if(r==="a")return"Z"+e.slice(-1);if(r==="A")return null;const i=String.fromCharCode(r.charCodeAt(0)-1);return i<"Z"?s.push(e.slice(-1)):s.pop(),i+s.join("")}else return r+s.join("")}function ss(t,e,r=ts){if(t!=null&&ft(t,r),e!=null&&ft(e,r),t!=null&&e!=null&&t>=e)throw new Error(t+" >= "+e);if(t==null){if(e==null)return"a"+r[0];const p=ze(e),c=e.slice(p.length);if(p==="A"+r[0].repeat(26))return p+xe("",c,r);if(p<e)return p;const u=rs(p,r);if(u==null)throw new Error("cannot decrement any more");return u}if(e==null){const p=ze(t),c=t.slice(p.length),u=xt(p,r);return u??p+xe(c,null,r)}const s=ze(t),o=t.slice(s.length),i=ze(e),a=e.slice(i.length);if(s===i)return s+xe(o,a,r);const l=xt(s,r);if(l==null)throw new Error("cannot increment any more");return l<e?l:s+xe(o,null,r)}const mt=t=>{let e;const r=new Set,s=(c,u)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const g=e;e=u??(typeof h!="object"||h===null)?h:Object.assign({},e,h),r.forEach(d=>d(e,g))}},o=()=>e,l={setState:s,getState:o,getInitialState:()=>p,subscribe:c=>(r.add(c),()=>r.delete(c))},p=e=t(s,o,l);return l},ns=t=>t?mt(t):mt,os=t=>t;function as(t,e=os){const r=Le.useSyncExternalStore(t.subscribe,Le.useCallback(()=>e(t.getState()),[t,e]),Le.useCallback(()=>e(t.getInitialState()),[t,e]));return Le.useDebugValue(r),r}const bt=t=>{const e=ns(t),r=s=>as(e,s);return Object.assign(r,e),r},ls=t=>t?bt(t):bt,is=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,cs=t=>{const e=new Date;return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()},ds=t=>{const e=new Date,r=new Date(e);r.setDate(e.getDate()-e.getDay()),r.setHours(0,0,0,0);const s=new Date(r);return s.setDate(r.getDate()+7),t>=r&&t<s},us=t=>{const e=new Date;return e.setHours(0,0,0,0),t<e},U=ls((t,e)=>({features:[],columns:[],boards:[],currentBoard:"default",isDarkMode:is(),searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all",layout:"horizontal",cardSettings:{showPriorityBadges:!0,showAssignee:!0,showDueDate:!0,showLabels:!0,showBuildWithAI:!0,showFileName:!1,compactMode:!1,markdownEditorMode:!1,defaultPriority:"medium",defaultStatus:"backlog"},settingsOpen:!1,setFeatures:r=>t({features:r}),setColumns:r=>t({columns:r}),setBoards:r=>t({boards:r}),setCurrentBoard:r=>t({currentBoard:r}),setIsDarkMode:r=>t({isDarkMode:r}),setCardSettings:r=>t({cardSettings:r}),setSettingsOpen:r=>t({settingsOpen:r}),setSearchQuery:r=>t({searchQuery:r}),setPriorityFilter:r=>t({priorityFilter:r}),setAssigneeFilter:r=>t({assigneeFilter:r}),setLabelFilter:r=>t({labelFilter:r}),setDueDateFilter:r=>t({dueDateFilter:r}),setLayout:r=>t({layout:r}),toggleLayout:()=>t(r=>({layout:r.layout==="horizontal"?"vertical":"horizontal"})),clearAllFilters:()=>t({searchQuery:"",priorityFilter:"all",assigneeFilter:"all",labelFilter:"all",dueDateFilter:"all"}),addFeature:r=>t(s=>({features:[...s.features,r]})),updateFeature:(r,s)=>t(o=>({features:o.features.map(i=>i.id===r?{...i,...s}:i)})),removeFeature:r=>t(s=>({features:s.features.filter(o=>o.id!==r)})),getFeaturesByStatus:r=>{const{features:s}=e();return s.filter(o=>o.status===r).sort((o,i)=>o.order<i.order?-1:o.order>i.order?1:0)},getFilteredFeaturesByStatus:r=>{const{features:s,searchQuery:o,priorityFilter:i,assigneeFilter:a,labelFilter:l,dueDateFilter:p}=e();return s.filter(c=>{if(c.status!==r||i!=="all"&&c.priority!==i)return!1;if(a!=="all"){if(a==="unassigned"){if(c.assignee)return!1}else if(c.assignee!==a)return!1}if(l!=="all"&&!c.labels.includes(l))return!1;if(p!=="all")if(p==="no-date"){if(c.dueDate)return!1}else if(c.dueDate){const u=new Date(c.dueDate);if(p==="overdue"&&!us(u)||p==="today"&&!cs(u)||p==="this-week"&&!ds(u))return!1}else return!1;if(o){const u=o.toLowerCase();return c.content.toLowerCase().includes(u)||c.id.toLowerCase().includes(u)||c.assignee&&c.assignee.toLowerCase().includes(u)||c.labels.some(h=>h.toLowerCase().includes(u))}return!0}).sort((c,u)=>c.order<u.order?-1:c.order>u.order?1:0)},getUniqueAssignees:()=>{const{features:r}=e(),s=new Set;return r.forEach(o=>{o.assignee&&s.add(o.assignee)}),Array.from(s).sort()},getUniqueLabels:()=>{const{features:r}=e(),s=new Set;return r.forEach(o=>{o.labels.forEach(i=>s.add(i))}),Array.from(s).sort()},hasActiveFilters:()=>{const{searchQuery:r,priorityFilter:s,assigneeFilter:o,labelFilter:i,dueDateFilter:a}=e();return r!==""||s!=="all"||o!=="all"||i!=="all"||a!=="all"}}));function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pe=st();function Ut(t){pe=t}var de={exec:()=>null};function R(t,e=""){let r=typeof t=="string"?t:t.source,s={replace:(o,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(H.caret,"$1"),r=r.replace(o,a),s},getRegex:()=>new RegExp(r,e)};return s}var ps=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),H={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},hs=/^(?:[ \t]*(?:\n|$))+/,gs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,De=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xs=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,nt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ht=R(Gt).replace(/bull/g,nt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ms=R(Gt).replace(/bull/g,nt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ot=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bs=/^[^\n]+/,at=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vs=R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",at).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ks=R(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,nt).getRegex(),qe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",lt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ys=R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",lt).replace("tag",qe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Wt=R(ot).replace("hr",De).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qe).getRegex(),ws=R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Wt).getRegex(),it={blockquote:ws,code:gs,def:vs,fences:fs,heading:xs,hr:De,html:ys,lheading:Ht,list:ks,newline:hs,paragraph:Wt,table:de,text:bs},vt=R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",De).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qe).getRegex(),js={...it,lheading:ms,table:vt,paragraph:R(ot).replace("hr",De).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qe).getRegex()},zs={...it,html:R(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",lt).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:de,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:R(ot).replace("hr",De).replace("heading",` *#{1,6} *[^
10
+ ]`).replace("lheading",Ht).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Cs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ss=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Zt=/^( {2,}|\\)\n(?!\s*$)/,Ns=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ke=/[\p{P}\p{S}]/u,ct=/[\s\p{P}\p{S}]/u,Qt=/[^\s\p{P}\p{S}]/u,Ts=R(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ct).getRegex(),Vt=/(?!~)[\p{P}\p{S}]/u,Ds=/(?!~)[\s\p{P}\p{S}]/u,As=/(?:[^\s\p{P}\p{S}]|~)/u,Yt=/(?![*_])[\p{P}\p{S}]/u,Es=/(?![*_])[\s\p{P}\p{S}]/u,Ls=/(?:[^\s\p{P}\p{S}]|[*_])/u,Ms=R(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ps?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Jt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Rs=R(Jt,"u").replace(/punct/g,Ke).getRegex(),$s=R(Jt,"u").replace(/punct/g,Vt).getRegex(),Xt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Fs=R(Xt,"gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,ct).replace(/punct/g,Ke).getRegex(),Bs=R(Xt,"gu").replace(/notPunctSpace/g,As).replace(/punctSpace/g,Ds).replace(/punct/g,Vt).getRegex(),Is=R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,ct).replace(/punct/g,Ke).getRegex(),Ps=R(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Yt).getRegex(),_s="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Os=R(_s,"gu").replace(/notPunctSpace/g,Ls).replace(/punctSpace/g,Es).replace(/punct/g,Yt).getRegex(),qs=R(/\\(punct)/,"gu").replace(/punct/g,Ke).getRegex(),Ks=R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Us=R(lt).replace("(?:-->|$)","-->").getRegex(),Gs=R("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Us).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Be=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Hs=R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Be).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),er=R(/^!?\[(label)\]\[(ref)\]/).replace("label",Be).replace("ref",at).getRegex(),tr=R(/^!?\[(ref)\](?:\[\])?/).replace("ref",at).getRegex(),Ws=R("reflink|nolink(?!\\()","g").replace("reflink",er).replace("nolink",tr).getRegex(),kt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dt={_backpedal:de,anyPunctuation:qs,autolink:Ks,blockSkip:Ms,br:Zt,code:Ss,del:de,delLDelim:de,delRDelim:de,emStrongLDelim:Rs,emStrongRDelimAst:Fs,emStrongRDelimUnd:Is,escape:Cs,link:Hs,nolink:tr,punctuation:Ts,reflink:er,reflinkSearch:Ws,tag:Gs,text:Ns,url:de},Zs={...dt,link:R(/^!?\[(label)\]\((.*?)\)/).replace("label",Be).getRegex(),reflink:R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Be).getRegex()},Ve={...dt,emStrongRDelimAst:Bs,emStrongLDelim:$s,delLDelim:Ps,delRDelim:Os,url:R(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:R(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",kt).getRegex()},Qs={...Ve,br:R(Zt).replace("{2,}","*").getRegex(),text:R(Ve.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Me={normal:it,gfm:js,pedantic:zs},ve={normal:dt,gfm:Ve,breaks:Qs,pedantic:Zs},Vs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},yt=t=>Vs[t];function ee(t,e){if(e){if(H.escapeTest.test(t))return t.replace(H.escapeReplace,yt)}else if(H.escapeTestNoEncode.test(t))return t.replace(H.escapeReplaceNoEncode,yt);return t}function wt(t){try{t=encodeURI(t).replace(H.percentDecode,"%")}catch{return null}return t}function jt(t,e){var i;let r=t.replace(H.findPipe,(a,l,p)=>{let c=!1,u=l;for(;--u>=0&&p[u]==="\\";)c=!c;return c?"|":" |"}),s=r.split(H.splitPipe),o=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(H.slashPipe,"|");return s}function ke(t,e,r){let s=t.length;if(s===0)return"";let o=0;for(;o<s&&t.charAt(s-o-1)===e;)o++;return t.slice(0,s-o)}function Ys(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])r++;else if(t[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function Js(t,e=0){let r=e,s="";for(let o of t)if(o===" "){let i=4-r%4;s+=" ".repeat(i),r+=i}else s+=o,r++;return s}function zt(t,e,r,s,o){let i=e.href,a=e.title||null,l=t[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;let p={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,p}function Xs(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let o=s[1];return e.split(`
11
11
  `).map(i=>{let a=i.match(r.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=o.length?i.slice(o.length):i}).join(`
12
- `)}var Re=class{constructor(t){$(this,"options");$(this,"rules");$(this,"lexer");this.options=t||ie}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:me(r,`
13
- `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=Ys(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=me(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:me(e[0],`
14
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=me(e[0],`
12
+ `)}var Ie=class{constructor(t){F(this,"options");F(this,"rules");F(this,"lexer");this.options=t||pe}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ke(r,`
13
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=Xs(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=ke(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ke(e[0],`
14
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=ke(e[0],`
15
15
  `).split(`
16
16
  `),s="",o="",i=[];for(;r.length>0;){let a=!1,l=[],p;for(p=0;p<r.length;p++)if(this.rules.other.blockquoteStart.test(r[p]))l.push(r[p]),a=!0;else if(!a)l.push(r[p]);else break;r=r.slice(p);let c=l.join(`
17
17
  `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
@@ -19,20 +19,20 @@ var yr=Object.defineProperty;var wr=(t,e,r)=>e in t?yr(t,e,{enumerable:!0,config
19
19
  ${c}`:c,o=o?`${o}
20
20
  ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=h,r.length===0)break;let g=i.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let d=g,v=d.raw+`
21
21
  `+r.join(`
22
- `),x=this.blockquote(v);i[i.length-1]=x,s=s.substring(0,s.length-d.raw.length)+x.raw,o=o.substring(0,o.length-d.text.length)+x.text;break}else if((g==null?void 0:g.type)==="list"){let d=g,v=d.raw+`
22
+ `),f=this.blockquote(v);i[i.length-1]=f,s=s.substring(0,s.length-d.raw.length)+f.raw,o=o.substring(0,o.length-d.text.length)+f.text;break}else if((g==null?void 0:g.type)==="list"){let d=g,v=d.raw+`
23
23
  `+r.join(`
24
- `),x=this.list(v);i[i.length-1]=x,s=s.substring(0,s.length-g.raw.length)+x.raw,o=o.substring(0,o.length-d.raw.length)+x.raw,r=v.substring(i.at(-1).raw.length).split(`
25
- `);continue}}return{type:"blockquote",raw:s,tokens:i,text:o}}}list(t){var r,s;let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim(),i=o.length>1,a={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let l=this.rules.other.listItemRegex(o),p=!1;for(;t;){let u=!1,h="",g="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let d=Vs(e[2].split(`
24
+ `),f=this.list(v);i[i.length-1]=f,s=s.substring(0,s.length-g.raw.length)+f.raw,o=o.substring(0,o.length-d.raw.length)+f.raw,r=v.substring(i.at(-1).raw.length).split(`
25
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:o}}}list(t){var r,s;let e=this.rules.block.list.exec(t);if(e){let o=e[1].trim(),i=o.length>1,a={type:"list",raw:"",ordered:i,start:i?+o.slice(0,-1):"",loose:!1,items:[]};o=i?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=i?o:"[*+-]");let l=this.rules.other.listItemRegex(o),p=!1;for(;t;){let u=!1,h="",g="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let d=Js(e[2].split(`
26
26
  `,1)[0],e[1].length),v=t.split(`
27
- `,1)[0],x=!d.trim(),k=0;if(this.options.pedantic?(k=2,g=d.trimStart()):x?k=e[1].length+1:(k=d.search(this.rules.other.nonSpaceChar),k=k>4?1:k,g=d.slice(k),k+=e[1].length),x&&this.rules.other.blankLine.test(v)&&(h+=v+`
28
- `,t=t.substring(v.length+1),u=!0),!u){let f=this.rules.other.nextBulletRegex(k),C=this.rules.other.hrRegex(k),z=this.rules.other.fencesBeginRegex(k),b=this.rules.other.headingBeginRegex(k),T=this.rules.other.htmlBeginRegex(k),A=this.rules.other.blockquoteBeginRegex(k);for(;t;){let y=t.split(`
29
- `,1)[0],w;if(v=y,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),w=v):w=v.replace(this.rules.other.tabCharGlobal," "),z.test(v)||b.test(v)||T.test(v)||A.test(v)||f.test(v)||C.test(v))break;if(w.search(this.rules.other.nonSpaceChar)>=k||!v.trim())g+=`
30
- `+w.slice(k);else{if(x||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(d)||b.test(d)||C.test(d))break;g+=`
31
- `+v}x=!v.trim(),h+=y+`
32
- `,t=t.substring(y.length+1),d=w.slice(k)}}a.loose||(p?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(p=!0)),a.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),a.raw+=h}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u of a.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((s=u.tokens[0])==null?void 0:s.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=g.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=g.raw+u.tokens[0].raw,u.tokens[0].text=g.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(g)):u.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):u.tokens.unshift(g)}}if(!a.loose){let h=u.tokens.filter(d=>d.type==="space"),g=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));a.loose=g}}if(a.loose)for(let u of a.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:o}}}table(t){var a;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=kt(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
33
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of o)i.rows.push(kt(l,i.header.length).map((p,c)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
34
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=me(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Qs(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],o=i[3])}else o=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),yt(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[s.toLowerCase()];if(!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return yt(r,o,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...s[0]].length-1,i,a,l=o,p=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+o);(s=c.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if((s[5]||s[6])&&o%3&&!((o+a)%3)){p+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+p);let u=[...s[0]][0].length,h=t.slice(0,o+s.index+u+a);if(Math.min(o,a)%2){let d=h.slice(1,-1);return{type:"em",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...s[0]].length-1,i,a,l=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,e=e.slice(-1*t.length+o);(s=p.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==o))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let c=[...s[0]][0].length,u=t.slice(0,o+s.index+c+a),h=u.slice(o,-o);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let s,o;if(e[2]==="@")s=e[0],o="mailto:"+s;else{let i;do i=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Q=class We{constructor(e){$(this,"tokens");$(this,"options");$(this,"state");$(this,"inlineQueue");$(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ie,this.options.tokenizer=this.options.tokenizer||new Re,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:U,block:De.normal,inline:xe.normal};this.options.pedantic?(r.block=De.pedantic,r.inline=xe.pedantic):this.options.gfm&&(r.block=De.gfm,this.options.breaks?r.inline=xe.breaks:r.inline=xe.gfm),this.tokenizer.rules=r}static get rules(){return{block:De,inline:xe}}static lex(e,r){return new We(r).lex(e)}static lexInline(e,r){return new We(r).inlineTokens(e)}lex(e){e=e.replace(U.carriageReturn,`
35
- `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){var o,i,a;for(this.options.pedantic&&(e=e.replace(U.tabCharGlobal," ").replace(U.spaceLine,""));e;){let l;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(l=c.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let c=r.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
27
+ `,1)[0],f=!d.trim(),y=0;if(this.options.pedantic?(y=2,g=d.trimStart()):f?y=e[1].length+1:(y=d.search(this.rules.other.nonSpaceChar),y=y>4?1:y,g=d.slice(y),y+=e[1].length),f&&this.rules.other.blankLine.test(v)&&(h+=v+`
28
+ `,t=t.substring(v.length+1),u=!0),!u){let b=this.rules.other.nextBulletRegex(y),z=this.rules.other.hrRegex(y),k=this.rules.other.fencesBeginRegex(y),m=this.rules.other.headingBeginRegex(y),M=this.rules.other.htmlBeginRegex(y),E=this.rules.other.blockquoteBeginRegex(y);for(;t;){let w=t.split(`
29
+ `,1)[0],C;if(v=w,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),C=v):C=v.replace(this.rules.other.tabCharGlobal," "),k.test(v)||m.test(v)||M.test(v)||E.test(v)||b.test(v)||z.test(v))break;if(C.search(this.rules.other.nonSpaceChar)>=y||!v.trim())g+=`
30
+ `+C.slice(y);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(d)||m.test(d)||z.test(d))break;g+=`
31
+ `+v}f=!v.trim(),h+=w+`
32
+ `,t=t.substring(w.length+1),d=C.slice(y)}}a.loose||(p?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(p=!0)),a.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),a.raw+=h}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let u of a.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((r=u.tokens[0])==null?void 0:r.type)==="text"||((s=u.tokens[0])==null?void 0:s.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(u.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};u.checked=g.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=g.raw+u.tokens[0].raw,u.tokens[0].text=g.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(g)):u.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):u.tokens.unshift(g)}}if(!a.loose){let h=u.tokens.filter(d=>d.type==="space"),g=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));a.loose=g}}if(a.loose)for(let u of a.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:o}}}table(t){var a;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=jt(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
33
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of o)i.rows.push(jt(l,i.header.length).map((p,c)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:i.align[c]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
34
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=ke(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Ys(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],o=i[3])}else o=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),zt(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=e[s.toLowerCase()];if(!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return zt(r,o,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...s[0]].length-1,i,a,l=o,p=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+o);(s=c.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(a=[...i].length,s[3]||s[4]){l+=a;continue}else if((s[5]||s[6])&&o%3&&!((o+a)%3)){p+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+p);let u=[...s[0]][0].length,h=t.slice(0,o+s.index+u+a);if(Math.min(o,a)%2){let d=h.slice(1,-1);return{type:"em",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...s[0]].length-1,i,a,l=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,e=e.slice(-1*t.length+o);(s=p.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(a=[...i].length,a!==o))continue;if(s[3]||s[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let c=[...s[0]][0].length,u=t.slice(0,o+s.index+c+a),h=u.slice(o,-o);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let s,o;if(e[2]==="@")s=e[0],o="mailto:"+s;else{let i;do i=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?o="http://"+e[0]:o=e[0]}return{type:"link",raw:e[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},J=class Ye{constructor(e){F(this,"tokens");F(this,"options");F(this,"state");F(this,"inlineQueue");F(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pe,this.options.tokenizer=this.options.tokenizer||new Ie,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:H,block:Me.normal,inline:ve.normal};this.options.pedantic?(r.block=Me.pedantic,r.inline=ve.pedantic):this.options.gfm&&(r.block=Me.gfm,this.options.breaks?r.inline=ve.breaks:r.inline=ve.gfm),this.tokenizer.rules=r}static get rules(){return{block:Me,inline:ve}}static lex(e,r){return new Ye(r).lex(e)}static lexInline(e,r){return new Ye(r).inlineTokens(e)}lex(e){e=e.replace(H.carriageReturn,`
35
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){var o,i,a;for(this.options.pedantic&&(e=e.replace(H.tabCharGlobal," ").replace(H.spaceLine,""));e;){let l;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(l=c.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let c=r.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
36
36
  `:r.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
37
37
  `)?"":`
38
38
  `)+l.raw,c.text+=`
@@ -45,9 +45,9 @@ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
45
45
  `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(l),s=p.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
46
46
  `)?"":`
47
47
  `)+l.raw,c.text+=`
48
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var p,c,u,h,g;let s=e,o=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)d.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=o[2]?o[2].length:0,s=s.slice(0,o.index+i)+"["+"a".repeat(o[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((c=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:c.call({lexer:this},s))??s;let a=!1,l="";for(;e;){a||(l=""),a=!1;let d;if((h=(u=this.options.extensions)==null?void 0:u.inline)!=null&&h.some(x=>(d=x.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let x=r.at(-1);d.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=d.raw,x.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,s,l)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,s,l)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let v=e;if((g=this.options.extensions)!=null&&g.startInline){let x=1/0,k=e.slice(1),f;this.options.extensions.startInline.forEach(C=>{f=C.call({lexer:this},k),typeof f=="number"&&f>=0&&(x=Math.min(x,f))}),x<1/0&&x>=0&&(v=e.substring(0,x+1))}if(d=this.tokenizer.inlineText(v)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),a=!0;let x=r.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=d.raw,x.text+=d.text):r.push(d);continue}if(e){let x="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return r}},$e=class{constructor(t){$(this,"options");$(this,"parser");this.options=t||ie}space(t){return""}code({text:t,lang:e,escaped:r}){var i;let s=(i=(e||"").match(U.notSpaceStart))==null?void 0:i[0],o=t.replace(U.endingNewline,"")+`
49
- `;return s?'<pre><code class="language-'+Y(s)+'">'+(r?o:Y(o,!0))+`</code></pre>
50
- `:"<pre><code>"+(r?o:Y(o,!0))+`</code></pre>
48
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var p,c,u,h,g;let s=e,o=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)d.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=o[2]?o[2].length:0,s=s.slice(0,o.index+i)+"["+"a".repeat(o[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((c=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:c.call({lexer:this},s))??s;let a=!1,l="";for(;e;){a||(l=""),a=!1;let d;if((h=(u=this.options.extensions)==null?void 0:u.inline)!=null&&h.some(f=>(d=f.call({lexer:this},e,r))?(e=e.substring(d.raw.length),r.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);let f=r.at(-1);d.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.text+=d.text):r.push(d);continue}if(d=this.tokenizer.emStrong(e,s,l)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.del(e,s,l)){e=e.substring(d.raw.length),r.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),r.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),r.push(d);continue}let v=e;if((g=this.options.extensions)!=null&&g.startInline){let f=1/0,y=e.slice(1),b;this.options.extensions.startInline.forEach(z=>{b=z.call({lexer:this},y),typeof b=="number"&&b>=0&&(f=Math.min(f,b))}),f<1/0&&f>=0&&(v=e.substring(0,f+1))}if(d=this.tokenizer.inlineText(v)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),a=!0;let f=r.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=d.raw,f.text+=d.text):r.push(d);continue}if(e){let f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}},Pe=class{constructor(t){F(this,"options");F(this,"parser");this.options=t||pe}space(t){return""}code({text:t,lang:e,escaped:r}){var i;let s=(i=(e||"").match(H.notSpaceStart))==null?void 0:i[0],o=t.replace(H.endingNewline,"")+`
49
+ `;return s?'<pre><code class="language-'+ee(s)+'">'+(r?o:ee(o,!0))+`</code></pre>
50
+ `:"<pre><code>"+(r?o:ee(o,!0))+`</code></pre>
51
51
  `}blockquote({tokens:t}){return`<blockquote>
52
52
  ${this.parser.parse(t)}</blockquote>
53
53
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
@@ -63,11 +63,11 @@ ${this.parser.parse(t)}</blockquote>
63
63
  `}tablerow({text:t}){return`<tr>
64
64
  ${t}</tr>
65
65
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
66
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Y(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let s=this.parser.parseInline(r),o=vt(t);if(o===null)return s;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+Y(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let o=vt(t);if(o===null)return Y(r);t=o;let i=`<img src="${t}" alt="${Y(r)}"`;return e&&(i+=` title="${Y(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Y(t.text)}},it=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},V=class Ze{constructor(e){$(this,"options");$(this,"renderer");$(this,"textRenderer");this.options=e||ie,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new it}static parse(e,r){return new Ze(r).parse(e)}static parseInline(e,r){return new Ze(r).parseInline(e)}parse(e){var s,o;let r="";for(let i=0;i<e.length;i++){let a=e[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){let p=a,c=this.options.extensions.renderers[p.type].call({parser:this},p);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){r+=c||"";continue}}let l=a;switch(l.type){case"space":{r+=this.renderer.space(l);break}case"hr":{r+=this.renderer.hr(l);break}case"heading":{r+=this.renderer.heading(l);break}case"code":{r+=this.renderer.code(l);break}case"table":{r+=this.renderer.table(l);break}case"blockquote":{r+=this.renderer.blockquote(l);break}case"list":{r+=this.renderer.list(l);break}case"checkbox":{r+=this.renderer.checkbox(l);break}case"html":{r+=this.renderer.html(l);break}case"def":{r+=this.renderer.def(l);break}case"paragraph":{r+=this.renderer.paragraph(l);break}case"text":{r+=this.renderer.text(l);break}default:{let p='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}parseInline(e,r=this.renderer){var o,i;let s="";for(let a=0;a<e.length;a++){let l=e[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[l.type]){let c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=c||"";continue}}let p=l;switch(p.type){case"escape":{s+=r.text(p);break}case"html":{s+=r.html(p);break}case"link":{s+=r.link(p);break}case"image":{s+=r.image(p);break}case"checkbox":{s+=r.checkbox(p);break}case"strong":{s+=r.strong(p);break}case"em":{s+=r.em(p);break}case"codespan":{s+=r.codespan(p);break}case"br":{s+=r.br(p);break}case"del":{s+=r.del(p);break}case"text":{s+=r.text(p);break}default:{let c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Le,we=(Le=class{constructor(t){$(this,"options");$(this,"block");this.options=t||ie}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Q.lex:Q.lexInline}provideParser(){return this.block?V.parse:V.parseInline}},$(Le,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$(Le,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Le),Xt=class{constructor(...t){$(this,"defaults",et());$(this,"options",this.setOptions);$(this,"parse",this.parseMarkdown(!0));$(this,"parseInline",this.parseMarkdown(!1));$(this,"Parser",V);$(this,"Renderer",$e);$(this,"TextRenderer",it);$(this,"Lexer",Q);$(this,"Tokenizer",Re);$(this,"Hooks",we);this.use(...t)}walkTokens(t,e){var s,o;let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let a=i;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let p of l)r=r.concat(this.walkTokens(p.tokens,e));break}case"list":{let a=i;r=r.concat(this.walkTokens(a.items,e));break}default:{let a=i;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let p=a[l].flat(1/0);r=r.concat(this.walkTokens(p,e))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=e.renderers[o.name];i?e.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[o.level];i?i.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),s.extensions=e),r.renderer){let o=this.defaults.renderer||new $e(this.defaults);for(let i in r.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=r.renderer[a],p=o[a];o[a]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u||""}}s.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Re(this.defaults);for(let i in r.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=r.tokenizer[a],p=o[a];o[a]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}s.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new we;for(let i in r.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=r.hooks[a],p=o[a];we.passThroughHooks.has(i)?o[a]=c=>{if(this.defaults.async&&we.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(o,c);return p.call(o,h)})();let u=l.call(o,c);return p.call(o,u)}:o[a]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(o,c);return h===!1&&(h=await p.apply(o,c)),h})();let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}s.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Q.lex(t,e??this.defaults)}parser(t,e){return V.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(e):e,l=await(o.hooks?await o.hooks.provideLexer():t?Q.lex:Q.lexInline)(a,o),p=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():t?V.parse:V.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(i);try{o.hooks&&(e=o.hooks.preprocess(e));let a=(o.hooks?o.hooks.provideLexer():t?Q.lex:Q.lexInline)(e,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?V.parse:V.parseInline)(a,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(t,e){return r=>{if(r.message+=`
67
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Y(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},le=new Xt;function R(t,e){return le.parse(t,e)}R.options=R.setOptions=function(t){return le.setOptions(t),R.defaults=le.defaults,Ot(R.defaults),R};R.getDefaults=et;R.defaults=ie;R.use=function(...t){return le.use(...t),R.defaults=le.defaults,Ot(R.defaults),R};R.walkTokens=function(t,e){return le.walkTokens(t,e)};R.parseInline=le.parseInline;R.Parser=V;R.parser=V.parse;R.Renderer=$e;R.TextRenderer=it;R.Lexer=Q;R.lexer=Q.lex;R.Tokenizer=Re;R.Hooks=we;R.parse=R;R.options;R.setOptions;R.use;R.walkTokens;R.parseInline;V.parse;Q.lex;function er(t){const e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():t.split(`
68
- `).map(s=>s.trim()).find(s=>s.length>0)||"Untitled"}const wt={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},jt={critical:"Critical",high:"High",medium:"Med",low:"Low"};function Js(t){const e=t.split(`
66
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${ee(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let s=this.parser.parseInline(r),o=wt(t);if(o===null)return s;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+ee(e)+'"'),i+=">"+s+"</a>",i}image({href:t,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let o=wt(t);if(o===null)return ee(r);t=o;let i=`<img src="${t}" alt="${ee(r)}"`;return e&&(i+=` title="${ee(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ee(t.text)}},ut=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},X=class Je{constructor(e){F(this,"options");F(this,"renderer");F(this,"textRenderer");this.options=e||pe,this.options.renderer=this.options.renderer||new Pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ut}static parse(e,r){return new Je(r).parse(e)}static parseInline(e,r){return new Je(r).parseInline(e)}parse(e){var s,o;let r="";for(let i=0;i<e.length;i++){let a=e[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){let p=a,c=this.options.extensions.renderers[p.type].call({parser:this},p);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){r+=c||"";continue}}let l=a;switch(l.type){case"space":{r+=this.renderer.space(l);break}case"hr":{r+=this.renderer.hr(l);break}case"heading":{r+=this.renderer.heading(l);break}case"code":{r+=this.renderer.code(l);break}case"table":{r+=this.renderer.table(l);break}case"blockquote":{r+=this.renderer.blockquote(l);break}case"list":{r+=this.renderer.list(l);break}case"checkbox":{r+=this.renderer.checkbox(l);break}case"html":{r+=this.renderer.html(l);break}case"def":{r+=this.renderer.def(l);break}case"paragraph":{r+=this.renderer.paragraph(l);break}case"text":{r+=this.renderer.text(l);break}default:{let p='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}parseInline(e,r=this.renderer){var o,i;let s="";for(let a=0;a<e.length;a++){let l=e[a];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[l.type]){let c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=c||"";continue}}let p=l;switch(p.type){case"escape":{s+=r.text(p);break}case"html":{s+=r.html(p);break}case"link":{s+=r.link(p);break}case"image":{s+=r.image(p);break}case"checkbox":{s+=r.checkbox(p);break}case"strong":{s+=r.strong(p);break}case"em":{s+=r.em(p);break}case"codespan":{s+=r.codespan(p);break}case"br":{s+=r.br(p);break}case"del":{s+=r.del(p);break}case"text":{s+=r.text(p);break}default:{let c='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},$e,Ce=($e=class{constructor(t){F(this,"options");F(this,"block");this.options=t||pe}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?J.lex:J.lexInline}provideParser(){return this.block?X.parse:X.parseInline}},F($e,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),F($e,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),$e),rr=class{constructor(...t){F(this,"defaults",st());F(this,"options",this.setOptions);F(this,"parse",this.parseMarkdown(!0));F(this,"parseInline",this.parseMarkdown(!1));F(this,"Parser",X);F(this,"Renderer",Pe);F(this,"TextRenderer",ut);F(this,"Lexer",J);F(this,"Tokenizer",Ie);F(this,"Hooks",Ce);this.use(...t)}walkTokens(t,e){var s,o;let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let a=i;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let p of l)r=r.concat(this.walkTokens(p.tokens,e));break}case"list":{let a=i;r=r.concat(this.walkTokens(a.items,e));break}default:{let a=i;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let p=a[l].flat(1/0);r=r.concat(this.walkTokens(p,e))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=e.renderers[o.name];i?e.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[o.level];i?i.unshift(o.tokenizer):e[o.level]=[o.tokenizer],o.start&&(o.level==="block"?e.startBlock?e.startBlock.push(o.start):e.startBlock=[o.start]:o.level==="inline"&&(e.startInline?e.startInline.push(o.start):e.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(e.childTokens[o.name]=o.childTokens)}),s.extensions=e),r.renderer){let o=this.defaults.renderer||new Pe(this.defaults);for(let i in r.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=r.renderer[a],p=o[a];o[a]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u||""}}s.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Ie(this.defaults);for(let i in r.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=r.tokenizer[a],p=o[a];o[a]=(...c)=>{let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}s.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Ce;for(let i in r.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=r.hooks[a],p=o[a];Ce.passThroughHooks.has(i)?o[a]=c=>{if(this.defaults.async&&Ce.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(o,c);return p.call(o,h)})();let u=l.call(o,c);return p.call(o,u)}:o[a]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(o,c);return h===!1&&(h=await p.apply(o,c)),h})();let u=l.apply(o,c);return u===!1&&(u=p.apply(o,c)),u}}s.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return J.lex(t,e??this.defaults)}parser(t,e){return X.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(e):e,l=await(o.hooks?await o.hooks.provideLexer():t?J.lex:J.lexInline)(a,o),p=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():t?X.parse:X.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(c):c})().catch(i);try{o.hooks&&(e=o.hooks.preprocess(e));let a=(o.hooks?o.hooks.provideLexer():t?J.lex:J.lexInline)(e,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?X.parse:X.parseInline)(a,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(t,e){return r=>{if(r.message+=`
67
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+ee(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},ue=new rr;function $(t,e){return ue.parse(t,e)}$.options=$.setOptions=function(t){return ue.setOptions(t),$.defaults=ue.defaults,Ut($.defaults),$};$.getDefaults=st;$.defaults=pe;$.use=function(...t){return ue.use(...t),$.defaults=ue.defaults,Ut($.defaults),$};$.walkTokens=function(t,e){return ue.walkTokens(t,e)};$.parseInline=ue.parseInline;$.Parser=X;$.parser=X.parse;$.Renderer=Pe;$.TextRenderer=ut;$.Lexer=J;$.lexer=J.lex;$.Tokenizer=Ie;$.Hooks=Ce;$.parse=$;$.options;$.setOptions;$.use;$.walkTokens;$.parseInline;X.parse;J.lex;function sr(t){const e=t.match(/^#\s+(.+)$/m);return e?e[1].trim():t.split(`
68
+ `).map(s=>s.trim()).find(s=>s.length>0)||"Untitled"}const Ct={critical:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",high:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",medium:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",low:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"},St={critical:"Critical",high:"High",medium:"Med",low:"Low"};function en(t){const e=t.split(`
69
69
  `),r=e.findIndex(i=>/^#\s+/.test(i));return(r>=0?e.slice(r+1):e).join(`
70
- `).trim()}function Xs(t){return R.parse(t,{async:!1,gfm:!0,breaks:!0})}function en({feature:t,onClick:e,isDragging:r}){const{cardSettings:s}=K(),o=er(t.content),i=Js(t.content),a=t.filePath&&t.filePath.split("/").pop()||"",l=h=>{if(!h)return null;const g=new Date(h),d=new Date,v=g.getTime()-d.getTime(),x=Math.ceil(v/(1e3*60*60*24));return x<0?{text:"Overdue",className:"text-red-500"}:x===0?{text:"Today",className:"text-orange-500"}:x===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:x<=7?{text:`${x}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:g.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},p=t.status==="done"?null:l(t.dueDate),c=h=>{if(!h)return null;const g=new Date(h),v=new Date().getTime()-g.getTime(),x=Math.floor(v/(1e3*60)),k=Math.floor(v/(1e3*60*60)),f=Math.floor(v/(1e3*60*60*24));return x<1?"Just now":x<60?`${x}m ago`:k<24?`${k}h ago`:f===1?"1d ago":f<30?`${f}d ago`:f<365?`${Math.floor(f/30)}mo ago`:`${Math.floor(f/365)}y ago`},u=t.status==="done"?c(t.completedAt):null;return n.jsxs("div",{onClick:e,className:`group relative flex flex-col bg-white dark:bg-zinc-800 rounded-lg border border-zinc-200 dark:border-zinc-700 ${s.compactMode?"p-2 min-h-[4.5rem]":"p-3 min-h-[7rem]"} cursor-pointer hover:shadow-md transition-shadow ${r?"shadow-lg opacity-90":""}`,children:[n.jsxs("div",{className:"flex-1",children:[s.showFileName&&a&&n.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n.jsx(At,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-500"}),n.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-500 truncate flex-1",children:a}),s.showPriorityBadges&&n.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${wt[t.priority]}`,children:jt[t.priority]})]}),n.jsxs("div",{className:`flex items-start gap-2 ${i||s.compactMode?"mb-1":"mb-2"}`,children:[n.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:o}),s.showPriorityBadges&&!(s.showFileName&&a)&&n.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${wt[t.priority]}`,children:jt[t.priority]})]}),i&&!s.compactMode&&n.jsx("div",{className:"text-xs text-zinc-500 dark:text-zinc-400 line-clamp-2 mb-2 card-inline-markdown",dangerouslySetInnerHTML:{__html:Xs(i)}}),s.showLabels&&t.labels.length>0&&n.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[t.labels.slice(0,3).map(h=>n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300",children:h},h)),t.labels.length>3&&n.jsxs("span",{className:"text-xs text-zinc-400",children:["+",t.labels.length-3]})]})]}),n.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[n.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&t.assignee&&t.assignee!=="null"&&n.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:t.assignee.split(/\s+/).map(h=>h[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{children:t.assignee})]})}),t.attachments.length>0&&n.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:[n.jsx(qe,{size:12}),n.jsx("span",{children:t.attachments.length})]}),s.showDueDate&&p&&n.jsxs("div",{className:`flex items-center gap-1 ${p.className}`,children:[n.jsx(Ve,{size:12}),n.jsx("span",{children:p.text})]}),u&&n.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[n.jsx(Ye,{size:12}),n.jsx("span",{children:u})]})]})]})}function tn({column:t,features:e,onFeatureClick:r,onAddFeature:s,onEditColumn:o,onRemoveColumn:i,onDragStart:a,onDragOver:l,onDragOverCard:p,onDrop:c,onDragEnd:u,draggedFeature:h,dropTarget:g,layout:d}){const v=d==="vertical",x=g&&g.columnId===t.id,[k,f]=m.useState(!1),C=m.useRef(null);return m.useEffect(()=>{if(!k)return;const z=b=>{C.current&&!C.current.contains(b.target)&&f(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[k]),n.jsxs("div",{className:v?"flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg",onDragOver:l,onDrop:z=>c(z,t.id),children:[n.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 border-b border-zinc-200 dark:border-zinc-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),n.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:t.name}),n.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:e.length})]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx("button",{type:"button",onClick:()=>s(t.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${t.name}`,children:n.jsx(Fe,{size:16,className:"text-zinc-500"})}),n.jsxs("div",{className:"relative",ref:C,children:[n.jsx("button",{type:"button",onClick:()=>f(!k),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:n.jsx(jr,{size:16,className:"text-zinc-500"})}),k&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[140px]",children:[n.jsxs("button",{type:"button",onClick:()=>{f(!1),o(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[n.jsx(Lt,{size:14}),"Edit List"]}),n.jsxs("button",{type:"button",onClick:()=>{f(!1),i(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[n.jsx(Je,{size:14}),"Remove List"]})]})]})]})]}),n.jsxs("div",{className:v?"flex-1 p-2 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-2 space-y-2 min-h-[200px]",children:[e.map((z,b)=>n.jsxs("div",{children:[x&&g.index===b&&n.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),n.jsx("div",{draggable:!0,onDragStart:T=>a(T,z),onDragOver:T=>p(T,t.id,b),onDragEnd:u,className:`${v?"w-64":""} ${(h==null?void 0:h.id)===z.id?"opacity-40":""}`,children:n.jsx(en,{feature:z,onClick:()=>r(z)})})]},z.id)),x&&g.index===e.length&&e.length>0&&n.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),e.length===0&&n.jsx("div",{className:v?"text-sm text-zinc-400 dark:text-zinc-500 py-4":"text-center py-8 text-sm text-zinc-400 dark:text-zinc-500",children:"No features"})]})]})}function rn({onFeatureClick:t,onAddFeature:e,onMoveFeature:r,onEditColumn:s,onRemoveColumn:o}){const i=K(z=>z.columns),a=K(z=>z.getFilteredFeaturesByStatus),l=K(z=>z.getFeaturesByStatus),p=K(z=>z.layout),[c,u]=m.useState(null),[h,g]=m.useState(null),d=m.useCallback((z,b)=>{u(b),z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",b.id)},[]),v=m.useCallback(z=>{z.preventDefault(),z.dataTransfer.dropEffect="move"},[]),x=m.useCallback((z,b,T)=>{z.preventDefault(),z.dataTransfer.dropEffect="move";const A=z.currentTarget.getBoundingClientRect(),y=A.top+A.height/2,w=z.clientY<y?T:T+1;g(B=>B&&B.columnId===b&&B.index===w?B:{columnId:b,index:w})},[]),k=m.useCallback((z,b)=>{if(z.preventDefault(),!c)return;const T=a(b);let A;if(h&&h.columnId===b?A=h.index:A=T.length,c.status===b){const P=T.findIndex(H=>H.id===c.id);if(P!==-1&&A>P&&A--,P===A){u(null),g(null);return}}const y=l(b).filter(P=>P.id!==c.id),w=T.filter(P=>P.id!==c.id);let B;if(w.length===0)B=y.length;else if(A>=w.length){const P=w[w.length-1];B=y.findIndex(M=>M.id===P.id)+1}else{const P=w[A];B=y.findIndex(H=>H.id===P.id)}r(c.id,b,B),u(null),g(null)},[c,h,a,l,r]),f=m.useCallback(()=>{u(null),g(null)},[]),C=p==="vertical";return n.jsx("div",{className:C?"h-full overflow-y-auto p-4":"h-full overflow-x-auto p-4",children:n.jsx("div",{className:C?"flex flex-col gap-4":"flex gap-4 h-full min-w-max",children:i.map(z=>n.jsx(tn,{column:z,features:a(z.id),onFeatureClick:t,onAddFeature:e,onEditColumn:s,onRemoveColumn:o,onDragStart:d,onDragOver:v,onDragOverCard:x,onDrop:k,onDragEnd:f,draggedFeature:c,dropTarget:h,layout:p},z.id))})})}function tr(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=tr(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function sn(){for(var t,e,r=0,s="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=tr(t))&&(s&&(s+=" "),s+=e);return s}const ct="-",nn=t=>{const e=an(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:a=>{const l=a.split(ct);return l[0]===""&&l.length!==1&&l.shift(),rr(l,e)||on(a)},getConflictingClassGroupIds:(a,l)=>{const p=r[a]||[];return l&&s[a]?[...p,...s[a]]:p}}},rr=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),o=s?rr(t.slice(1),s):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(ct);return(a=e.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},zt=/^\[(.+)\]$/,on=t=>{if(zt.test(t)){const e=zt.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},an=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return cn(Object.entries(t.classGroups),r).forEach(([i,a])=>{Qe(a,s,i,e)}),s},Qe=(t,e,r,s)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:Ct(e,o);i.classGroupId=r;return}if(typeof o=="function"){if(ln(o)){Qe(o(s),e,r,s);return}e.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Qe(a,Ct(e,i),r,s)})})},Ct=(t,e)=>{let r=t;return e.split(ct).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},ln=t=>t.isThemeGetter,cn=(t,e)=>e?t.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[e+a,l])):i);return[r,o]}):t,dn=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const o=(i,a)=>{r.set(i,a),e++,e>t&&(e=0,s=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},sr="!",un=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,o=e[0],i=e.length,a=l=>{const p=[];let c=0,u=0,h;for(let k=0;k<l.length;k++){let f=l[k];if(c===0){if(f===o&&(s||l.slice(k,k+i)===e)){p.push(l.slice(u,k)),u=k+i;continue}if(f==="/"){h=k;continue}}f==="["?c++:f==="]"&&c--}const g=p.length===0?l:l.substring(u),d=g.startsWith(sr),v=d?g.substring(1):g,x=h&&h>u?h-u:void 0;return{modifiers:p,hasImportantModifier:d,baseClassName:v,maybePostfixModifierPosition:x}};return r?l=>r({className:l,parseClassName:a}):a},pn=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(s=>{s[0]==="["?(e.push(...r.sort(),s),r=[]):r.push(s)}),e.push(...r.sort()),e},hn=t=>({cache:dn(t.cacheSize),parseClassName:un(t),...nn(t)}),gn=/\s+/,fn=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=e,i=[],a=t.trim().split(gn);let l="";for(let p=a.length-1;p>=0;p-=1){const c=a[p],{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:d}=r(c);let v=!!d,x=s(v?g.substring(0,d):g);if(!x){if(!v){l=c+(l.length>0?" "+l:l);continue}if(x=s(g),!x){l=c+(l.length>0?" "+l:l);continue}v=!1}const k=pn(u).join(":"),f=h?k+sr:k,C=f+x;if(i.includes(C))continue;i.push(C);const z=o(x,v);for(let b=0;b<z.length;++b){const T=z[b];i.push(f+T)}l=c+(l.length>0?" "+l:l)}return l};function xn(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=nr(e))&&(s&&(s+=" "),s+=r);return s}const nr=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=nr(t[s]))&&(r&&(r+=" "),r+=e);return r};function mn(t,...e){let r,s,o,i=a;function a(p){const c=e.reduce((u,h)=>h(u),t());return r=hn(c),s=r.cache.get,o=r.cache.set,i=l,l(p)}function l(p){const c=s(p);if(c)return c;const u=fn(p,r);return o(p,u),u}return function(){return i(xn.apply(null,arguments))}}const I=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},or=/^\[(?:([a-z-]+):)?(.+)\]$/i,bn=/^\d+\/\d+$/,vn=new Set(["px","full","screen"]),kn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,X=t=>he(t)||vn.has(t)||bn.test(t),re=t=>ge(t,"length",Mn),he=t=>!!t&&!Number.isNaN(Number(t)),Oe=t=>ge(t,"number",he),be=t=>!!t&&Number.isInteger(Number(t)),Cn=t=>t.endsWith("%")&&he(t.slice(0,-1)),N=t=>or.test(t),se=t=>kn.test(t),Sn=new Set(["length","size","percentage"]),Nn=t=>ge(t,Sn,ar),Tn=t=>ge(t,"position",ar),Dn=new Set(["image","url"]),An=t=>ge(t,Dn,Rn),Ln=t=>ge(t,"",En),ve=()=>!0,ge=(t,e,r)=>{const s=or.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},Mn=t=>yn.test(t)&&!wn.test(t),ar=()=>!1,En=t=>jn.test(t),Rn=t=>zn.test(t),$n=()=>{const t=I("colors"),e=I("spacing"),r=I("blur"),s=I("brightness"),o=I("borderColor"),i=I("borderRadius"),a=I("borderSpacing"),l=I("borderWidth"),p=I("contrast"),c=I("grayscale"),u=I("hueRotate"),h=I("invert"),g=I("gap"),d=I("gradientColorStops"),v=I("gradientColorStopPositions"),x=I("inset"),k=I("margin"),f=I("opacity"),C=I("padding"),z=I("saturate"),b=I("scale"),T=I("sepia"),A=I("skew"),y=I("space"),w=I("translate"),B=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",N,e],M=()=>[N,e],D=()=>["",X,re],q=()=>["auto",he,N],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ce=()=>["solid","dashed","dotted","double","none"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>["start","end","center","between","around","evenly","stretch"],oe=()=>["","0",N],Se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[he,N];return{cacheSize:500,separator:":",theme:{colors:[ve],spacing:[X,re],blur:["none","",se,N],brightness:W(),borderColor:[t],borderRadius:["none","","full",se,N],borderSpacing:M(),borderWidth:D(),contrast:W(),grayscale:oe(),hueRotate:W(),invert:oe(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[Cn,re],inset:H(),margin:H(),opacity:W(),padding:M(),saturate:W(),scale:W(),sepia:oe(),skew:W(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[se]}],"break-after":[{"break-after":Se()}],"break-before":[{"break-before":Se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),N]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",be,N]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:oe()}],shrink:[{shrink:oe()}],order:[{order:["first","last","none",be,N]}],"grid-cols":[{"grid-cols":[ve]}],"col-start-end":[{col:["auto",{span:["full",be,N]},N]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[ve]}],"row-start-end":[{row:["auto",{span:[be,N]},N]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[y]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,e]}],"min-w":[{"min-w":[N,e,"min","max","fit"]}],"max-w":[{"max-w":[N,e,"none","full","min","max","fit","prose",{screen:[se]},se]}],h:[{h:[N,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,e,"auto","min","max","fit"]}],"font-size":[{text:["base",se,re]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Oe]}],"font-family":[{font:[ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",he,Oe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",X,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",X,re]}],"underline-offset":[{"underline-offset":["auto",X,N]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),Tn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Nn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},An]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...ce(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:ce()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ce()]}],"outline-offset":[{"outline-offset":[X,N]}],"outline-w":[{outline:[X,re]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[X,re]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",se,Ln]}],"shadow-color":[{shadow:[ve]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ce()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",se,N]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[z]}],sepia:[{sepia:[T]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[z]}],"backdrop-sepia":[{"backdrop-sepia":[T]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[be,N]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",N]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[X,re,Oe]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Fn=mn($n);function G(...t){return Fn(sn(t))}const In=["Mo","Tu","We","Th","Fr","Sa","Su"],Bn=["January","February","March","April","May","June","July","August","September","October","November","December"];function Pn({value:t,onChange:e,placeholder:r="Due date"}){const[s,o]=m.useState(!1),i=new Date,a=t?new Date(t+"T00:00:00"):null,[l,p]=m.useState((a==null?void 0:a.getFullYear())??i.getFullYear()),[c,u]=m.useState((a==null?void 0:a.getMonth())??i.getMonth()),h=new Date(l,c+1,0).getDate(),g=(new Date(l,c,1).getDay()+6)%7,d=Array(g).fill(null);for(let b=1;b<=h;b++)d.push(b);const v=()=>{c===0?(u(11),p(b=>b-1)):u(b=>b-1)},x=()=>{c===11?(u(0),p(b=>b+1)):u(b=>b+1)},k=b=>{const T=String(c+1).padStart(2,"0"),A=String(b).padStart(2,"0");e(`${l}-${T}-${A}`),o(!1)},f=b=>b===i.getDate()&&c===i.getMonth()&&l===i.getFullYear(),C=b=>a!==null&&b===a.getDate()&&c===a.getMonth()&&l===a.getFullYear(),z=b=>new Date(b+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:[n.jsx("span",{children:t?z(t):r}),t&&n.jsx("span",{role:"button",onClick:b=>{b.stopPropagation(),e(""),o(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:n.jsx(te,{size:12})})]}),s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),n.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("button",{type:"button",onClick:v,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:n.jsx(zr,{size:14})}),n.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[Bn[c]," ",l]}),n.jsx("button",{type:"button",onClick:x,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:b=>b.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:b=>b.currentTarget.style.background="transparent",children:n.jsx(Cr,{size:14})})]}),n.jsx("div",{className:"grid grid-cols-7 mb-1",children:In.map(b=>n.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:b},b))}),n.jsx("div",{className:"grid grid-cols-7",children:d.map((b,T)=>n.jsx("div",{className:"flex items-center justify-center",children:b?n.jsx("button",{type:"button",onClick:()=>k(b),className:G("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:C(b)?"var(--vscode-focusBorder)":f(b)?"var(--vscode-editor-selectionBackground)":void 0,color:C(b)?"var(--vscode-editor-background)":(f(b),"var(--vscode-foreground)")},onMouseEnter:A=>{C(b)||(A.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:A=>{!C(b)&&!f(b)?A.currentTarget.style.background="transparent":f(b)&&!C(b)&&(A.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:b}):n.jsx("div",{className:"w-7 h-7"})},T))}),n.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:n.jsx("button",{type:"button",onClick:()=>{const b=String(i.getMonth()+1).padStart(2,"0"),T=String(i.getDate()).padStart(2,"0");e(`${i.getFullYear()}-${b}-${T}`),o(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:b=>b.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:b=>b.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}const _n=new Xt({gfm:!0,breaks:!0,renderer:{link({href:t,title:e,tokens:r}){const s=this.parser.parseInline(r),o=e?` title="${e}"`:"";return`<a href="${t}"${o} target="_blank" rel="noopener noreferrer">${s}</a>`}}});function On(t){const e=t.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return _n.parse(e,{async:!1})}function qn({content:t}){const e=m.useMemo(()=>On(t),[t]);return n.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:e}})}function Kn(t){const e=Date.now(),r=new Date(t).getTime(),s=Math.floor((e-r)/1e3);if(s<60)return"just now";const o=Math.floor(s/60);if(o<60)return`${o}m ago`;const i=Math.floor(o/60);if(i<24)return`${i}h ago`;const a=Math.floor(i/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}function Un({comments:t,onAddComment:e,onUpdateComment:r,onDeleteComment:s}){const[o,i]=m.useState(""),[a,l]=m.useState(""),[p,c]=m.useState(null),[u,h]=m.useState(""),g=m.useRef(null),d=()=>{const f=o.trim(),C=a.trim();!f||!C||(e(f,C),l(""))},v=f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&(f.preventDefault(),d())},x=f=>{c(f.id),h(f.content)},k=()=>{!p||!u.trim()||(r(p,u.trim()),c(null),h(""))};return n.jsxs("div",{className:"flex flex-col",children:[t.length>0&&n.jsx("div",{className:"flex flex-col gap-2 px-4 py-3",children:t.map(f=>n.jsxs("div",{className:"rounded p-2 pl-3 text-xs group",style:{background:"var(--vscode-input-background)",borderLeft:"2px solid var(--vscode-textLink-foreground, #3b82f6)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.author.split(/\s+/).filter(Boolean).map(C=>C[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:f.author}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},children:Kn(f.created)})]}),n.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>x(f),className:"p-0.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:n.jsx(Lt,{size:10})}),n.jsx("button",{onClick:()=>s(f.id),className:"p-0.5 rounded transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:n.jsx(Je,{size:10})})]})]}),p===f.id?n.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[n.jsx("textarea",{value:u,onChange:C=>h(C.target.value),className:"w-full rounded px-2 py-1 text-xs resize-none outline-none",style:{background:"var(--vscode-editor-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},rows:2,onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),k()),C.key==="Escape"&&c(null)},autoFocus:!0}),n.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[n.jsx("button",{onClick:()=>c(null),className:"px-2 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"}),n.jsx("button",{onClick:k,className:"px-2 py-0.5 text-[10px] font-medium rounded transition-colors",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"Save"})]})]}):n.jsx(qn,{content:f.content})]},f.id))}),n.jsxs("div",{className:"px-4 pb-3 flex flex-col gap-1.5",children:[n.jsx("input",{type:"text",value:o,onChange:f=>i(f.target.value),placeholder:"Your name",className:"w-full rounded px-2 py-1 text-xs outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"}}),n.jsxs("div",{className:"flex items-end gap-1.5",children:[n.jsx("textarea",{ref:g,value:a,onChange:f=>l(f.target.value),onKeyDown:v,placeholder:"Add a comment...",className:"flex-1 rounded px-2 py-1 text-xs resize-none outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},rows:2}),n.jsx("button",{onClick:d,disabled:!o.trim()||!a.trim(),className:"shrink-0 p-1.5 rounded transition-colors disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:"Send (Cmd+Enter)",children:n.jsx(Sr,{size:12})})]})]})]})}function Gn(t,e,r,s){const o=t.selectionStart,i=t.selectionEnd,a=e.substring(o,i);let l=e.substring(0,o);const p=e.substring(i);let c=a,u=0;switch(s){case"heading":{const g=e.lastIndexOf(`
70
+ `).trim()}function tn(t){return $.parse(t,{async:!1,gfm:!0,breaks:!0})}function rn({feature:t,onClick:e,isDragging:r}){const{cardSettings:s}=U(),o=sr(t.content),i=en(t.content),a=t.filePath&&t.filePath.split("/").pop()||"",l=h=>{if(!h)return null;const g=new Date(h),d=new Date,v=g.getTime()-d.getTime(),f=Math.ceil(v/(1e3*60*60*24));return f<0?{text:"Overdue",className:"text-red-500"}:f===0?{text:"Today",className:"text-orange-500"}:f===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:f<=7?{text:`${f}d`,className:"text-zinc-500 dark:text-zinc-400"}:{text:g.toLocaleDateString("en-US",{month:"short",day:"numeric"}),className:"text-zinc-500 dark:text-zinc-400"}},p=t.status==="done"?null:l(t.dueDate),c=h=>{if(!h)return null;const g=new Date(h),v=new Date().getTime()-g.getTime(),f=Math.floor(v/(1e3*60)),y=Math.floor(v/(1e3*60*60)),b=Math.floor(v/(1e3*60*60*24));return f<1?"Just now":f<60?`${f}m ago`:y<24?`${y}h ago`:b===1?"1d ago":b<30?`${b}d ago`:b<365?`${Math.floor(b/30)}mo ago`:`${Math.floor(b/365)}y ago`},u=t.status==="done"?c(t.completedAt):null;return n.jsxs("div",{onClick:e,className:`group relative flex flex-col bg-white dark:bg-zinc-800 rounded-lg border border-zinc-200 dark:border-zinc-700 ${s.compactMode?"p-2 min-h-[4.5rem]":"p-3 min-h-[7rem]"} cursor-pointer hover:shadow-md transition-shadow ${r?"shadow-lg opacity-90":""}`,children:[n.jsxs("div",{className:"flex-1",children:[s.showFileName&&a&&n.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n.jsx(Mt,{size:10,className:"shrink-0 text-zinc-400 dark:text-zinc-500"}),n.jsx("span",{className:"text-[10px] font-mono text-zinc-400 dark:text-zinc-500 truncate flex-1",children:a}),s.showPriorityBadges&&n.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded shrink-0 ${Ct[t.priority]}`,children:St[t.priority]})]}),n.jsxs("div",{className:`flex items-start gap-2 ${i||s.compactMode?"mb-1":"mb-2"}`,children:[n.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100 line-clamp-2 flex-1",children:o}),s.showPriorityBadges&&!(s.showFileName&&a)&&n.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded shrink-0 ${Ct[t.priority]}`,children:St[t.priority]})]}),i&&!s.compactMode&&n.jsx("div",{className:"text-xs text-zinc-500 dark:text-zinc-400 line-clamp-2 mb-2 card-inline-markdown",dangerouslySetInnerHTML:{__html:tn(i)}}),s.showLabels&&t.labels.length>0&&n.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[t.labels.slice(0,3).map(h=>n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300",children:h},h)),t.labels.length>3&&n.jsxs("span",{className:"text-xs text-zinc-400",children:["+",t.labels.length-3]})]})]}),n.jsxs("div",{className:"flex items-center justify-between text-xs mt-auto",children:[n.jsx("div",{className:"flex items-center gap-1",children:s.showAssignee&&t.assignee&&t.assignee!=="null"&&n.jsxs("div",{className:"flex items-center gap-1.5 text-zinc-500 dark:text-zinc-400",children:[n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold bg-zinc-200 dark:bg-zinc-600 text-zinc-700 dark:text-zinc-300",children:t.assignee.split(/\s+/).map(h=>h[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{children:t.assignee})]})}),t.attachments.length>0&&n.jsxs("div",{className:"flex items-center gap-1 text-zinc-400 dark:text-zinc-500",children:[n.jsx(He,{size:12}),n.jsx("span",{children:t.attachments.length})]}),s.showDueDate&&p&&n.jsxs("div",{className:`flex items-center gap-1 ${p.className}`,children:[n.jsx(et,{size:12}),n.jsx("span",{children:p.text})]}),u&&n.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[n.jsx(_e,{size:12}),n.jsx("span",{children:u})]})]})]})}function sn({column:t,features:e,onFeatureClick:r,onAddFeature:s,onEditColumn:o,onRemoveColumn:i,onDragStart:a,onDragOver:l,onDragOverCard:p,onDrop:c,onDragEnd:u,draggedFeature:h,dropTarget:g,layout:d}){const v=d==="vertical",f=g&&g.columnId===t.id,[y,b]=x.useState(!1),z=x.useRef(null);return x.useEffect(()=>{if(!y)return;const k=m=>{z.current&&!z.current.contains(m.target)&&b(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[y]),n.jsxs("div",{className:v?"flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-100 dark:bg-zinc-800 rounded-lg",onDragOver:l,onDrop:k=>c(k,t.id),children:[n.jsxs("div",{className:"flex items-center justify-between w-full px-3 py-2 border-b border-zinc-200 dark:border-zinc-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),n.jsx("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:t.name}),n.jsx("span",{className:"text-xs text-zinc-500 dark:text-zinc-400 bg-zinc-200 dark:bg-zinc-700 px-1.5 py-0.5 rounded-full",children:e.length})]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx("button",{type:"button",onClick:()=>s(t.id),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:`Add to ${t.name}`,children:n.jsx(Se,{size:16,className:"text-zinc-500"})}),n.jsxs("div",{className:"relative",ref:z,children:[n.jsx("button",{type:"button",onClick:()=>b(!y),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:n.jsx(Cr,{size:16,className:"text-zinc-500"})}),y&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg py-1 min-w-[140px]",children:[n.jsxs("button",{type:"button",onClick:()=>{b(!1),o(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-zinc-700 dark:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[n.jsx(Rt,{size:14}),"Edit List"]}),n.jsxs("button",{type:"button",onClick:()=>{b(!1),i(t.id)},className:"flex items-center gap-2 w-full px-3 py-1.5 text-sm text-red-600 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:[n.jsx(tt,{size:14}),"Remove List"]})]})]})]})]}),n.jsxs("div",{className:v?"flex-1 p-2 flex flex-wrap gap-2":"flex-1 overflow-y-auto p-2 space-y-2 min-h-[200px]",children:[e.map((k,m)=>n.jsxs("div",{children:[f&&g.index===m&&n.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),n.jsx("div",{draggable:!0,onDragStart:M=>a(M,k),onDragOver:M=>p(M,t.id,m),onDragEnd:u,className:`${v?"w-64":""} ${(h==null?void 0:h.id)===k.id?"opacity-40":""}`,children:n.jsx(rn,{feature:k,onClick:()=>r(k)})})]},k.id)),f&&g.index===e.length&&e.length>0&&n.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1"}),e.length===0&&n.jsx("div",{className:v?"text-sm text-zinc-400 dark:text-zinc-500 py-4":"text-center py-8 text-sm text-zinc-400 dark:text-zinc-500",children:"No features"})]})]})}function nn({onFeatureClick:t,onAddFeature:e,onMoveFeature:r,onEditColumn:s,onRemoveColumn:o}){const i=U(k=>k.columns),a=U(k=>k.getFilteredFeaturesByStatus),l=U(k=>k.getFeaturesByStatus),p=U(k=>k.layout),[c,u]=x.useState(null),[h,g]=x.useState(null),d=x.useCallback((k,m)=>{u(m),k.dataTransfer.effectAllowed="move",k.dataTransfer.setData("text/plain",m.id)},[]),v=x.useCallback(k=>{k.preventDefault(),k.dataTransfer.dropEffect="move"},[]),f=x.useCallback((k,m,M)=>{k.preventDefault(),k.dataTransfer.dropEffect="move";const E=k.currentTarget.getBoundingClientRect(),w=E.top+E.height/2,C=k.clientY<w?M:M+1;g(_=>_&&_.columnId===m&&_.index===C?_:{columnId:m,index:C})},[]),y=x.useCallback((k,m)=>{if(k.preventDefault(),!c)return;const M=a(m);let E;if(h&&h.columnId===m?E=h.index:E=M.length,c.status===m){const O=M.findIndex(G=>G.id===c.id);if(O!==-1&&E>O&&E--,O===E){u(null),g(null);return}}const w=l(m).filter(O=>O.id!==c.id),C=M.filter(O=>O.id!==c.id);let _;if(C.length===0)_=w.length;else if(E>=C.length){const O=C[C.length-1];_=w.findIndex(D=>D.id===O.id)+1}else{const O=C[E];_=w.findIndex(G=>G.id===O.id)}r(c.id,m,_),u(null),g(null)},[c,h,a,l,r]),b=x.useCallback(()=>{u(null),g(null)},[]),z=p==="vertical";return n.jsx("div",{className:z?"h-full overflow-y-auto p-4":"h-full overflow-x-auto p-4",children:n.jsx("div",{className:z?"flex flex-col gap-4":"flex gap-4 h-full min-w-max",children:i.map(k=>n.jsx(sn,{column:k,features:a(k.id),onFeatureClick:t,onAddFeature:e,onEditColumn:s,onRemoveColumn:o,onDragStart:d,onDragOver:v,onDragOverCard:f,onDrop:y,onDragEnd:b,draggedFeature:c,dropTarget:h,layout:p},k.id))})})}function nr(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=nr(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function on(){for(var t,e,r=0,s="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=nr(t))&&(s&&(s+=" "),s+=e);return s}const pt="-",an=t=>{const e=cn(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:a=>{const l=a.split(pt);return l[0]===""&&l.length!==1&&l.shift(),or(l,e)||ln(a)},getConflictingClassGroupIds:(a,l)=>{const p=r[a]||[];return l&&s[a]?[...p,...s[a]]:p}}},or=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),o=s?or(t.slice(1),s):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(pt);return(a=e.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},Nt=/^\[(.+)\]$/,ln=t=>{if(Nt.test(t)){const e=Nt.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},cn=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return un(Object.entries(t.classGroups),r).forEach(([i,a])=>{Xe(a,s,i,e)}),s},Xe=(t,e,r,s)=>{t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:Tt(e,o);i.classGroupId=r;return}if(typeof o=="function"){if(dn(o)){Xe(o(s),e,r,s);return}e.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Xe(a,Tt(e,i),r,s)})})},Tt=(t,e)=>{let r=t;return e.split(pt).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},dn=t=>t.isThemeGetter,un=(t,e)=>e?t.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[e+a,l])):i);return[r,o]}):t,pn=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const o=(i,a)=>{r.set(i,a),e++,e>t&&(e=0,s=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},ar="!",hn=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,o=e[0],i=e.length,a=l=>{const p=[];let c=0,u=0,h;for(let y=0;y<l.length;y++){let b=l[y];if(c===0){if(b===o&&(s||l.slice(y,y+i)===e)){p.push(l.slice(u,y)),u=y+i;continue}if(b==="/"){h=y;continue}}b==="["?c++:b==="]"&&c--}const g=p.length===0?l:l.substring(u),d=g.startsWith(ar),v=d?g.substring(1):g,f=h&&h>u?h-u:void 0;return{modifiers:p,hasImportantModifier:d,baseClassName:v,maybePostfixModifierPosition:f}};return r?l=>r({className:l,parseClassName:a}):a},gn=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(s=>{s[0]==="["?(e.push(...r.sort(),s),r=[]):r.push(s)}),e.push(...r.sort()),e},fn=t=>({cache:pn(t.cacheSize),parseClassName:hn(t),...an(t)}),xn=/\s+/,mn=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=e,i=[],a=t.trim().split(xn);let l="";for(let p=a.length-1;p>=0;p-=1){const c=a[p],{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:d}=r(c);let v=!!d,f=s(v?g.substring(0,d):g);if(!f){if(!v){l=c+(l.length>0?" "+l:l);continue}if(f=s(g),!f){l=c+(l.length>0?" "+l:l);continue}v=!1}const y=gn(u).join(":"),b=h?y+ar:y,z=b+f;if(i.includes(z))continue;i.push(z);const k=o(f,v);for(let m=0;m<k.length;++m){const M=k[m];i.push(b+M)}l=c+(l.length>0?" "+l:l)}return l};function bn(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=lr(e))&&(s&&(s+=" "),s+=r);return s}const lr=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=lr(t[s]))&&(r&&(r+=" "),r+=e);return r};function vn(t,...e){let r,s,o,i=a;function a(p){const c=e.reduce((u,h)=>h(u),t());return r=fn(c),s=r.cache.get,o=r.cache.set,i=l,l(p)}function l(p){const c=s(p);if(c)return c;const u=mn(p,r);return o(p,u),u}return function(){return i(bn.apply(null,arguments))}}const I=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},ir=/^\[(?:([a-z-]+):)?(.+)\]$/i,kn=/^\d+\/\d+$/,yn=new Set(["px","full","screen"]),wn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,zn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=t=>me(t)||yn.has(t)||kn.test(t),ie=t=>be(t,"length",Rn),me=t=>!!t&&!Number.isNaN(Number(t)),Ge=t=>be(t,"number",me),ye=t=>!!t&&Number.isInteger(Number(t)),Nn=t=>t.endsWith("%")&&me(t.slice(0,-1)),A=t=>ir.test(t),ce=t=>wn.test(t),Tn=new Set(["length","size","percentage"]),Dn=t=>be(t,Tn,cr),An=t=>be(t,"position",cr),En=new Set(["image","url"]),Ln=t=>be(t,En,Fn),Mn=t=>be(t,"",$n),we=()=>!0,be=(t,e,r)=>{const s=ir.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},Rn=t=>jn.test(t)&&!zn.test(t),cr=()=>!1,$n=t=>Cn.test(t),Fn=t=>Sn.test(t),Bn=()=>{const t=I("colors"),e=I("spacing"),r=I("blur"),s=I("brightness"),o=I("borderColor"),i=I("borderRadius"),a=I("borderSpacing"),l=I("borderWidth"),p=I("contrast"),c=I("grayscale"),u=I("hueRotate"),h=I("invert"),g=I("gap"),d=I("gradientColorStops"),v=I("gradientColorStopPositions"),f=I("inset"),y=I("margin"),b=I("opacity"),z=I("padding"),k=I("saturate"),m=I("scale"),M=I("sepia"),E=I("skew"),w=I("space"),C=I("translate"),_=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto",A,e],D=()=>[A,e],N=()=>["",oe,ie],q=()=>["auto",me,A],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],te=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",A],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[me,A];return{cacheSize:500,separator:":",theme:{colors:[we],spacing:[oe,ie],blur:["none","",ce,A],brightness:Z(),borderColor:[t],borderRadius:["none","","full",ce,A],borderSpacing:D(),borderWidth:N(),contrast:Z(),grayscale:V(),hueRotate:Z(),invert:V(),gap:D(),gradientColorStops:[t],gradientColorStopPositions:[Nn,ie],inset:G(),margin:G(),opacity:Z(),padding:D(),saturate:Z(),scale:Z(),sepia:V(),skew:Z(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",A]}],container:["container"],columns:[{columns:[ce]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Q(),A]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ye,A]}],basis:[{basis:G()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",A]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",ye,A]}],"grid-cols":[{"grid-cols":[we]}],"col-start-end":[{col:["auto",{span:["full",ye,A]},A]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[we]}],"row-start-end":[{row:["auto",{span:[ye,A]},A]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",A]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",A]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...se()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...se(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...se(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[z]}],px:[{px:[z]}],py:[{py:[z]}],ps:[{ps:[z]}],pe:[{pe:[z]}],pt:[{pt:[z]}],pr:[{pr:[z]}],pb:[{pb:[z]}],pl:[{pl:[z]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",A,e]}],"min-w":[{"min-w":[A,e,"min","max","fit"]}],"max-w":[{"max-w":[A,e,"none","full","min","max","fit","prose",{screen:[ce]},ce]}],h:[{h:[A,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[A,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[A,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[A,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ce,ie]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ge]}],"font-family":[{font:[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",A]}],"line-clamp":[{"line-clamp":["none",me,Ge]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oe,A]}],"list-image":[{"list-image":["none",A]}],"list-style-type":[{list:["none","disc","decimal",A]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oe,ie]}],"underline-offset":[{"underline-offset":["auto",oe,A]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Q(),An]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ln]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...te(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:te()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...te()]}],"outline-offset":[{"outline-offset":[oe,A]}],"outline-w":[{outline:[oe,ie]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[oe,ie]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ce,Mn]}],"shadow-color":[{shadow:[we]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",ce,A]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[k]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",A]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",A]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",A]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[m]}],"scale-x":[{"scale-x":[m]}],"scale-y":[{"scale-y":[m]}],rotate:[{rotate:[ye,A]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",A]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",A]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",A]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[oe,ie,Ge]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},In=vn(Bn);function W(...t){return In(on(t))}const Pn=["Mo","Tu","We","Th","Fr","Sa","Su"],_n=["January","February","March","April","May","June","July","August","September","October","November","December"];function On({value:t,onChange:e,placeholder:r="Due date"}){const[s,o]=x.useState(!1),i=new Date,a=t?new Date(t+"T00:00:00"):null,[l,p]=x.useState((a==null?void 0:a.getFullYear())??i.getFullYear()),[c,u]=x.useState((a==null?void 0:a.getMonth())??i.getMonth()),h=new Date(l,c+1,0).getDate(),g=(new Date(l,c,1).getDay()+6)%7,d=Array(g).fill(null);for(let m=1;m<=h;m++)d.push(m);const v=()=>{c===0?(u(11),p(m=>m-1)):u(m=>m-1)},f=()=>{c===11?(u(0),p(m=>m+1)):u(m=>m+1)},y=m=>{const M=String(c+1).padStart(2,"0"),E=String(m).padStart(2,"0");e(`${l}-${M}-${E}`),o(!1)},b=m=>m===i.getDate()&&c===i.getMonth()&&l===i.getFullYear(),z=m=>a!==null&&m===a.getDate()&&c===a.getMonth()&&l===a.getFullYear(),k=m=>new Date(m+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>o(!s),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:[n.jsx("span",{children:t?k(t):r}),t&&n.jsx("span",{role:"button",onClick:m=>{m.stopPropagation(),e(""),o(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:n.jsx(le,{size:12})})]}),s&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),n.jsxs("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg p-3 w-[252px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("button",{type:"button",onClick:v,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:n.jsx(Sr,{size:14})}),n.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[_n[c]," ",l]}),n.jsx("button",{type:"button",onClick:f,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:m=>m.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:m=>m.currentTarget.style.background="transparent",children:n.jsx(Nr,{size:14})})]}),n.jsx("div",{className:"grid grid-cols-7 mb-1",children:Pn.map(m=>n.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:m},m))}),n.jsx("div",{className:"grid grid-cols-7",children:d.map((m,M)=>n.jsx("div",{className:"flex items-center justify-center",children:m?n.jsx("button",{type:"button",onClick:()=>y(m),className:W("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:z(m)?"var(--vscode-focusBorder)":b(m)?"var(--vscode-editor-selectionBackground)":void 0,color:z(m)?"var(--vscode-editor-background)":(b(m),"var(--vscode-foreground)")},onMouseEnter:E=>{z(m)||(E.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:E=>{!z(m)&&!b(m)?E.currentTarget.style.background="transparent":b(m)&&!z(m)&&(E.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:m}):n.jsx("div",{className:"w-7 h-7"})},M))}),n.jsx("div",{className:"mt-2 pt-2 flex justify-center",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:n.jsx("button",{type:"button",onClick:()=>{const m=String(i.getMonth()+1).padStart(2,"0"),M=String(i.getDate()).padStart(2,"0");e(`${i.getFullYear()}-${m}-${M}`),o(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:m=>m.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:m=>m.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}const qn=new rr({gfm:!0,breaks:!0,renderer:{link({href:t,title:e,tokens:r}){const s=this.parser.parseInline(r),o=e?` title="${e}"`:"";return`<a href="${t}"${o} target="_blank" rel="noopener noreferrer">${s}</a>`}}});function Kn(t){const e=t.replace(new RegExp(`(?<!\\]\\(|"|'|<)(https?:\\/\\/[^\\s<>\\])"']+)`,"g"),"<$1>");return qn.parse(e,{async:!1})}function Un({content:t}){const e=x.useMemo(()=>Kn(t),[t]);return n.jsx("div",{className:"comment-markdown",style:{color:"var(--vscode-foreground)"},dangerouslySetInnerHTML:{__html:e}})}function Gn(t){const e=Date.now(),r=new Date(t).getTime(),s=Math.floor((e-r)/1e3);if(s<60)return"just now";const o=Math.floor(s/60);if(o<60)return`${o}m ago`;const i=Math.floor(o/60);if(i<24)return`${i}h ago`;const a=Math.floor(i/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}function Hn({comments:t,onAddComment:e,onUpdateComment:r,onDeleteComment:s}){const[o,i]=x.useState(""),[a,l]=x.useState(""),[p,c]=x.useState(null),[u,h]=x.useState(""),g=x.useRef(null),d=()=>{const b=o.trim(),z=a.trim();!b||!z||(e(b,z),l(""))},v=b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),d())},f=b=>{c(b.id),h(b.content)},y=()=>{!p||!u.trim()||(r(p,u.trim()),c(null),h(""))};return n.jsxs("div",{className:"flex flex-col",children:[t.length>0&&n.jsx("div",{className:"flex flex-col gap-2 px-4 py-3",children:t.map(b=>n.jsxs("div",{className:"rounded p-2 pl-3 text-xs group",style:{background:"var(--vscode-input-background)",borderLeft:"2px solid var(--vscode-textLink-foreground, #3b82f6)"},children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:b.author.split(/\s+/).filter(Boolean).map(z=>z[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:b.author}),n.jsx("span",{className:"text-[10px]",style:{color:"var(--vscode-descriptionForeground)"},children:Gn(b.created)})]}),n.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>f(b),className:"p-0.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},title:"Edit",children:n.jsx(Rt,{size:10})}),n.jsx("button",{onClick:()=>s(b.id),className:"p-0.5 rounded transition-colors hover:text-red-500",style:{color:"var(--vscode-descriptionForeground)"},title:"Delete",children:n.jsx(tt,{size:10})})]})]}),p===b.id?n.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[n.jsx("textarea",{value:u,onChange:z=>h(z.target.value),className:"w-full rounded px-2 py-1 text-xs resize-none outline-none",style:{background:"var(--vscode-editor-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},rows:2,onKeyDown:z=>{z.key==="Enter"&&(z.metaKey||z.ctrlKey)&&(z.preventDefault(),y()),z.key==="Escape"&&c(null)},autoFocus:!0}),n.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[n.jsx("button",{onClick:()=>c(null),className:"px-2 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:"Cancel"}),n.jsx("button",{onClick:y,className:"px-2 py-0.5 text-[10px] font-medium rounded transition-colors",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},children:"Save"})]})]}):n.jsx(Un,{content:b.content})]},b.id))}),n.jsxs("div",{className:"px-4 pb-3 flex flex-col gap-1.5",children:[n.jsx("input",{type:"text",value:o,onChange:b=>i(b.target.value),placeholder:"Your name",className:"w-full rounded px-2 py-1 text-xs outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"}}),n.jsxs("div",{className:"flex items-end gap-1.5",children:[n.jsx("textarea",{ref:g,value:a,onChange:b=>l(b.target.value),onKeyDown:v,placeholder:"Add a comment...",className:"flex-1 rounded px-2 py-1 text-xs resize-none outline-none",style:{background:"var(--vscode-input-background)",color:"var(--vscode-foreground)",border:"1px solid var(--vscode-input-border, var(--vscode-panel-border))"},rows:2}),n.jsx("button",{onClick:d,disabled:!o.trim()||!a.trim(),className:"shrink-0 p-1.5 rounded transition-colors disabled:opacity-30",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},title:"Send (Cmd+Enter)",children:n.jsx(Tr,{size:12})})]})]})]})}function Wn(t,e,r,s){const o=t.selectionStart,i=t.selectionEnd,a=e.substring(o,i);let l=e.substring(0,o);const p=e.substring(i);let c=a,u=0;switch(s){case"heading":{const g=e.lastIndexOf(`
71
71
  `,o-1)+1,d=e.substring(g,o);d.startsWith("### ")?(l=e.substring(0,g)+d.slice(4),c=a,u=-4):d.startsWith("## ")?(l=e.substring(0,g)+"### "+d.slice(3),c=a,u=1):d.startsWith("# ")?(l=e.substring(0,g)+"## "+d.slice(2),c=a,u=1):(l=e.substring(0,g)+"# "+d,c=a,u=2);break}case"bold":c=a?`**${a}**`:"**bold**",u=a?4:2;break;case"italic":c=a?`_${a}_`:"_italic_",u=a?2:1;break;case"quote":{c=a?a.split(`
72
72
  `).map(d=>`> ${d}`).join(`
73
73
  `):"> ",u=a?c.length-a.length:2;break}case"code":a.includes(`
@@ -79,7 +79,7 @@ ${a}
79
79
  `).map((d,v)=>`${v+1}. ${d}`).join(`
80
80
  `):"1. ",u=a?c.length-a.length:3;break}case"tasklist":{c=a?a.split(`
81
81
  `).map(d=>`- [ ] ${d}`).join(`
82
- `):"- [ ] ",u=a?c.length-a.length:6;break}}const h=l+c+p;r(h),requestAnimationFrame(()=>{t.focus();const g=o+(a?c.length:u);t.selectionStart=t.selectionEnd=g})}function ee({icon:t,title:e,onClick:r,separator:s}){return n.jsxs(n.Fragment,{children:[s&&n.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),n.jsx("button",{type:"button",onClick:r,title:e,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:t})]})}function lr({value:t,onChange:e,placeholder:r="Write markdown...",className:s,autoFocus:o,comments:i,onAddComment:a,onUpdateComment:l,onDeleteComment:p}){const[c,u]=m.useState("write"),h=m.useRef(null),g=m.useMemo(()=>t.trim()?R.parse(t,{async:!1,gfm:!0,breaks:!0}):"",[t]);m.useEffect(()=>{c==="write"&&h.current&&h.current.focus()},[c]),m.useEffect(()=>{o&&h.current&&h.current.focus()},[o]);const d=m.useCallback(x=>{h.current&&Gn(h.current,t,e,x)},[t,e]),v=x=>{if(x.key==="Tab"){x.preventDefault();const k=x.currentTarget,f=k.selectionStart,C=k.selectionEnd,z=t.substring(0,f)+" "+t.substring(C);e(z),requestAnimationFrame(()=>{k.selectionStart=k.selectionEnd=f+2})}(x.metaKey||x.ctrlKey)&&x.key==="b"&&(x.preventDefault(),x.stopPropagation(),d("bold")),(x.metaKey||x.ctrlKey)&&x.key==="i"&&(x.preventDefault(),d("italic")),(x.metaKey||x.ctrlKey)&&x.key==="k"&&(x.preventDefault(),d("link"))};return n.jsxs("div",{className:G("flex flex-col h-full",s),children:[n.jsxs("div",{className:"flex items-center shrink-0",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("button",{type:"button",onClick:()=>u("write"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:c==="write"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Write",c==="write"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),n.jsxs("button",{type:"button",onClick:()=>u("preview"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:c==="preview"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Preview",c==="preview"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),i&&n.jsxs("button",{type:"button",onClick:()=>u("comments"),className:"px-3 py-2 text-xs font-medium transition-colors relative flex items-center gap-1.5",style:{color:c==="comments"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[n.jsx(Nr,{size:12}),"Comments",i.length>0&&n.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:i.length}),c==="comments"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),c==="write"&&n.jsxs("div",{className:"flex items-center ml-auto pr-2 gap-0.5",children:[n.jsx(ee,{icon:n.jsx(Tr,{size:14}),title:"Heading",onClick:()=>d("heading")}),n.jsx(ee,{icon:n.jsx(Dr,{size:14}),title:"Bold (⌘B)",onClick:()=>d("bold")}),n.jsx(ee,{icon:n.jsx(Ar,{size:14}),title:"Italic (⌘I)",onClick:()=>d("italic")}),n.jsx(ee,{icon:n.jsx(Lr,{size:14}),title:"Quote",onClick:()=>d("quote"),separator:!0}),n.jsx(ee,{icon:n.jsx(Mr,{size:14}),title:"Code",onClick:()=>d("code")}),n.jsx(ee,{icon:n.jsx(Er,{size:14}),title:"Link (⌘K)",onClick:()=>d("link")}),n.jsx(ee,{icon:n.jsx(Rr,{size:14}),title:"Bulleted list",onClick:()=>d("ul"),separator:!0}),n.jsx(ee,{icon:n.jsx($r,{size:14}),title:"Numbered list",onClick:()=>d("ol")}),n.jsx(ee,{icon:n.jsx(Fr,{size:14}),title:"Task list",onClick:()=>d("tasklist")})]})]}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[c==="write"&&n.jsx("textarea",{ref:h,value:t,onChange:x=>e(x.target.value),onKeyDown:v,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),c==="preview"&&n.jsx("div",{className:"min-h-[200px]",children:g?n.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:g}}):n.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),c==="comments"&&i&&a&&l&&p&&n.jsx(Un,{comments:i,onAddComment:a,onUpdateComment:l,onDeleteComment:p})]})]})}const Hn=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],Wn=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function St({value:t,options:e,onChange:r,className:s}){const[o,i]=m.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:G("relative",s),children:[n.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Ie,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(l=>n.jsxs("button",{type:"button",onClick:()=>{r(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==t&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==t&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label}),l.value===t&&n.jsx(Ye,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},l.value))})]})]})}function Zn({value:t,onChange:e}){const[r,s]=m.useState(!1),o=m.useRef(null),i=m.useRef(null),a=K(h=>h.features),l=m.useMemo(()=>{const h=new Set;return a.forEach(g=>{g.assignee&&h.add(g.assignee)}),Array.from(h).sort()},[a]),p=m.useMemo(()=>t.trim()?l.filter(h=>h.toLowerCase().includes(t.toLowerCase())&&h!==t):l,[t,l]),c=r&&p.length>0,u=t.trim()?t.trim().split(/\s+/).map(h=>h[0]).join("").toUpperCase().slice(0,2):null;return n.jsxs("div",{ref:i,className:"relative flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var h;return(h=o.current)==null?void 0:h.focus()},children:[u&&n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:u}),n.jsx("input",{ref:o,type:"text",value:t,onChange:h=>e(h.target.value),onFocus:()=>s(!0),onBlur:()=>setTimeout(()=>s(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:p.map(h=>n.jsxs("button",{type:"button",onMouseDown:g=>{g.preventDefault(),e(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:g=>g.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:g=>g.currentTarget.style.background="transparent",children:[n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h.split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{children:h})]},h))})]})}function Qn({labels:t,onChange:e}){const[r,s]=m.useState(""),[o,i]=m.useState(!1),a=m.useRef(null),l=K(g=>g.features),p=m.useMemo(()=>{const g=new Set;return l.forEach(d=>d.labels.forEach(v=>g.add(v))),Array.from(g).sort()},[l]),c=m.useMemo(()=>{const g=p.filter(d=>!t.includes(d));return r.trim()?g.filter(d=>d.toLowerCase().includes(r.toLowerCase())):g},[r,p,t]),u=o&&c.length>0,h=g=>{const d=(g||r).trim();d&&!t.includes(d)&&e([...t,d]),s("")};return n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var g;return(g=a.current)==null?void 0:g.focus()},children:[t.map(g=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[g,n.jsx("button",{onClick:d=>{d.stopPropagation(),e(t.filter(v=>v!==g))},className:"hover:text-red-500 transition-colors",children:n.jsx(te,{size:9})})]},g)),n.jsx("input",{ref:a,type:"text",value:r,onChange:g=>s(g.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:g=>{var d;g.key==="Enter"&&(g.preventDefault(),h()),g.key==="Backspace"&&!r&&t.length>0&&e(t.slice(0,-1)),g.key==="Escape"&&(s(""),(d=a.current)==null||d.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),u&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(g=>n.jsx("button",{type:"button",onMouseDown:d=>{d.preventDefault(),h(g)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:d=>d.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:d=>d.currentTarget.style.background="transparent",children:n.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:g})},g))})]})}function ke({label:t,icon:e,children:r}){return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[n.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[n.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),n.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function Vn({isOpen:t,...e}){return t?n.jsx(Yn,{isOpen:t,...e}):null}function Yn({isOpen:t,onClose:e,onCreate:r,initialStatus:s}){const{cardSettings:o}=K(),[i,a]=m.useState(""),[l,p]=m.useState(s??o.defaultStatus),[c,u]=m.useState(o.defaultPriority),[h,g]=m.useState(""),[d,v]=m.useState(""),[x,k]=m.useState([]),[f,C]=m.useState(""),z=m.useRef(null);m.useEffect(()=>{const y=setTimeout(()=>{var w;return(w=z.current)==null?void 0:w.focus()},50);return()=>clearTimeout(y)},[]);const b=()=>{const y=f.trim(),w=i.trim(),B=w?`# ${w}${y?`
82
+ `):"- [ ] ",u=a?c.length-a.length:6;break}}const h=l+c+p;r(h),requestAnimationFrame(()=>{t.focus();const g=o+(a?c.length:u);t.selectionStart=t.selectionEnd=g})}function ae({icon:t,title:e,onClick:r,separator:s}){return n.jsxs(n.Fragment,{children:[s&&n.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--vscode-panel-border)"}}),n.jsx("button",{type:"button",onClick:r,title:e,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:t})]})}function dr({value:t,onChange:e,placeholder:r="Write markdown...",className:s,autoFocus:o,comments:i,onAddComment:a,onUpdateComment:l,onDeleteComment:p}){const[c,u]=x.useState("write"),h=x.useRef(null),g=x.useMemo(()=>t.trim()?$.parse(t,{async:!1,gfm:!0,breaks:!0}):"",[t]);x.useEffect(()=>{c==="write"&&h.current&&h.current.focus()},[c]),x.useEffect(()=>{o&&h.current&&h.current.focus()},[o]);const d=x.useCallback(f=>{h.current&&Wn(h.current,t,e,f)},[t,e]),v=f=>{if(f.key==="Tab"){f.preventDefault();const y=f.currentTarget,b=y.selectionStart,z=y.selectionEnd,k=t.substring(0,b)+" "+t.substring(z);e(k),requestAnimationFrame(()=>{y.selectionStart=y.selectionEnd=b+2})}(f.metaKey||f.ctrlKey)&&f.key==="b"&&(f.preventDefault(),f.stopPropagation(),d("bold")),(f.metaKey||f.ctrlKey)&&f.key==="i"&&(f.preventDefault(),d("italic")),(f.metaKey||f.ctrlKey)&&f.key==="k"&&(f.preventDefault(),d("link"))};return n.jsxs("div",{className:W("flex flex-col h-full",s),children:[n.jsxs("div",{className:"flex items-center shrink-0",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("button",{type:"button",onClick:()=>u("write"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:c==="write"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Write",c==="write"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),n.jsxs("button",{type:"button",onClick:()=>u("preview"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:c==="preview"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Preview",c==="preview"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),i&&n.jsxs("button",{type:"button",onClick:()=>u("comments"),className:"px-3 py-2 text-xs font-medium transition-colors relative flex items-center gap-1.5",style:{color:c==="comments"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:[n.jsx(Dr,{size:12}),"Comments",i.length>0&&n.jsx("span",{className:"text-[10px] px-1 rounded-full",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:i.length}),c==="comments"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),c==="write"&&n.jsxs("div",{className:"flex items-center ml-auto pr-2 gap-0.5",children:[n.jsx(ae,{icon:n.jsx(Ar,{size:14}),title:"Heading",onClick:()=>d("heading")}),n.jsx(ae,{icon:n.jsx(Er,{size:14}),title:"Bold (⌘B)",onClick:()=>d("bold")}),n.jsx(ae,{icon:n.jsx(Lr,{size:14}),title:"Italic (⌘I)",onClick:()=>d("italic")}),n.jsx(ae,{icon:n.jsx(Mr,{size:14}),title:"Quote",onClick:()=>d("quote"),separator:!0}),n.jsx(ae,{icon:n.jsx(Rr,{size:14}),title:"Code",onClick:()=>d("code")}),n.jsx(ae,{icon:n.jsx($r,{size:14}),title:"Link (⌘K)",onClick:()=>d("link")}),n.jsx(ae,{icon:n.jsx(Fr,{size:14}),title:"Bulleted list",onClick:()=>d("ul"),separator:!0}),n.jsx(ae,{icon:n.jsx(Br,{size:14}),title:"Numbered list",onClick:()=>d("ol")}),n.jsx(ae,{icon:n.jsx(Ir,{size:14}),title:"Task list",onClick:()=>d("tasklist")})]})]}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[c==="write"&&n.jsx("textarea",{ref:h,value:t,onChange:f=>e(f.target.value),onKeyDown:v,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}),c==="preview"&&n.jsx("div",{className:"min-h-[200px]",children:g?n.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:g}}):n.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})}),c==="comments"&&i&&a&&l&&p&&n.jsx(Hn,{comments:i,onAddComment:a,onUpdateComment:l,onDeleteComment:p})]})]})}const Zn=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],Qn=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function Dt({value:t,options:e,onChange:r,className:s}){const[o,i]=x.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:W("relative",s),children:[n.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="transparent",children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Te,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(l=>n.jsxs("button",{type:"button",onClick:()=>{r(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==t&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==t&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label}),l.value===t&&n.jsx(_e,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},l.value))})]})]})}function Vn({value:t,onChange:e}){const[r,s]=x.useState(!1),o=x.useRef(null),i=x.useRef(null),a=U(h=>h.features),l=x.useMemo(()=>{const h=new Set;return a.forEach(g=>{g.assignee&&h.add(g.assignee)}),Array.from(h).sort()},[a]),p=x.useMemo(()=>t.trim()?l.filter(h=>h.toLowerCase().includes(t.toLowerCase())&&h!==t):l,[t,l]),c=r&&p.length>0,u=t.trim()?t.trim().split(/\s+/).map(h=>h[0]).join("").toUpperCase().slice(0,2):null;return n.jsxs("div",{ref:i,className:"relative flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 cursor-text",onClick:()=>{var h;return(h=o.current)==null?void 0:h.focus()},children:[u&&n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:u}),n.jsx("input",{ref:o,type:"text",value:t,onChange:h=>e(h.target.value),onFocus:()=>s(!0),onBlur:()=>setTimeout(()=>s(!1),150),placeholder:"No assignee",className:"flex-1 bg-transparent border-none outline-none text-xs",style:{color:t?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]}),c&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:p.map(h=>n.jsxs("button",{type:"button",onMouseDown:g=>{g.preventDefault(),e(h)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:g=>g.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:g=>g.currentTarget.style.background="transparent",children:[n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:h.split(/\s+/).map(g=>g[0]).join("").toUpperCase().slice(0,2)}),n.jsx("span",{children:h})]},h))})]})}function Yn({labels:t,onChange:e}){const[r,s]=x.useState(""),[o,i]=x.useState(!1),a=x.useRef(null),l=U(g=>g.features),p=x.useMemo(()=>{const g=new Set;return l.forEach(d=>d.labels.forEach(v=>g.add(v))),Array.from(g).sort()},[l]),c=x.useMemo(()=>{const g=p.filter(d=>!t.includes(d));return r.trim()?g.filter(d=>d.toLowerCase().includes(r.toLowerCase())):g},[r,p,t]),u=o&&c.length>0,h=g=>{const d=(g||r).trim();d&&!t.includes(d)&&e([...t,d]),s("")};return n.jsxs("div",{className:"relative flex-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap cursor-text",onClick:()=>{var g;return(g=a.current)==null?void 0:g.focus()},children:[t.map(g=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[g,n.jsx("button",{onClick:d=>{d.stopPropagation(),e(t.filter(v=>v!==g))},className:"hover:text-red-500 transition-colors",children:n.jsx(le,{size:9})})]},g)),n.jsx("input",{ref:a,type:"text",value:r,onChange:g=>s(g.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:g=>{var d;g.key==="Enter"&&(g.preventDefault(),h()),g.key==="Backspace"&&!r&&t.length>0&&e(t.slice(0,-1)),g.key==="Escape"&&(s(""),(d=a.current)==null||d.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)"}})]}),u&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(g=>n.jsx("button",{type:"button",onMouseDown:d=>{d.preventDefault(),h(g)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:d=>d.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:d=>d.currentTarget.style.background="transparent",children:n.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:g})},g))})]})}function je({label:t,icon:e,children:r}){return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors",onMouseEnter:s=>s.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:s=>s.currentTarget.style.background="transparent",children:[n.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[n.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),n.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function Jn({isOpen:t,...e}){return t?n.jsx(Xn,{isOpen:t,...e}):null}function Xn({isOpen:t,onClose:e,onCreate:r,initialStatus:s}){const{cardSettings:o}=U(),[i,a]=x.useState(""),[l,p]=x.useState(s??o.defaultStatus),[c,u]=x.useState(o.defaultPriority),[h,g]=x.useState(""),[d,v]=x.useState(""),[f,y]=x.useState([]),[b,z]=x.useState(""),k=x.useRef(null);x.useEffect(()=>{const w=setTimeout(()=>{var C;return(C=k.current)==null?void 0:C.focus()},50);return()=>clearTimeout(w)},[]);const m=()=>{const w=b.trim(),C=i.trim(),_=C?`# ${C}${w?`
83
83
 
84
- ${y}`:""}`:y;r({status:l,priority:c,content:B,assignee:h.trim()||null,dueDate:d||null,labels:x})},T=()=>{b(),e()},A=()=>{e()};return m.useEffect(()=>{const y=w=>{w.key==="Escape"&&A(),(w.metaKey||w.ctrlKey)&&w.key==="Enter"&&T(),(w.metaKey||w.ctrlKey)&&w.key==="s"&&(w.preventDefault(),T())};if(t)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)}),n.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:A}),n.jsxs("div",{className:"relative h-full w-1/2 shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Feature"})}),n.jsx("button",{onClick:A,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:n.jsx(te,{size:18})})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(ke,{label:"Status",icon:n.jsx(Mt,{size:13}),children:n.jsx(St,{value:l,options:Wn.map(y=>({value:y.value,label:y.label,dot:y.dot})),onChange:y=>p(y)})}),o.showPriorityBadges&&n.jsx(ke,{label:"Priority",icon:n.jsx(Et,{size:13}),children:n.jsx(St,{value:c,options:Hn.map(y=>({value:y.value,label:y.label,dot:y.dot})),onChange:y=>u(y)})}),o.showAssignee&&n.jsx(ke,{label:"Assignee",icon:n.jsx(Rt,{size:13}),children:n.jsx(Zn,{value:h,onChange:g})}),o.showDueDate&&n.jsx(ke,{label:"Due date",icon:n.jsx(Ve,{size:13}),children:n.jsx(Pn,{value:d,onChange:v})}),o.showLabels&&n.jsx(ke,{label:"Labels",icon:n.jsx($t,{size:13}),children:n.jsx(Qn,{labels:x,onChange:k})})]}),n.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[n.jsx("textarea",{ref:z,value:i,onChange:y=>a(y.target.value),placeholder:"Feature title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:y=>{const w=y.target;w.style.height="auto",w.style.height=w.scrollHeight+"px"},onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&y.preventDefault()}}),n.jsx(lr,{value:f,onChange:C,placeholder:"Add a description..."})]}),n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[n.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[n.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",n.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="transparent",children:"Cancel"}),n.jsx("button",{type:"button",onClick:T,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:y=>y.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:y=>y.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}const Jn={critical:"Critical",high:"High",medium:"Medium",low:"Low"},Xn={backlog:"Backlog",todo:"To Do","in-progress":"In Progress",review:"Review",done:"Done"},eo=["critical","high","medium","low"],to=["backlog","todo","in-progress","review","done"],ro={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},so={backlog:"bg-zinc-400",todo:"bg-blue-400","in-progress":"bg-amber-400",review:"bg-purple-400",done:"bg-emerald-400"},no=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],oo={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},ao={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function Nt({value:t,options:e,onChange:r,className:s}){const[o,i]=m.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:G("relative",s),children:[n.jsxs("button",{onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Ie,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(l=>n.jsxs("button",{onClick:()=>{r(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==t&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==t&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label}),l.value===t&&n.jsx(Ye,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},l.value))})]})]})}function de({label:t,icon:e,children:r}){return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors vscode-hover-bg",children:[n.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[n.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),n.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function lo({onSelect:t}){const[e,r]=m.useState(!1),[s,o]=m.useState("claude"),i=ao[s],a=oo[s];return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>r(!e),className:G("flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-white rounded-md transition-colors",a.bg,a.hover,a.shadow,a.border),children:[n.jsx(Ir,{size:13}),n.jsx("span",{children:"Build with AI"}),n.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),n.jsx(Ie,{size:11,className:G("ml-0.5 opacity-60 transition-transform",e&&"rotate-180")})]}),e&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>r(!1)}),n.jsxs("div",{className:"absolute top-full right-0 mt-1 z-20 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[260px] overflow-hidden",children:[n.jsx("div",{className:"flex",children:no.map(l=>n.jsx("button",{onClick:()=>o(l.agent),className:G("flex-1 px-3 py-2.5 text-xs font-medium transition-all",s===l.agent?l.activeColor:G("text-zinc-600 dark:text-zinc-400",l.color)),children:l.label},l.agent))}),n.jsx("div",{className:"p-2 space-y-1",children:i.map(l=>n.jsxs("button",{onClick:()=>{t(s,l.permissionMode),r(!1)},className:"w-full text-left px-3 py-2.5 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[n.jsx("div",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100",children:l.label}),n.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:l.description})]},l.permissionMode))})]})]})]})}function io({labels:t,onChange:e}){const[r,s]=m.useState(""),[o,i]=m.useState(!1),a=m.useRef(null),l=K(d=>d.features),p=m.useMemo(()=>{const d=new Set;return l.forEach(v=>v.labels.forEach(x=>d.add(x))),Array.from(d).sort()},[l]),c=m.useMemo(()=>{const d=p.filter(v=>!t.includes(v));return r.trim()?d.filter(v=>v.toLowerCase().includes(r.toLowerCase())):d},[r,p,t]),u=o&&c.length>0,h=d=>{const v=(d||r).trim();v&&!t.includes(v)&&e([...t,v]),s("")},g=d=>{e(t.filter(v=>v!==d))};return n.jsxs("div",{className:"relative flex items-center gap-1.5 flex-wrap",children:[t.map(d=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[d,n.jsx("button",{onClick:()=>g(d),className:"hover:text-red-500 transition-colors",children:n.jsx(te,{size:9})})]},d)),n.jsx("button",{onClick:()=>{i(!0),setTimeout(()=>{var d;return(d=a.current)==null?void 0:d.focus()},0)},className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(Fe,{size:10})}),n.jsx("input",{ref:a,type:"text",value:r,onChange:d=>s(d.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:d=>{var v;d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Backspace"&&!r&&t.length>0&&e(t.slice(0,-1)),d.key==="Escape"&&(s(""),(v=a.current)==null||v.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)",display:o||r?"block":"none"}}),u&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(d=>n.jsx("button",{type:"button",onMouseDown:v=>{v.preventDefault(),h(d)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="transparent",children:n.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d})},d))})]})}function co({featureId:t,content:e,frontmatter:r,comments:s,contentVersion:o,onSave:i,onClose:a,onDelete:l,onOpenFile:p,onStartWithAI:c,onAddAttachment:u,onOpenAttachment:h,onRemoveAttachment:g,onAddComment:d,onUpdateComment:v,onDeleteComment:x}){const{cardSettings:k}=K(),[f,C]=m.useState(r),[z,b]=m.useState(e),[T,A]=m.useState(!1),y=m.useRef(null),w=m.useRef(f),B=m.useRef(z);w.current=f,B.current=z;const P=m.useCallback(()=>{i(B.current,w.current)},[i]);m.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]),m.useEffect(()=>{b(e)},[t,o]),m.useEffect(()=>{C(r)},[r]);const H=m.useCallback(D=>{b(D),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{i(D,w.current)},800)},[i]),M=m.useCallback(D=>{C(q=>{const ne={...q,...D};return y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{i(B.current,ne)},800),ne})},[i]);return m.useEffect(()=>{const D=q=>{(q.metaKey||q.ctrlKey)&&q.key==="s"&&(q.preventDefault(),y.current&&clearTimeout(y.current),P()),(q.metaKey||q.ctrlKey)&&q.key==="b"&&k.showBuildWithAI&&(q.preventDefault(),c("claude","default")),q.key==="Escape"&&(y.current&&(clearTimeout(y.current),P()),a())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[P,a,c,k.showBuildWithAI]),n.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-xs font-mono",style:{color:"var(--vscode-descriptionForeground)"},children:t}),T?n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-xs",style:{color:"var(--vscode-errorForeground)"},children:"Delete?"}),n.jsx("button",{onClick:()=>{A(!1),l()},className:"px-2 py-1 text-xs font-medium rounded transition-colors text-white bg-red-600 hover:bg-red-700",children:"Yes"}),n.jsx("button",{onClick:()=>A(!1),className:"px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:"No"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>{p(),a()},className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Open .md file",children:[n.jsx(At,{size:16}),n.jsx("span",{className:"text-xs",children:"OPEN"})]}),n.jsxs("button",{onClick:()=>A(!0),className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Delete ticket",children:[n.jsx(Je,{size:16}),n.jsx("span",{className:"text-xs",children:"DELETE"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[k.showBuildWithAI&&n.jsx(lo,{onSelect:c}),n.jsx("button",{onClick:a,className:"p-1.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(te,{size:18})})]})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(de,{label:"Status",icon:n.jsx(Mt,{size:13}),children:n.jsx(Nt,{value:f.status,options:to.map(D=>({value:D,label:Xn[D],dot:so[D]})),onChange:D=>M({status:D})})}),k.showPriorityBadges&&n.jsx(de,{label:"Priority",icon:n.jsx(Et,{size:13}),children:n.jsx(Nt,{value:f.priority,options:eo.map(D=>({value:D,label:Jn[D],dot:ro[D]})),onChange:D=>M({priority:D})})}),k.showAssignee&&n.jsx(de,{label:"Assignee",icon:n.jsx(Rt,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-2",children:[f.assignee&&n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:f.assignee.split(/\s+/).filter(Boolean).map(D=>D[0]).join("").toUpperCase().slice(0,2)}),n.jsx("input",{type:"text",value:f.assignee||"",onChange:D=>M({assignee:D.target.value||null}),placeholder:"No assignee",className:"bg-transparent border-none outline-none text-xs w-32",style:{color:f.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),k.showDueDate&&n.jsx(de,{label:"Due date",icon:n.jsx(Ve,{size:13}),children:n.jsx("input",{type:"date",value:f.dueDate||"",onChange:D=>M({dueDate:D.target.value||null}),className:"bg-transparent border-none outline-none text-xs",style:{color:f.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),k.showLabels&&n.jsx(de,{label:"Labels",icon:n.jsx($t,{size:13}),children:n.jsx(io,{labels:f.labels,onChange:D=>M({labels:D})})}),n.jsx(de,{label:"Attachments",icon:n.jsx(qe,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[f.attachments.map(D=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[n.jsxs("button",{type:"button",onClick:()=>h(D),className:"inline-flex items-center gap-1 hover:underline",title:D,children:[n.jsx(qe,{size:9}),D]}),n.jsx("button",{type:"button",onClick:()=>g(D),className:"hover:text-red-500 transition-colors",children:n.jsx(te,{size:9})})]},D)),n.jsx("button",{type:"button",onClick:u,className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(Fe,{size:10})})]})})]}),n.jsx(lr,{value:z,onChange:H,placeholder:"Start writing...",className:"flex-1 min-h-0",comments:s,onAddComment:d,onUpdateComment:v,onDeleteComment:x})]})}const uo=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],po=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],Ae="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function ho({onOpenSettings:t,onAddColumn:e,onToggleTheme:r}){const{searchQuery:s,setSearchQuery:o,priorityFilter:i,setPriorityFilter:a,assigneeFilter:l,setAssigneeFilter:p,labelFilter:c,setLabelFilter:u,dueDateFilter:h,setDueDateFilter:g,clearAllFilters:d,getUniqueAssignees:v,getUniqueLabels:x,hasActiveFilters:k,layout:f,toggleLayout:C,isDarkMode:z,cardSettings:b}=K(),T=v(),A=x(),y=k();return n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 flex-wrap",children:[n.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[n.jsx(Br,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),n.jsx("input",{type:"text",value:s,onChange:w=>o(w.target.value),placeholder:"Search features...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),b.showPriorityBadges&&n.jsx("select",{value:i,onChange:w=>a(w.target.value),className:Ae,children:uo.map(w=>n.jsx("option",{value:w.value,children:w.label},w.value))}),b.showAssignee&&n.jsxs("select",{value:l,onChange:w=>p(w.target.value),className:Ae,children:[n.jsx("option",{value:"all",children:"All Assignees"}),n.jsx("option",{value:"unassigned",children:"Unassigned"}),T.map(w=>n.jsx("option",{value:w,children:w},w))]}),b.showLabels&&n.jsxs("select",{value:c,onChange:w=>u(w.target.value),className:Ae,children:[n.jsx("option",{value:"all",children:"All Labels"}),A.map(w=>n.jsx("option",{value:w,children:w},w))]}),b.showDueDate&&n.jsx("select",{value:h,onChange:w=>g(w.target.value),className:Ae,children:po.map(w=>n.jsx("option",{value:w.value,children:w.label},w.value))}),y&&n.jsxs("button",{onClick:d,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[n.jsx(te,{size:14}),n.jsx("span",{children:"Clear"})]}),n.jsxs("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[n.jsx(Fe,{size:16}),n.jsx("span",{children:"Add List"})]}),n.jsx("button",{onClick:C,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:f==="horizontal"?"Switch to vertical layout":"Switch to horizontal layout",children:f==="horizontal"?n.jsx(Pr,{size:16}):n.jsx(_r,{size:16})}),n.jsx("button",{onClick:r,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:z?"Switch to light theme":"Switch to dark theme",children:z?n.jsx(Or,{size:16}):n.jsx(qr,{size:16})}),n.jsx("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Open settings",children:n.jsx(Kr,{size:16})}),n.jsxs("div",{className:"ml-auto text-xs text-zinc-400",children:["Press ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-zinc-200 dark:bg-zinc-700 rounded",children:"n"})," to add"]})]})}function go({message:t,onUndo:e,onExpire:r,duration:s,index:o}){const[i,a]=m.useState(100);return m.useEffect(()=>{const p=50/s*100,c=setInterval(()=>{a(u=>{const h=u-p;return h<=0?(clearInterval(c),0):h})},50);return()=>clearInterval(c)},[s]),m.useEffect(()=>{i<=0&&r()},[i,r]),n.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))"},children:[n.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[n.jsx("span",{className:"text-[13px] leading-snug flex-1 truncate",children:t}),n.jsx("button",{onClick:e,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="var(--vscode-button-background)",children:"Undo"})]}),n.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:n.jsx("div",{className:"h-full transition-none",style:{width:`${i}%`,background:"var(--vscode-progressBar-background)"}})})]})}const fo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],xo=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function mo({isOpen:t,settings:e,onClose:r,onSave:s}){return t?n.jsx(vo,{settings:e,onClose:r,onSave:s}):null}function bo({checked:t,onChange:e}){return n.jsx("button",{type:"button",onClick:()=>e(!t),className:G("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:t?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:n.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:t?"translateX(18px)":"translateX(3px)"}})})}function Tt({title:t,children:e}){return n.jsxs("div",{className:"py-3",children:[n.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:t}),n.jsx("div",{children:e})]})}function ue({label:t,description:e,checked:r,onChange:s}){return n.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>s(!r),onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),e&&n.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),n.jsx(bo,{checked:r,onChange:s})]})}function Dt({label:t,value:e,options:r,onChange:s}){const[o,i]=m.useState(!1),a=r.find(l=>l.value===e);return n.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="transparent",children:[n.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Ie,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(l=>n.jsxs("button",{type:"button",onClick:()=>{s(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==e&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==e&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:G("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label})]},l.value))})]})]})]})}function vo({settings:t,onClose:e,onSave:r}){const[s,o]=m.useState(t);m.useEffect(()=>{o(t)},[t]);const i=a=>{const l={...s,...a};o(l),r(l)};return m.useEffect(()=>{const a=l=>{l.key==="Escape"&&(l.stopPropagation(),e())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[e]),n.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:e}),n.jsxs("div",{className:"relative h-full w-1/2 max-w-lg shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),n.jsx("button",{onClick:e,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:n.jsx(te,{size:18})})]}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[n.jsxs(Tt,{title:"Card Display",children:[n.jsx(ue,{label:"Show Priority Badges",description:"Display priority indicators on feature cards",checked:s.showPriorityBadges,onChange:a=>i({showPriorityBadges:a})}),n.jsx(ue,{label:"Show Assignee",description:"Display assigned person on feature cards",checked:s.showAssignee,onChange:a=>i({showAssignee:a})}),n.jsx(ue,{label:"Show Due Date",description:"Display due dates on feature cards",checked:s.showDueDate,onChange:a=>i({showDueDate:a})}),n.jsx(ue,{label:"Show Labels",description:"Display labels on feature cards and in editors",checked:s.showLabels,onChange:a=>i({showLabels:a})}),n.jsx(ue,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:s.showFileName,onChange:a=>i({showFileName:a})}),n.jsx(ue,{label:"Compact Mode",description:"Use compact card layout to show more features",checked:s.compactMode,onChange:a=>i({compactMode:a})})]}),n.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),n.jsxs(Tt,{title:"Defaults",children:[n.jsx(Dt,{label:"Default Priority",value:s.defaultPriority,options:fo,onChange:a=>i({defaultPriority:a})}),n.jsx(Dt,{label:"Default Status",value:s.defaultStatus,options:xo,onChange:a=>i({defaultStatus:a})})]})]}),n.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:n.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const ko=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function yo({isOpen:t,onClose:e,onSave:r,initial:s,title:o}){const[i,a]=m.useState((s==null?void 0:s.name)??""),[l,p]=m.useState((s==null?void 0:s.color)??"#3b82f6"),c=m.useRef(null);return m.useEffect(()=>{t&&(a((s==null?void 0:s.name)??""),p((s==null?void 0:s.color)??"#3b82f6"),setTimeout(()=>{var u;return(u=c.current)==null?void 0:u.focus()},50))},[t,s]),m.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e(),h.key==="Enter"&&(h.ctrlKey||h.metaKey)&&i.trim()&&r({name:i.trim(),color:l})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,e,r,i,l]),t?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),n.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[n.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:o}),n.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:n.jsx(te,{size:16,className:"text-zinc-500"})})]}),n.jsxs("div",{className:"px-4 py-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),n.jsx("input",{ref:c,type:"text",value:i,onChange:u=>a(u.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[ko.map(u=>n.jsx("button",{type:"button",onClick:()=>p(u),className:`w-6 h-6 rounded-full border-2 transition-all ${l===u?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:u},title:u},u)),n.jsx("input",{type:"color",value:l,onChange:u=>p(u.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[n.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),n.jsx("button",{type:"button",onClick:()=>{i.trim()&&r({name:i.trim(),color:l})},disabled:!i.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const _=acquireVsCodeApi();function wo(){const{columns:t,cardSettings:e,settingsOpen:r,setFeatures:s,setColumns:o,setIsDarkMode:i,setCardSettings:a,setSettingsOpen:l}=K(),[p,c]=m.useState(!1),[u,h]=m.useState("backlog"),[g,d]=m.useState(!1),[v,x]=m.useState(null),k=m.useRef(0),[f,C]=m.useState(null),[z,b]=m.useState([]),T=m.useRef(z);m.useEffect(()=>{T.current=z},[z]);const A=m.useRef(0),y=m.useCallback(j=>{const{features:S}=K.getState(),L=S.find(Z=>Z.id===j);if(!L)return;s(S.filter(Z=>Z.id!==j)),(f==null?void 0:f.id)===j&&C(null);const O=String(A.current++);b(Z=>[...Z,{id:O,feature:L}])},[f,s]),w=m.useCallback(j=>{const S=T.current.find(L=>L.id===j);S&&(_.postMessage({type:"deleteFeature",featureId:S.feature.id}),b(L=>L.filter(O=>O.id!==j)))},[]),B=m.useCallback(j=>{const S=T.current.find(O=>O.id===j);if(!S)return;const{features:L}=K.getState();s([...L,S.feature]),b(O=>O.filter(Z=>Z.id!==j))},[s]),P=m.useCallback(()=>{const j=T.current;j.length!==0&&B(j[j.length-1].id)},[B]);m.useEffect(()=>{let j=!1,S=null;const L=F=>{if(F.key==="Alt"){j=!0,S&&clearTimeout(S),S=setTimeout(()=>{j=!1},1e3);return}if(F.altKey&&(j=!1,S&&(clearTimeout(S),S=null)),F.key==="z"&&(F.ctrlKey||F.metaKey)&&!F.shiftKey&&T.current.length>0){F.preventDefault(),P();return}if(!(F.target instanceof HTMLInputElement||F.target instanceof HTMLTextAreaElement||F.target instanceof HTMLSelectElement||F.target instanceof HTMLElement&&F.target.isContentEditable))switch(F.key){case"n":if(F.ctrlKey||F.metaKey||F.altKey||F.shiftKey)return;F.preventDefault(),h("backlog"),c(!0);break;case"Escape":p&&c(!1);break}},O=F=>{F.key==="Alt"&&j&&(j=!1,S&&(clearTimeout(S),S=null),_.postMessage({type:"focusMenuBar"}))},Z=()=>{j=!1};return window.addEventListener("keydown",L),window.addEventListener("keyup",O),window.addEventListener("mousedown",Z),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",O),window.removeEventListener("mousedown",Z),S&&clearTimeout(S)}},[p,P]),m.useEffect(()=>{const j=()=>{const L=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");i(L),L?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};j();const S=new MutationObserver(j);return S.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>S.disconnect()},[i]),m.useEffect(()=>{const j=S=>{const L=S.data;if(!(!L||typeof L.type!="string"))switch(L.type){case"init":s(L.features),o(L.columns),L.settings&&(L.settings.markdownEditorMode&&f&&C(null),a(L.settings));break;case"featuresUpdated":s(L.features);break;case"triggerCreateDialog":h("backlog"),c(!0);break;case"showSettings":a(L.settings),l(!0);break;case"featureContent":{const{cardSettings:O}=K.getState();if(O.markdownEditorMode)break;k.current+=1,C({id:L.featureId,content:L.content,frontmatter:L.frontmatter,comments:L.comments||[],contentVersion:k.current});break}}};return window.addEventListener("message",j),_.postMessage({type:"ready"}),()=>window.removeEventListener("message",j)},[s,o,a,l]);const H=j=>{_.postMessage({type:"openFeature",featureId:j.id})},M=(j,S)=>{f&&_.postMessage({type:"saveFeatureContent",featureId:f.id,content:j,frontmatter:S})},D=()=>{C(null),_.postMessage({type:"closeFeature"})},q=()=>{f&&y(f.id)},ne=()=>{f&&_.postMessage({type:"openFile",featureId:f.id})},ce=(j,S)=>{_.postMessage({type:"startWithAI",agent:j,permissionMode:S})},Ce=()=>{f&&_.postMessage({type:"addAttachment",featureId:f.id})},fe=j=>{f&&_.postMessage({type:"openAttachment",featureId:f.id,attachment:j})},oe=j=>{f&&_.postMessage({type:"removeAttachment",featureId:f.id,attachment:j})},Se=(j,S)=>{f&&_.postMessage({type:"addComment",featureId:f.id,author:j,content:S})},W=(j,S)=>{f&&_.postMessage({type:"updateComment",featureId:f.id,commentId:j,content:S})},ir=j=>{f&&_.postMessage({type:"deleteComment",featureId:f.id,commentId:j})},cr=j=>{_.postMessage({type:"saveSettings",settings:j})},dr=()=>{x(null),d(!0)},ur=j=>{const S=t.find(L=>L.id===j);S&&(x(S),d(!0))},pr=j=>{!t.find(O=>O.id===j)||K.getState().features.filter(O=>O.status===j).length>0||_.postMessage({type:"removeColumn",columnId:j})},hr=j=>{v?_.postMessage({type:"editColumn",columnId:v.id,updates:j}):_.postMessage({type:"addColumn",column:j}),d(!1),x(null)},gr=j=>{h(j),c(!0)},fr=j=>{_.postMessage({type:"createFeature",data:j})},xr=(j,S,L)=>{const{features:O}=K.getState();if(O.find(F=>F.id===j)){const F=O.filter(J=>J.status===S&&J.id!==j).sort((J,dt)=>J.order<dt.order?-1:J.order>dt.order?1:0),Ne=Math.max(0,Math.min(L,F.length)),mr=Ne>0?F[Ne-1].order:null,br=Ne<F.length?F[Ne].order:null,vr=ts(mr,br),kr=O.map(J=>J.id===j?{...J,status:S,order:vr}:J);s(kr)}_.postMessage({type:"moveFeature",featureId:j,newStatus:S,newOrder:L})};return t.length===0?n.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:n.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):n.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[n.jsx(ho,{onOpenSettings:()=>_.postMessage({type:"openSettings"}),onAddColumn:dr,onToggleTheme:()=>_.postMessage({type:"toggleTheme"})}),n.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[n.jsx("div",{className:f?"w-1/2":"w-full",children:n.jsx(rn,{onFeatureClick:H,onAddFeature:gr,onMoveFeature:xr,onEditColumn:ur,onRemoveColumn:pr})}),f&&n.jsx("div",{className:"w-1/2",children:n.jsx(co,{featureId:f.id,content:f.content,frontmatter:f.frontmatter,comments:f.comments,contentVersion:f.contentVersion,onSave:M,onClose:D,onDelete:q,onOpenFile:ne,onStartWithAI:ce,onAddAttachment:Ce,onOpenAttachment:fe,onRemoveAttachment:oe,onAddComment:Se,onUpdateComment:W,onDeleteComment:ir})})]}),n.jsx(Vn,{isOpen:p,onClose:()=>c(!1),onCreate:fr,initialStatus:u}),n.jsx(mo,{isOpen:r,settings:e,onClose:()=>l(!1),onSave:cr}),n.jsx(yo,{isOpen:g,onClose:()=>{d(!1),x(null)},onSave:hr,initial:v?{name:v.name,color:v.color}:void 0,title:v?"Edit List":"Add List"}),z.map((j,S)=>n.jsx(go,{message:`Deleted "${er(j.feature.content)}"`,onUndo:()=>B(j.id),onExpire:()=>w(j.id),duration:5e3,index:S},j.id))]})}Bt(document.getElementById("root")).render(n.jsx(m.StrictMode,{children:n.jsx(wo,{})}));
84
+ ${w}`:""}`:w;r({status:l,priority:c,content:_,assignee:h.trim()||null,dueDate:d||null,labels:f})},M=()=>{m(),e()},E=()=>{e()};return x.useEffect(()=>{const w=C=>{C.key==="Escape"&&E(),(C.metaKey||C.ctrlKey)&&C.key==="Enter"&&M(),(C.metaKey||C.ctrlKey)&&C.key==="s"&&(C.preventDefault(),M())};if(t)return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)}),n.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:E}),n.jsxs("div",{className:"relative h-full w-1/2 shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Create Feature"})}),n.jsx("button",{onClick:E,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:n.jsx(le,{size:18})})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(je,{label:"Status",icon:n.jsx($t,{size:13}),children:n.jsx(Dt,{value:l,options:Qn.map(w=>({value:w.value,label:w.label,dot:w.dot})),onChange:w=>p(w)})}),o.showPriorityBadges&&n.jsx(je,{label:"Priority",icon:n.jsx(Ft,{size:13}),children:n.jsx(Dt,{value:c,options:Zn.map(w=>({value:w.value,label:w.label,dot:w.dot})),onChange:w=>u(w)})}),o.showAssignee&&n.jsx(je,{label:"Assignee",icon:n.jsx(Bt,{size:13}),children:n.jsx(Vn,{value:h,onChange:g})}),o.showDueDate&&n.jsx(je,{label:"Due date",icon:n.jsx(et,{size:13}),children:n.jsx(On,{value:d,onChange:v})}),o.showLabels&&n.jsx(je,{label:"Labels",icon:n.jsx(It,{size:13}),children:n.jsx(Yn,{labels:f,onChange:y})})]}),n.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[n.jsx("textarea",{ref:k,value:i,onChange:w=>a(w.target.value),placeholder:"Feature title...",className:"w-full text-lg font-medium bg-transparent border-none outline-none resize-none mb-4",style:{color:"var(--vscode-foreground)"},rows:1,onInput:w=>{const C=w.target;C.style.height="auto",C.style.height=C.scrollHeight+"px"},onKeyDown:w=>{w.key==="Enter"&&!w.shiftKey&&w.preventDefault()}}),n.jsx(dr,{value:b,onChange:z,placeholder:"Add a description..."})]}),n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderTop:"1px solid var(--vscode-panel-border)",background:"var(--vscode-sideBar-background, var(--vscode-editor-background))"},children:[n.jsxs("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:[n.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"Esc"})," ","cancel ·"," ",n.jsx("kbd",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"var(--vscode-keybindingLabel-background, var(--vscode-badge-background))",color:"var(--vscode-keybindingLabel-foreground, var(--vscode-foreground))",border:"1px solid var(--vscode-keybindingLabel-border, var(--vscode-panel-border))"},children:"⌘S"})," ","save"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:E,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)",background:"transparent",border:"1px solid var(--vscode-panel-border)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="transparent",children:"Cancel"}),n.jsx("button",{type:"button",onClick:M,className:"px-3 py-1.5 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-button-foreground)",background:"var(--vscode-button-background)"},onMouseEnter:w=>w.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:w=>w.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}const eo={critical:"Critical",high:"High",medium:"Medium",low:"Low"},to={backlog:"Backlog",todo:"To Do","in-progress":"In Progress",review:"Review",done:"Done"},ro=["critical","high","medium","low"],so=["backlog","todo","in-progress","review","done"],no={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},oo={backlog:"bg-zinc-400",todo:"bg-blue-400","in-progress":"bg-amber-400",review:"bg-purple-400",done:"bg-emerald-400"},ao=[{agent:"claude",label:"Claude",color:"hover:bg-amber-100 dark:hover:bg-amber-900/30",activeColor:"bg-amber-700 text-white"},{agent:"codex",label:"Codex",color:"hover:bg-emerald-100 dark:hover:bg-emerald-900/30",activeColor:"bg-emerald-500 text-white"},{agent:"opencode",label:"OpenCode",color:"hover:bg-slate-100 dark:hover:bg-slate-700/30",activeColor:"bg-slate-500 text-white"}],lo={claude:{bg:"bg-amber-700",hover:"hover:bg-amber-800",shadow:"shadow-sm",border:"border border-amber-800/50"},codex:{bg:"bg-emerald-600",hover:"hover:bg-emerald-700",shadow:"shadow-sm",border:"border border-emerald-700/50"},opencode:{bg:"bg-slate-600",hover:"hover:bg-slate-700",shadow:"shadow-sm",border:"border border-slate-700/50"}},io={claude:[{permissionMode:"default",label:"Default",description:"With confirmations"},{permissionMode:"plan",label:"Plan",description:"Creates a plan first"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts file edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Bypasses all prompts"}],codex:[{permissionMode:"default",label:"Suggest",description:"Suggests changes"},{permissionMode:"acceptEdits",label:"Auto-edit",description:"Auto-accepts edits"},{permissionMode:"bypassPermissions",label:"Full Auto",description:"Full automation"}],opencode:[{permissionMode:"default",label:"Default",description:"Standard mode"}]};function At({value:t,options:e,onChange:r,className:s}){const[o,i]=x.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:W("relative",s),children:[n.jsxs("button",{onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Te,{size:12,style:{color:"var(--vscode-descriptionForeground)"},className:"ml-0.5"})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:e.map(l=>n.jsxs("button",{onClick:()=>{r(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===t?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==t&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==t&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label}),l.value===t&&n.jsx(_e,{size:12,style:{color:"var(--vscode-focusBorder)"},className:"shrink-0"})]},l.value))})]})]})}function ge({label:t,icon:e,children:r}){return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[5px] transition-colors vscode-hover-bg",children:[n.jsxs("div",{className:"flex items-center gap-2 w-[90px] shrink-0",children:[n.jsx("span",{style:{color:"var(--vscode-descriptionForeground)"},children:e}),n.jsx("span",{className:"text-[11px]",style:{color:"var(--vscode-descriptionForeground)"},children:t})]}),n.jsx("div",{className:"flex-1 min-w-0",children:r})]})}function co({onSelect:t}){const[e,r]=x.useState(!1),[s,o]=x.useState("claude"),i=io[s],a=lo[s];return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>r(!e),className:W("flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium text-white rounded-md transition-colors",a.bg,a.hover,a.shadow,a.border),children:[n.jsx(Pr,{size:13}),n.jsx("span",{children:"Build with AI"}),n.jsx("kbd",{className:"ml-0.5 text-[9px] opacity-60 font-mono",children:"⌘B"}),n.jsx(Te,{size:11,className:W("ml-0.5 opacity-60 transition-transform",e&&"rotate-180")})]}),e&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>r(!1)}),n.jsxs("div",{className:"absolute top-full right-0 mt-1 z-20 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[260px] overflow-hidden",children:[n.jsx("div",{className:"flex",children:ao.map(l=>n.jsx("button",{onClick:()=>o(l.agent),className:W("flex-1 px-3 py-2.5 text-xs font-medium transition-all",s===l.agent?l.activeColor:W("text-zinc-600 dark:text-zinc-400",l.color)),children:l.label},l.agent))}),n.jsx("div",{className:"p-2 space-y-1",children:i.map(l=>n.jsxs("button",{onClick:()=>{t(s,l.permissionMode),r(!1)},className:"w-full text-left px-3 py-2.5 rounded-md hover:bg-zinc-100 dark:hover:bg-zinc-700/50 transition-colors",children:[n.jsx("div",{className:"text-xs font-medium text-zinc-900 dark:text-zinc-100",children:l.label}),n.jsx("div",{className:"text-[10px] text-zinc-500 dark:text-zinc-400 mt-0.5",children:l.description})]},l.permissionMode))})]})]})]})}function uo({labels:t,onChange:e}){const[r,s]=x.useState(""),[o,i]=x.useState(!1),a=x.useRef(null),l=U(d=>d.features),p=x.useMemo(()=>{const d=new Set;return l.forEach(v=>v.labels.forEach(f=>d.add(f))),Array.from(d).sort()},[l]),c=x.useMemo(()=>{const d=p.filter(v=>!t.includes(v));return r.trim()?d.filter(v=>v.toLowerCase().includes(r.toLowerCase())):d},[r,p,t]),u=o&&c.length>0,h=d=>{const v=(d||r).trim();v&&!t.includes(v)&&e([...t,v]),s("")},g=d=>{e(t.filter(v=>v!==d))};return n.jsxs("div",{className:"relative flex items-center gap-1.5 flex-wrap",children:[t.map(d=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[d,n.jsx("button",{onClick:()=>g(d),className:"hover:text-red-500 transition-colors",children:n.jsx(le,{size:9})})]},d)),n.jsx("button",{onClick:()=>{i(!0),setTimeout(()=>{var d;return(d=a.current)==null?void 0:d.focus()},0)},className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(Se,{size:10})}),n.jsx("input",{ref:a,type:"text",value:r,onChange:d=>s(d.target.value),onFocus:()=>i(!0),onBlur:()=>setTimeout(()=>i(!1),150),onKeyDown:d=>{var v;d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Backspace"&&!r&&t.length>0&&e(t.slice(0,-1)),d.key==="Escape"&&(s(""),(v=a.current)==null||v.blur())},placeholder:t.length===0?"Add labels...":"",className:"flex-1 min-w-[60px] bg-transparent border-none outline-none text-xs",style:{color:"var(--vscode-foreground)",display:o||r?"block":"none"}}),u&&n.jsx("div",{className:"absolute top-full left-0 mt-1 z-20 rounded-lg shadow-lg py-1 max-h-[160px] overflow-auto min-w-[180px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:c.map(d=>n.jsx("button",{type:"button",onMouseDown:v=>{v.preventDefault(),h(d)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)"},onMouseEnter:v=>v.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:v=>v.currentTarget.style.background="transparent",children:n.jsx("span",{className:"inline-block px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:d})},d))})]})}function po({featureId:t,content:e,frontmatter:r,comments:s,contentVersion:o,onSave:i,onClose:a,onDelete:l,onOpenFile:p,onStartWithAI:c,onAddAttachment:u,onOpenAttachment:h,onRemoveAttachment:g,onAddComment:d,onUpdateComment:v,onDeleteComment:f}){const{cardSettings:y}=U(),[b,z]=x.useState(r),[k,m]=x.useState(e),[M,E]=x.useState(!1),w=x.useRef(null),C=x.useRef(b),_=x.useRef(k);C.current=b,_.current=k;const O=x.useCallback(()=>{i(_.current,C.current)},[i]);x.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),x.useEffect(()=>{m(e)},[t,o]),x.useEffect(()=>{z(r)},[r]);const G=x.useCallback(N=>{m(N),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{i(N,C.current)},800)},[i]),D=x.useCallback(N=>{z(q=>{const Q={...q,...N};return w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{i(_.current,Q)},800),Q})},[i]);return x.useEffect(()=>{const N=q=>{(q.metaKey||q.ctrlKey)&&q.key==="s"&&(q.preventDefault(),w.current&&clearTimeout(w.current),O()),(q.metaKey||q.ctrlKey)&&q.key==="b"&&y.showBuildWithAI&&(q.preventDefault(),c("claude","default")),q.key==="Escape"&&(w.current&&(clearTimeout(w.current),O()),a())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[O,a,c,y.showBuildWithAI]),n.jsxs("div",{className:"h-full flex flex-col",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-xs font-mono",style:{color:"var(--vscode-descriptionForeground)"},children:t}),M?n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-xs",style:{color:"var(--vscode-errorForeground)"},children:"Delete?"}),n.jsx("button",{onClick:()=>{E(!1),l()},className:"px-2 py-1 text-xs font-medium rounded transition-colors text-white bg-red-600 hover:bg-red-700",children:"Yes"}),n.jsx("button",{onClick:()=>E(!1),className:"px-2 py-1 text-xs font-medium rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-foreground)"},children:"No"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:()=>{p(),a()},className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Open .md file",children:[n.jsx(Mt,{size:16}),n.jsx("span",{className:"text-xs",children:"OPEN"})]}),n.jsxs("button",{onClick:()=>E(!0),className:"p-1.5 px-2 rounded border transition-colors vscode-hover-bg flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)",borderColor:"var(--vscode-widget-border, var(--vscode-contrastBorder, rgba(128,128,128,0.35)))"},title:"Delete ticket",children:[n.jsx(tt,{size:16}),n.jsx("span",{className:"text-xs",children:"DELETE"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[y.showBuildWithAI&&n.jsx(co,{onSelect:c}),n.jsx("button",{onClick:a,className:"p-1.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(le,{size:18})})]})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(ge,{label:"Status",icon:n.jsx($t,{size:13}),children:n.jsx(At,{value:b.status,options:so.map(N=>({value:N,label:to[N],dot:oo[N]})),onChange:N=>D({status:N})})}),y.showPriorityBadges&&n.jsx(ge,{label:"Priority",icon:n.jsx(Ft,{size:13}),children:n.jsx(At,{value:b.priority,options:ro.map(N=>({value:N,label:eo[N],dot:no[N]})),onChange:N=>D({priority:N})})}),y.showAssignee&&n.jsx(ge,{label:"Assignee",icon:n.jsx(Bt,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-2",children:[b.assignee&&n.jsx("span",{className:"shrink-0 w-4 h-4 rounded-full flex items-center justify-center text-[8px] font-bold",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:b.assignee.split(/\s+/).filter(Boolean).map(N=>N[0]).join("").toUpperCase().slice(0,2)}),n.jsx("input",{type:"text",value:b.assignee||"",onChange:N=>D({assignee:N.target.value||null}),placeholder:"No assignee",className:"bg-transparent border-none outline-none text-xs w-32",style:{color:b.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),y.showDueDate&&n.jsx(ge,{label:"Due date",icon:n.jsx(et,{size:13}),children:n.jsx("input",{type:"date",value:b.dueDate||"",onChange:N=>D({dueDate:N.target.value||null}),className:"bg-transparent border-none outline-none text-xs",style:{color:b.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),y.showLabels&&n.jsx(ge,{label:"Labels",icon:n.jsx(It,{size:13}),children:n.jsx(uo,{labels:b.labels,onChange:N=>D({labels:N})})}),n.jsx(ge,{label:"Attachments",icon:n.jsx(He,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[b.attachments.map(N=>n.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded",style:{background:"var(--vscode-badge-background)",color:"var(--vscode-badge-foreground)"},children:[n.jsxs("button",{type:"button",onClick:()=>h(N),className:"inline-flex items-center gap-1 hover:underline",title:N,children:[n.jsx(He,{size:9}),N]}),n.jsx("button",{type:"button",onClick:()=>g(N),className:"hover:text-red-500 transition-colors",children:n.jsx(le,{size:9})})]},N)),n.jsx("button",{type:"button",onClick:u,className:"inline-flex items-center gap-0.5 px-1 py-0.5 text-[10px] rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(Se,{size:10})})]})})]}),n.jsx(dr,{value:k,onChange:G,placeholder:"Start writing...",className:"flex-1 min-h-0",comments:s,onAddComment:d,onUpdateComment:v,onDeleteComment:f})]})}const ho=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],go=[{value:"all",label:"All Dates"},{value:"overdue",label:"Overdue"},{value:"today",label:"Due Today"},{value:"this-week",label:"Due This Week"},{value:"no-date",label:"No Due Date"}],Re="text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100";function fo({onOpenSettings:t,onAddColumn:e,onToggleTheme:r,onSwitchBoard:s,onCreateBoard:o}){var Ae;const{searchQuery:i,setSearchQuery:a,priorityFilter:l,setPriorityFilter:p,assigneeFilter:c,setAssigneeFilter:u,labelFilter:h,setLabelFilter:g,dueDateFilter:d,setDueDateFilter:v,clearAllFilters:f,getUniqueAssignees:y,getUniqueLabels:b,hasActiveFilters:z,layout:k,toggleLayout:m,isDarkMode:M,cardSettings:E,boards:w,currentBoard:C}=U(),_=y(),O=b(),G=z(),[D,N]=x.useState(!1),[q,Q]=x.useState(!1),[te,re]=x.useState(""),se=x.useRef(null),V=x.useRef(null);x.useEffect(()=>{const S=Ue=>{se.current&&!se.current.contains(Ue.target)&&(N(!1),Q(!1),re(""))};return D&&document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[D]),x.useEffect(()=>{q&&V.current&&V.current.focus()},[q]);const he=((Ae=w.find(S=>S.id===C))==null?void 0:Ae.name)||C,Z=()=>{const S=te.trim();S&&(o(S),re(""),Q(!1),N(!1))};return n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 flex-wrap",children:[n.jsxs("div",{className:"relative",ref:se,children:[n.jsxs("button",{type:"button",onClick:()=>N(!D),className:"flex items-center gap-1.5 px-2 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md hover:bg-zinc-50 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[n.jsx("span",{className:"max-w-[120px] truncate",children:he}),n.jsx(Te,{size:14,className:`text-zinc-400 transition-transform ${D?"rotate-180":""}`})]}),D&&n.jsxs("div",{className:"absolute top-full left-0 mt-1 min-w-[180px] bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md shadow-lg z-50 py-1",children:[w.map(S=>n.jsxs("button",{type:"button",onClick:()=>{s(S.id),N(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-zinc-900 dark:text-zinc-100 transition-colors",children:[n.jsx(_e,{size:14,className:S.id===C?"text-blue-500":"invisible"}),n.jsx("span",{className:"truncate",children:S.name})]},S.id)),n.jsx("div",{className:"border-t border-zinc-200 dark:border-zinc-600 my-1"}),q?n.jsx("div",{className:"px-3 py-1.5",children:n.jsx("input",{ref:V,type:"text",value:te,onChange:S=>re(S.target.value),onKeyDown:S=>{S.key==="Enter"&&Z(),S.key==="Escape"&&(Q(!1),re(""))},placeholder:"Board name...",className:"w-full px-2 py-1 text-sm bg-zinc-50 dark:bg-zinc-900 border border-zinc-300 dark:border-zinc-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})}):n.jsxs("button",{type:"button",onClick:()=>Q(!0),className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left hover:bg-zinc-100 dark:hover:bg-zinc-700 text-blue-600 dark:text-blue-400 transition-colors",children:[n.jsx(Se,{size:14}),n.jsx("span",{children:"New Board"})]})]})]}),n.jsxs("div",{className:"relative flex-1 min-w-[180px] max-w-xs",children:[n.jsx(_r,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),n.jsx("input",{type:"text",value:i,onChange:S=>a(S.target.value),placeholder:"Search features...",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),E.showPriorityBadges&&n.jsx("select",{value:l,onChange:S=>p(S.target.value),className:Re,children:ho.map(S=>n.jsx("option",{value:S.value,children:S.label},S.value))}),E.showAssignee&&n.jsxs("select",{value:c,onChange:S=>u(S.target.value),className:Re,children:[n.jsx("option",{value:"all",children:"All Assignees"}),n.jsx("option",{value:"unassigned",children:"Unassigned"}),_.map(S=>n.jsx("option",{value:S,children:S},S))]}),E.showLabels&&n.jsxs("select",{value:h,onChange:S=>g(S.target.value),className:Re,children:[n.jsx("option",{value:"all",children:"All Labels"}),O.map(S=>n.jsx("option",{value:S,children:S},S))]}),E.showDueDate&&n.jsx("select",{value:d,onChange:S=>v(S.target.value),className:Re,children:go.map(S=>n.jsx("option",{value:S.value,children:S.label},S.value))}),G&&n.jsxs("button",{onClick:f,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Clear all filters",children:[n.jsx(le,{size:14}),n.jsx("span",{children:"Clear"})]}),n.jsxs("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Add new list",children:[n.jsx(Se,{size:16}),n.jsx("span",{children:"Add List"})]}),n.jsx("button",{onClick:m,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:k==="horizontal"?"Switch to vertical layout":"Switch to horizontal layout",children:k==="horizontal"?n.jsx(Or,{size:16}):n.jsx(qr,{size:16})}),n.jsx("button",{onClick:r,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:M?"Switch to light theme":"Switch to dark theme",children:M?n.jsx(Kr,{size:16}):n.jsx(Ur,{size:16})}),n.jsx("button",{onClick:t,className:"flex items-center gap-1 px-2 py-1.5 text-sm text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-md transition-colors",title:"Open settings",children:n.jsx(Gr,{size:16})}),n.jsxs("div",{className:"ml-auto text-xs text-zinc-400",children:["Press ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-zinc-200 dark:bg-zinc-700 rounded",children:"n"})," to add"]})]})}function xo({message:t,onUndo:e,onExpire:r,duration:s,index:o}){const[i,a]=x.useState(100);return x.useEffect(()=>{const p=50/s*100,c=setInterval(()=>{a(u=>{const h=u-p;return h<=0?(clearInterval(c),0):h})},50);return()=>clearInterval(c)},[s]),x.useEffect(()=>{i<=0&&r()},[i,r]),n.jsxs("div",{className:"fixed right-4 z-50 flex flex-col min-w-[320px] max-w-[420px] shadow-[0_4px_16px_rgba(0,0,0,0.4)] transition-[bottom] duration-200 ease-out",style:{bottom:`${24+o*52}px`,background:"var(--vscode-notifications-background)",color:"var(--vscode-notifications-foreground)",border:"1px solid var(--vscode-notifications-border, var(--vscode-widget-border))"},children:[n.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5",children:[n.jsx("span",{className:"text-[13px] leading-snug flex-1 truncate",children:t}),n.jsx("button",{onClick:e,className:"text-[13px] px-2 py-0.5 shrink-0",style:{background:"var(--vscode-button-background)",color:"var(--vscode-button-foreground)"},onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="var(--vscode-button-background)",children:"Undo"})]}),n.jsx("div",{className:"h-[2px] w-full",style:{background:"var(--vscode-widget-border)"},children:n.jsx("div",{className:"h-full transition-none",style:{width:`${i}%`,background:"var(--vscode-progressBar-background)"}})})]})}const mo=[{value:"critical",label:"Critical",dot:"bg-red-500"},{value:"high",label:"High",dot:"bg-orange-500"},{value:"medium",label:"Medium",dot:"bg-yellow-500"},{value:"low",label:"Low",dot:"bg-green-500"}],bo=[{value:"backlog",label:"Backlog",dot:"bg-zinc-400"},{value:"todo",label:"To Do",dot:"bg-blue-400"},{value:"in-progress",label:"In Progress",dot:"bg-amber-400"},{value:"review",label:"Review",dot:"bg-purple-400"},{value:"done",label:"Done",dot:"bg-emerald-400"}];function vo({isOpen:t,settings:e,onClose:r,onSave:s}){return t?n.jsx(yo,{settings:e,onClose:r,onSave:s}):null}function ko({checked:t,onChange:e}){return n.jsx("button",{type:"button",onClick:()=>e(!t),className:W("relative inline-flex h-5 w-9 items-center rounded-full transition-colors shrink-0"),style:{background:t?"var(--vscode-button-background)":"var(--vscode-badge-background, #6b7280)"},children:n.jsx("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",style:{transform:t?"translateX(18px)":"translateX(3px)"}})})}function Et({title:t,children:e}){return n.jsxs("div",{className:"py-3",children:[n.jsx("h3",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--vscode-descriptionForeground)"},children:t}),n.jsx("div",{children:e})]})}function fe({label:t,description:e,checked:r,onChange:s}){return n.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors cursor-pointer",onClick:()=>s(!r),onMouseEnter:o=>o.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:o=>o.currentTarget.style.background="transparent",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),e&&n.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--vscode-descriptionForeground)"},children:e})]}),n.jsx(ko,{checked:r,onChange:s})]})}function Lt({label:t,value:e,options:r,onChange:s}){const[o,i]=x.useState(!1),a=r.find(l=>l.value===e);return n.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-2 transition-colors",onMouseEnter:l=>l.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:l=>l.currentTarget.style.background="transparent",children:[n.jsx("div",{className:"text-sm",style:{color:"var(--vscode-foreground)"},children:t}),n.jsxs("div",{className:"relative",children:[n.jsxs("button",{type:"button",onClick:()=>i(!o),className:"flex items-center gap-2 px-2 py-1 text-xs font-medium rounded transition-colors",style:{color:"var(--vscode-foreground)"},children:[(a==null?void 0:a.dot)&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Te,{size:12,style:{color:"var(--vscode-descriptionForeground)"}})]}),o&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),n.jsx("div",{className:"absolute top-full right-0 mt-1 z-20 rounded-lg shadow-lg py-1 min-w-[140px]",style:{background:"var(--vscode-dropdown-background)",border:"1px solid var(--vscode-dropdown-border, var(--vscode-panel-border))"},children:r.map(l=>n.jsxs("button",{type:"button",onClick:()=>{s(l.value),i(!1)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",style:{color:"var(--vscode-dropdown-foreground)",background:l.value===e?"var(--vscode-list-activeSelectionBackground)":void 0},onMouseEnter:p=>{l.value!==e&&(p.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:p=>{l.value!==e&&(p.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:W("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label})]},l.value))})]})]})]})}function yo({settings:t,onClose:e,onSave:r}){const[s,o]=x.useState(t);x.useEffect(()=>{o(t)},[t]);const i=a=>{const l={...s,...a};o(l),r(l)};return x.useEffect(()=>{const a=l=>{l.key==="Escape"&&(l.stopPropagation(),e())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[e]),n.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:e}),n.jsxs("div",{className:"relative h-full w-1/2 max-w-lg shadow-xl flex flex-col animate-in slide-in-from-right duration-200",style:{background:"var(--vscode-editor-background)",borderLeft:"1px solid var(--vscode-panel-border)"},children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx("h2",{className:"font-medium",style:{color:"var(--vscode-foreground)"},children:"Settings"}),n.jsx("button",{onClick:e,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:a=>a.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:a=>a.currentTarget.style.background="transparent",children:n.jsx(le,{size:18})})]}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[n.jsxs(Et,{title:"Card Display",children:[n.jsx(fe,{label:"Show Priority Badges",description:"Display priority indicators on feature cards",checked:s.showPriorityBadges,onChange:a=>i({showPriorityBadges:a})}),n.jsx(fe,{label:"Show Assignee",description:"Display assigned person on feature cards",checked:s.showAssignee,onChange:a=>i({showAssignee:a})}),n.jsx(fe,{label:"Show Due Date",description:"Display due dates on feature cards",checked:s.showDueDate,onChange:a=>i({showDueDate:a})}),n.jsx(fe,{label:"Show Labels",description:"Display labels on feature cards and in editors",checked:s.showLabels,onChange:a=>i({showLabels:a})}),n.jsx(fe,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:s.showFileName,onChange:a=>i({showFileName:a})}),n.jsx(fe,{label:"Compact Mode",description:"Use compact card layout to show more features",checked:s.compactMode,onChange:a=>i({compactMode:a})})]}),n.jsx("div",{style:{borderTop:"1px solid var(--vscode-panel-border)"}}),n.jsxs(Et,{title:"Defaults",children:[n.jsx(Lt,{label:"Default Priority",value:s.defaultPriority,options:mo,onChange:a=>i({defaultPriority:a})}),n.jsx(Lt,{label:"Default Status",value:s.defaultStatus,options:bo,onChange:a=>i({defaultStatus:a})})]})]}),n.jsx("div",{className:"px-4 py-2",style:{borderTop:"1px solid var(--vscode-panel-border)"},children:n.jsx("p",{className:"text-xs",style:{color:"var(--vscode-descriptionForeground)"},children:"Settings are saved automatically and apply to all connected clients."})})]})]})}const wo=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function jo({isOpen:t,onClose:e,onSave:r,initial:s,title:o}){const[i,a]=x.useState((s==null?void 0:s.name)??""),[l,p]=x.useState((s==null?void 0:s.color)??"#3b82f6"),c=x.useRef(null);return x.useEffect(()=>{t&&(a((s==null?void 0:s.name)??""),p((s==null?void 0:s.color)??"#3b82f6"),setTimeout(()=>{var u;return(u=c.current)==null?void 0:u.focus()},50))},[t,s]),x.useEffect(()=>{if(!t)return;const u=h=>{h.key==="Escape"&&e(),h.key==="Enter"&&(h.ctrlKey||h.metaKey)&&i.trim()&&r({name:i.trim(),color:l})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[t,e,r,i,l]),t?n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[n.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:e}),n.jsxs("div",{className:"relative bg-white dark:bg-zinc-800 rounded-lg shadow-xl w-full max-w-sm mx-4 border border-zinc-200 dark:border-zinc-600",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-200 dark:border-zinc-700",children:[n.jsx("h2",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:o}),n.jsx("button",{type:"button",onClick:e,className:"p-1 rounded hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:n.jsx(le,{size:16,className:"text-zinc-500"})})]}),n.jsxs("div",{className:"px-4 py-4 space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Name"}),n.jsx("input",{ref:c,type:"text",value:i,onChange:u=>a(u.target.value),placeholder:"List name...",className:"w-full px-3 py-1.5 text-sm bg-white dark:bg-zinc-700 border border-zinc-200 dark:border-zinc-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-zinc-900 dark:text-zinc-100 placeholder-zinc-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-zinc-600 dark:text-zinc-400 mb-1",children:"Color"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[wo.map(u=>n.jsx("button",{type:"button",onClick:()=>p(u),className:`w-6 h-6 rounded-full border-2 transition-all ${l===u?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:u},title:u},u)),n.jsx("input",{type:"color",value:l,onChange:u=>p(u.target.value),className:"w-6 h-6 rounded cursor-pointer border-0 p-0 bg-transparent",title:"Custom color"})]})]})]}),n.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-zinc-200 dark:border-zinc-700",children:[n.jsx("button",{type:"button",onClick:e,className:"px-3 py-1.5 text-sm rounded-md text-zinc-600 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors",children:"Cancel"}),n.jsx("button",{type:"button",onClick:()=>{i.trim()&&r({name:i.trim(),color:l})},disabled:!i.trim(),className:"px-3 py-1.5 text-sm rounded-md bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Save"})]})]})]}):null}const P=acquireVsCodeApi();function zo(){const{columns:t,cardSettings:e,settingsOpen:r,setFeatures:s,setColumns:o,setBoards:i,setCurrentBoard:a,setIsDarkMode:l,setCardSettings:p,setSettingsOpen:c}=U(),[u,h]=x.useState(!1),[g,d]=x.useState("backlog"),[v,f]=x.useState(!1),[y,b]=x.useState(null),z=x.useRef(0),[k,m]=x.useState(null),[M,E]=x.useState([]),w=x.useRef(M);x.useEffect(()=>{w.current=M},[M]);const C=x.useRef(0),_=x.useCallback(j=>{const{features:T}=U.getState(),L=T.find(Y=>Y.id===j);if(!L)return;s(T.filter(Y=>Y.id!==j)),(k==null?void 0:k.id)===j&&m(null);const K=String(C.current++);E(Y=>[...Y,{id:K,feature:L}])},[k,s]),O=x.useCallback(j=>{const T=w.current.find(L=>L.id===j);T&&(P.postMessage({type:"deleteFeature",featureId:T.feature.id}),E(L=>L.filter(K=>K.id!==j)))},[]),G=x.useCallback(j=>{const T=w.current.find(K=>K.id===j);if(!T)return;const{features:L}=U.getState();s([...L,T.feature]),E(K=>K.filter(Y=>Y.id!==j))},[s]),D=x.useCallback(()=>{const j=w.current;j.length!==0&&G(j[j.length-1].id)},[G]);x.useEffect(()=>{let j=!1,T=null;const L=B=>{if(B.key==="Alt"){j=!0,T&&clearTimeout(T),T=setTimeout(()=>{j=!1},1e3);return}if(B.altKey&&(j=!1,T&&(clearTimeout(T),T=null)),B.key==="z"&&(B.ctrlKey||B.metaKey)&&!B.shiftKey&&w.current.length>0){B.preventDefault(),D();return}if(!(B.target instanceof HTMLInputElement||B.target instanceof HTMLTextAreaElement||B.target instanceof HTMLSelectElement||B.target instanceof HTMLElement&&B.target.isContentEditable))switch(B.key){case"n":if(B.ctrlKey||B.metaKey||B.altKey||B.shiftKey)return;B.preventDefault(),d("backlog"),h(!0);break;case"Escape":u&&h(!1);break}},K=B=>{B.key==="Alt"&&j&&(j=!1,T&&(clearTimeout(T),T=null),P.postMessage({type:"focusMenuBar"}))},Y=()=>{j=!1};return window.addEventListener("keydown",L),window.addEventListener("keyup",K),window.addEventListener("mousedown",Y),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",K),window.removeEventListener("mousedown",Y),T&&clearTimeout(T)}},[u,D]),x.useEffect(()=>{const j=()=>{const L=document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast");l(L),L?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};j();const T=new MutationObserver(j);return T.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>T.disconnect()},[l]),x.useEffect(()=>{const j=T=>{const L=T.data;if(!(!L||typeof L.type!="string"))switch(L.type){case"init":s(L.features),o(L.columns),L.boards&&i(L.boards),L.currentBoard&&a(L.currentBoard),L.settings&&(L.settings.markdownEditorMode&&k&&m(null),p(L.settings));break;case"featuresUpdated":s(L.features);break;case"triggerCreateDialog":d("backlog"),h(!0);break;case"showSettings":p(L.settings),c(!0);break;case"featureContent":{const{cardSettings:K}=U.getState();if(K.markdownEditorMode)break;z.current+=1,m({id:L.featureId,content:L.content,frontmatter:L.frontmatter,comments:L.comments||[],contentVersion:z.current});break}}};return window.addEventListener("message",j),P.postMessage({type:"ready"}),()=>window.removeEventListener("message",j)},[s,o,i,a,p,c]);const N=j=>{P.postMessage({type:"openFeature",featureId:j.id})},q=(j,T)=>{k&&P.postMessage({type:"saveFeatureContent",featureId:k.id,content:j,frontmatter:T})},Q=()=>{m(null),P.postMessage({type:"closeFeature"})},te=()=>{k&&_(k.id)},re=()=>{k&&P.postMessage({type:"openFile",featureId:k.id})},se=(j,T)=>{P.postMessage({type:"startWithAI",agent:j,permissionMode:T})},V=()=>{k&&P.postMessage({type:"addAttachment",featureId:k.id})},he=j=>{k&&P.postMessage({type:"openAttachment",featureId:k.id,attachment:j})},Z=j=>{k&&P.postMessage({type:"removeAttachment",featureId:k.id,attachment:j})},Ae=(j,T)=>{k&&P.postMessage({type:"addComment",featureId:k.id,author:j,content:T})},S=(j,T)=>{k&&P.postMessage({type:"updateComment",featureId:k.id,commentId:j,content:T})},Ue=j=>{k&&P.postMessage({type:"deleteComment",featureId:k.id,commentId:j})},ur=j=>{P.postMessage({type:"saveSettings",settings:j})},pr=()=>{b(null),f(!0)},hr=j=>{const T=t.find(L=>L.id===j);T&&(b(T),f(!0))},gr=j=>{!t.find(K=>K.id===j)||U.getState().features.filter(K=>K.status===j).length>0||P.postMessage({type:"removeColumn",columnId:j})},fr=j=>{y?P.postMessage({type:"editColumn",columnId:y.id,updates:j}):P.postMessage({type:"addColumn",column:j}),f(!1),b(null)},xr=j=>{d(j),h(!0)},mr=j=>{P.postMessage({type:"createFeature",data:j})},br=(j,T,L)=>{const{features:K}=U.getState();if(K.find(B=>B.id===j)){const B=K.filter(ne=>ne.status===T&&ne.id!==j).sort((ne,ht)=>ne.order<ht.order?-1:ne.order>ht.order?1:0),Ee=Math.max(0,Math.min(L,B.length)),vr=Ee>0?B[Ee-1].order:null,kr=Ee<B.length?B[Ee].order:null,yr=ss(vr,kr),wr=K.map(ne=>ne.id===j?{...ne,status:T,order:yr}:ne);s(wr)}P.postMessage({type:"moveFeature",featureId:j,newStatus:T,newOrder:L})};return t.length===0?n.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--vscode-editor-background)]",children:n.jsx("div",{className:"text-[var(--vscode-foreground)] opacity-60",children:"Loading..."})}):n.jsxs("div",{className:"h-full w-full flex flex-col bg-[var(--vscode-editor-background)]",children:[n.jsx(fo,{onOpenSettings:()=>P.postMessage({type:"openSettings"}),onAddColumn:pr,onToggleTheme:()=>P.postMessage({type:"toggleTheme"}),onSwitchBoard:j=>P.postMessage({type:"switchBoard",boardId:j}),onCreateBoard:j=>P.postMessage({type:"createBoard",name:j})}),n.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[n.jsx("div",{className:k?"w-1/2":"w-full",children:n.jsx(nn,{onFeatureClick:N,onAddFeature:xr,onMoveFeature:br,onEditColumn:hr,onRemoveColumn:gr})}),k&&n.jsx("div",{className:"w-1/2",children:n.jsx(po,{featureId:k.id,content:k.content,frontmatter:k.frontmatter,comments:k.comments,contentVersion:k.contentVersion,onSave:q,onClose:Q,onDelete:te,onOpenFile:re,onStartWithAI:se,onAddAttachment:V,onOpenAttachment:he,onRemoveAttachment:Z,onAddComment:Ae,onUpdateComment:S,onDeleteComment:Ue})})]}),n.jsx(Jn,{isOpen:u,onClose:()=>h(!1),onCreate:mr,initialStatus:g}),n.jsx(vo,{isOpen:r,settings:e,onClose:()=>c(!1),onSave:ur}),n.jsx(jo,{isOpen:v,onClose:()=>{f(!1),b(null)},onSave:fr,initial:y?{name:y.name,color:y.color}:void 0,title:y?"Edit List":"Add List"}),M.map((j,T)=>n.jsx(xo,{message:`Deleted "${sr(j.feature.content)}"`,onUndo:()=>G(j.id),onExpire:()=>O(j.id),duration:5e3,index:T},j.id))]})}Ot(document.getElementById("root")).render(n.jsx(x.StrictMode,{children:n.jsx(zo,{})}));
85
85
  //# sourceMappingURL=index.js.map