kanban-lite 1.0.4

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 (99) hide show
  1. package/.editorconfig +9 -0
  2. package/.github/workflows/ci.yml +59 -0
  3. package/.github/workflows/release.yml +75 -0
  4. package/.prettierignore +6 -0
  5. package/.prettierrc.yaml +4 -0
  6. package/.vscode/extensions.json +3 -0
  7. package/.vscode/launch.json +17 -0
  8. package/.vscode/settings.json +21 -0
  9. package/.vscode/tasks.json +22 -0
  10. package/.vscodeignore +11 -0
  11. package/CHANGELOG.md +184 -0
  12. package/CLAUDE.md +58 -0
  13. package/CONTRIBUTING.md +114 -0
  14. package/LICENSE +22 -0
  15. package/README.md +482 -0
  16. package/SKILL.md +237 -0
  17. package/dist/cli.js +8716 -0
  18. package/dist/extension.js +8463 -0
  19. package/dist/mcp-server.js +1327 -0
  20. package/dist/standalone-webview/icons-Dx9MGYqN.js +180 -0
  21. package/dist/standalone-webview/icons-Dx9MGYqN.js.map +1 -0
  22. package/dist/standalone-webview/index.js +85 -0
  23. package/dist/standalone-webview/index.js.map +1 -0
  24. package/dist/standalone-webview/react-vendor-DkYdDBET.js +25 -0
  25. package/dist/standalone-webview/react-vendor-DkYdDBET.js.map +1 -0
  26. package/dist/standalone-webview/style.css +1 -0
  27. package/dist/standalone.js +7513 -0
  28. package/dist/webview/icons-Dx9MGYqN.js +180 -0
  29. package/dist/webview/icons-Dx9MGYqN.js.map +1 -0
  30. package/dist/webview/index.js +85 -0
  31. package/dist/webview/index.js.map +1 -0
  32. package/dist/webview/react-vendor-DkYdDBET.js +25 -0
  33. package/dist/webview/react-vendor-DkYdDBET.js.map +1 -0
  34. package/dist/webview/style.css +1 -0
  35. package/docs/images/board-overview.png +0 -0
  36. package/docs/images/editor-view.png +0 -0
  37. package/docs/plans/2026-02-20-kanban-json-config-design.md +74 -0
  38. package/docs/plans/2026-02-20-kanban-json-config.md +690 -0
  39. package/eslint.config.mjs +31 -0
  40. package/package.json +161 -0
  41. package/postcss.config.js +6 -0
  42. package/resources/icon-light.png +0 -0
  43. package/resources/icon-light.svg +105 -0
  44. package/resources/icon.png +0 -0
  45. package/resources/icon.svg +105 -0
  46. package/resources/kanban-dark.svg +21 -0
  47. package/resources/kanban-light.svg +21 -0
  48. package/resources/kanban.svg +21 -0
  49. package/src/cli/index.ts +846 -0
  50. package/src/extension/FeatureHeaderProvider.ts +370 -0
  51. package/src/extension/KanbanPanel.ts +973 -0
  52. package/src/extension/SidebarViewProvider.ts +507 -0
  53. package/src/extension/featureFileUtils.ts +82 -0
  54. package/src/extension/index.ts +234 -0
  55. package/src/mcp-server/index.ts +632 -0
  56. package/src/sdk/KanbanSDK.ts +349 -0
  57. package/src/sdk/__tests__/KanbanSDK.test.ts +468 -0
  58. package/src/sdk/__tests__/parser.test.ts +170 -0
  59. package/src/sdk/fileUtils.ts +76 -0
  60. package/src/sdk/index.ts +6 -0
  61. package/src/sdk/parser.ts +70 -0
  62. package/src/sdk/types.ts +15 -0
  63. package/src/shared/config.ts +113 -0
  64. package/src/shared/editorTypes.ts +14 -0
  65. package/src/shared/types.ts +120 -0
  66. package/src/standalone/__tests__/server.integration.test.ts +1916 -0
  67. package/src/standalone/__tests__/webhooks.test.ts +357 -0
  68. package/src/standalone/fileUtils.ts +70 -0
  69. package/src/standalone/index.ts +71 -0
  70. package/src/standalone/server.ts +1046 -0
  71. package/src/standalone/webhooks.ts +135 -0
  72. package/src/webview/App.tsx +469 -0
  73. package/src/webview/assets/main.css +329 -0
  74. package/src/webview/assets/standalone-theme.css +130 -0
  75. package/src/webview/components/ColumnDialog.tsx +119 -0
  76. package/src/webview/components/CreateFeatureDialog.tsx +524 -0
  77. package/src/webview/components/DatePicker.tsx +185 -0
  78. package/src/webview/components/FeatureCard.tsx +186 -0
  79. package/src/webview/components/FeatureEditor.tsx +623 -0
  80. package/src/webview/components/KanbanBoard.tsx +144 -0
  81. package/src/webview/components/KanbanColumn.tsx +159 -0
  82. package/src/webview/components/MarkdownEditor.tsx +291 -0
  83. package/src/webview/components/PrioritySelect.tsx +39 -0
  84. package/src/webview/components/QuickAddInput.tsx +72 -0
  85. package/src/webview/components/SettingsPanel.tsx +284 -0
  86. package/src/webview/components/Toolbar.tsx +175 -0
  87. package/src/webview/components/UndoToast.tsx +70 -0
  88. package/src/webview/index.html +12 -0
  89. package/src/webview/lib/utils.ts +6 -0
  90. package/src/webview/main.tsx +11 -0
  91. package/src/webview/standalone-main.tsx +13 -0
  92. package/src/webview/standalone-shim.ts +132 -0
  93. package/src/webview/standalone.html +12 -0
  94. package/src/webview/store/index.ts +241 -0
  95. package/tailwind.config.js +53 -0
  96. package/tsconfig.json +22 -0
  97. package/vite.config.ts +36 -0
  98. package/vite.standalone.config.ts +62 -0
  99. package/vitest.config.ts +15 -0
@@ -0,0 +1,85 @@
1
+ var xr=Object.defineProperty;var br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var F=(t,e,r)=>br(t,typeof e!="symbol"?e+"":e,r);import{r as b,R as Te,F as At,P as Oe,C as Ve,a as Ye,b as $e,E as mr,c as vr,T as Dt,X,d as kr,e as yr,H as wr,B as jr,I as zr,Q as Sr,f as Cr,L as Nr,g as Tr,h as Ar,i as Dr,j as Lt,S as Et,U as Rt,k as Mt,l as Fe,W as Lr,m as Er,n as Rr,o as Mr,p as $r}from"./icons-Dx9MGYqN.js";import{r as Fr}from"./react-vendor-DkYdDBET.js";var $t={exports:{}},Ie={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ir=b,Pr=Symbol.for("react.element"),Br=Symbol.for("react.fragment"),_r=Object.prototype.hasOwnProperty,Or=Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qr={key:!0,ref:!0,__self:!0,__source:!0};function Ft(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)_r.call(e,s)&&!qr.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:Pr,type:t,key:i,ref:a,props:o,_owner:Or.current}}Ie.Fragment=Br;Ie.jsx=Ft;Ie.jsxs=Ft;$t.exports=Ie;var n=$t.exports;const ye=new WebSocket(`ws://${window.location.host}/ws`),qe=[];let Je=!1;ye.addEventListener("open",()=>{Je=!0;for(const t of qe)ye.send(t);qe.length=0});ye.addEventListener("message",t=>{try{const e=JSON.parse(t.data);window.postMessage(e,"*")}catch{}});ye.addEventListener("close",()=>{Je=!1});let Ke=null;try{const t=sessionStorage.getItem("kanban-standalone-state");t&&(Ke=JSON.parse(t))}catch{}function Kr(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 u=0;u<a.length;u++)l+=String.fromCharCode(a[u]);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 Ur(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"){Kr(e.featureId);return}if(e.type==="openAttachment"){Ur(e.featureId,e.attachment);return}const r=JSON.stringify(t);Je?ye.send(r):qe.push(r)},getState(){return Ke},setState(t){Ke=t;try{sessionStorage.setItem("kanban-standalone-state",JSON.stringify(t))}catch{}}});const Ue=window.matchMedia("(prefers-color-scheme: dark)");function Ge(t){document.body.classList.toggle("vscode-dark",t),document.body.classList.toggle("vscode-light",!t)}Ue.addEventListener("change",t=>Ge(t.matches));document.body?Ge(Ue.matches):document.addEventListener("DOMContentLoaded",()=>Ge(Ue.matches));var It,dt=Fr;It=dt.createRoot,dt.hydrateRoot;const Gr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function de(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)+de(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]+de(t.slice(1),null,r)}function Pt(t){if(t.length!==Bt(t[0]))throw new Error("invalid integer part of order key: "+t)}function Bt(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 ve(t){const e=Bt(t[0]);if(e>t.length)throw new Error("invalid order key: "+t);return t.slice(0,e)}function ut(t,e){if(t==="A"+e[0].repeat(26))throw new Error("invalid order key: "+t);const r=ve(t);if(t.slice(r.length).slice(-1)===e[0])throw new Error("invalid order key: "+t)}function pt(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 Wr(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 Hr(t,e,r=Gr){if(t!=null&&ut(t,r),e!=null&&ut(e,r),t!=null&&e!=null&&t>=e)throw new Error(t+" >= "+e);if(t==null){if(e==null)return"a"+r[0];const u=ve(e),c=e.slice(u.length);if(u==="A"+r[0].repeat(26))return u+de("",c,r);if(u<e)return u;const p=Wr(u,r);if(p==null)throw new Error("cannot decrement any more");return p}if(e==null){const u=ve(t),c=t.slice(u.length),p=pt(u,r);return p??u+de(c,null,r)}const s=ve(t),o=t.slice(s.length),i=ve(e),a=e.slice(i.length);if(s===i)return s+de(o,a,r);const l=pt(s,r);if(l==null)throw new Error("cannot increment any more");return l<e?l:s+de(o,null,r)}const ht=t=>{let e;const r=new Set,s=(c,p)=>{const h=typeof c=="function"?c(e):c;if(!Object.is(h,e)){const g=e;e=p??(typeof h!="object"||h===null)?h:Object.assign({},e,h),r.forEach(d=>d(e,g))}},o=()=>e,l={setState:s,getState:o,getInitialState:()=>u,subscribe:c=>(r.add(c),()=>r.delete(c))},u=e=t(s,o,l);return l},Zr=t=>t?ht(t):ht,Qr=t=>t;function Vr(t,e=Qr){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 gt=t=>{const e=Zr(t),r=s=>Vr(e,s);return Object.assign(r,e),r},Yr=t=>t?gt(t):gt,Jr=()=>typeof document<"u"?document.body.classList.contains("vscode-dark")||document.body.classList.contains("vscode-high-contrast"):!1,Xr=t=>{const e=new Date;return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()},es=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},ts=t=>{const e=new Date;return e.setHours(0,0,0,0),t<e},O=Yr((t,e)=>({features:[],columns:[],isDarkMode:Jr(),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:u}=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(u!=="all")if(u==="no-date"){if(c.dueDate)return!1}else if(c.dueDate){const p=new Date(c.dueDate);if(u==="overdue"&&!ts(p)||u==="today"&&!Xr(p)||u==="this-week"&&!es(p))return!1}else return!1;if(o){const p=o.toLowerCase();return c.content.toLowerCase().includes(p)||c.id.toLowerCase().includes(p)||c.assignee&&c.assignee.toLowerCase().includes(p)||c.labels.some(h=>h.toLowerCase().includes(p))}return!0}).sort((c,p)=>c.order<p.order?-1:c.order>p.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 Xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var oe=Xe();function _t(t){oe=t}var se={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(q.caret,"$1"),r=r.replace(o,a),s},getRegex:()=>new RegExp(r,e)};return s}var rs=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),q={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)}}>`)},ss=/^(?:[ \t]*(?:\n|$))+/,ns=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,os=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,we=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ls=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,et=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ot=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qt=E(Ot).replace(/bull/g,et).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(),as=E(Ot).replace(/bull/g,et).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(),tt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,is=/^[^\n]+/,rt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,cs=E(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ds=E(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,et).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",st=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,us=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",st).replace("tag",Pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kt=E(tt).replace("hr",we).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(),ps=E(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kt).getRegex(),nt={blockquote:ps,code:ns,def:cs,fences:os,heading:ls,hr:we,html:us,lheading:qt,list:ds,newline:ss,paragraph:Kt,table:se,text:is},ft=E("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",we).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(),hs={...nt,lheading:as,table:ft,paragraph:E(tt).replace("hr",we).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ft).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()},gs={...nt,html:E(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",st).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:se,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:E(tt).replace("hr",we).replace("heading",` *#{1,6} *[^
10
+ ]`).replace("lheading",qt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},fs=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xs=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ut=/^( {2,}|\\)\n(?!\s*$)/,bs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Be=/[\p{P}\p{S}]/u,ot=/[\s\p{P}\p{S}]/u,Gt=/[^\s\p{P}\p{S}]/u,ms=E(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ot).getRegex(),Wt=/(?!~)[\p{P}\p{S}]/u,vs=/(?!~)[\s\p{P}\p{S}]/u,ks=/(?:[^\s\p{P}\p{S}]|~)/u,Ht=/(?![*_])[\p{P}\p{S}]/u,ys=/(?![*_])[\s\p{P}\p{S}]/u,ws=/(?:[^\s\p{P}\p{S}]|[*_])/u,js=E(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",rs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Zt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zs=E(Zt,"u").replace(/punct/g,Be).getRegex(),Ss=E(Zt,"u").replace(/punct/g,Wt).getRegex(),Qt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Cs=E(Qt,"gu").replace(/notPunctSpace/g,Gt).replace(/punctSpace/g,ot).replace(/punct/g,Be).getRegex(),Ns=E(Qt,"gu").replace(/notPunctSpace/g,ks).replace(/punctSpace/g,vs).replace(/punct/g,Wt).getRegex(),Ts=E("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gt).replace(/punctSpace/g,ot).replace(/punct/g,Be).getRegex(),As=E(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ht).getRegex(),Ds="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ls=E(Ds,"gu").replace(/notPunctSpace/g,ws).replace(/punctSpace/g,ys).replace(/punct/g,Ht).getRegex(),Es=E(/\\(punct)/,"gu").replace(/punct/g,Be).getRegex(),Rs=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(),Ms=E(st).replace("(?:-->|$)","-->").getRegex(),$s=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",Ms).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ee=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Fs=E(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ee).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vt=E(/^!?\[(label)\]\[(ref)\]/).replace("label",Ee).replace("ref",rt).getRegex(),Yt=E(/^!?\[(ref)\](?:\[\])?/).replace("ref",rt).getRegex(),Is=E("reflink|nolink(?!\\()","g").replace("reflink",Vt).replace("nolink",Yt).getRegex(),xt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lt={_backpedal:se,anyPunctuation:Es,autolink:Rs,blockSkip:js,br:Ut,code:xs,del:se,delLDelim:se,delRDelim:se,emStrongLDelim:zs,emStrongRDelimAst:Cs,emStrongRDelimUnd:Ts,escape:fs,link:Fs,nolink:Yt,punctuation:ms,reflink:Vt,reflinkSearch:Is,tag:$s,text:bs,url:se},Ps={...lt,link:E(/^!?\[(label)\]\((.*?)\)/).replace("label",Ee).getRegex(),reflink:E(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ee).getRegex()},We={...lt,emStrongRDelimAst:Ns,emStrongLDelim:Ss,delLDelim:As,delRDelim:Ls,url:E(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xt).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",xt).getRegex()},Bs={...We,br:E(Ut).replace("{2,}","*").getRegex(),text:E(We.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ae={normal:nt,gfm:hs,pedantic:gs},ge={normal:lt,gfm:We,breaks:Bs,pedantic:Ps},_s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},bt=t=>_s[t];function Q(t,e){if(e){if(q.escapeTest.test(t))return t.replace(q.escapeReplace,bt)}else if(q.escapeTestNoEncode.test(t))return t.replace(q.escapeReplaceNoEncode,bt);return t}function mt(t){try{t=encodeURI(t).replace(q.percentDecode,"%")}catch{return null}return t}function vt(t,e){var i;let r=t.replace(q.findPipe,(a,l,u)=>{let c=!1,p=l;for(;--p>=0&&u[p]==="\\";)c=!c;return c?"|":" |"}),s=r.split(q.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(q.slashPipe,"|");return s}function fe(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 Os(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 qs(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 kt(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 u={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,u}function Ks(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let o=s[1];return e.split(`
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){F(this,"options");F(this,"rules");F(this,"lexer");this.options=t||oe}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:fe(r,`
13
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=Ks(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=fe(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:fe(e[0],`
14
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=fe(e[0],`
15
+ `).split(`
16
+ `),s="",o="",i=[];for(;r.length>0;){let a=!1,l=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))l.push(r[u]),a=!0;else if(!a)l.push(r[u]);else break;r=r.slice(u);let c=l.join(`
17
+ `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
18
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
19
+ ${c}`:c,o=o?`${o}
20
+ ${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,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,x=d.raw+`
21
+ `+r.join(`
22
+ `),m=this.blockquote(x);i[i.length-1]=m,s=s.substring(0,s.length-d.raw.length)+m.raw,o=o.substring(0,o.length-d.text.length)+m.text;break}else if((g==null?void 0:g.type)==="list"){let d=g,x=d.raw+`
23
+ `+r.join(`
24
+ `),m=this.list(x);i[i.length-1]=m,s=s.substring(0,s.length-g.raw.length)+m.raw,o=o.substring(0,o.length-d.raw.length)+m.raw,r=x.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),u=!1;for(;t;){let p=!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=qs(e[2].split(`
26
+ `,1)[0],e[1].length),x=t.split(`
27
+ `,1)[0],m=!d.trim(),y=0;if(this.options.pedantic?(y=2,g=d.trimStart()):m?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),m&&this.rules.other.blankLine.test(x)&&(h+=x+`
28
+ `,t=t.substring(x.length+1),p=!0),!p){let v=this.rules.other.nextBulletRegex(y),C=this.rules.other.hrRegex(y),k=this.rules.other.fencesBeginRegex(y),f=this.rules.other.headingBeginRegex(y),A=this.rules.other.htmlBeginRegex(y),j=this.rules.other.blockquoteBeginRegex(y);for(;t;){let z=t.split(`
29
+ `,1)[0],N;if(x=z,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),N=x):N=x.replace(this.rules.other.tabCharGlobal," "),k.test(x)||f.test(x)||A.test(x)||j.test(x)||v.test(x)||C.test(x))break;if(N.search(this.rules.other.nonSpaceChar)>=y||!x.trim())g+=`
30
+ `+N.slice(y);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(d)||f.test(d)||C.test(d))break;g+=`
31
+ `+x}m=!x.trim(),h+=z+`
32
+ `,t=t.substring(z.length+1),d=N.slice(y)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(u=!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 p of a.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((r=p.tokens[0])==null?void 0:r.type)==="text"||((s=p.tokens[0])==null?void 0:s.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.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(p.raw);if(h){let g={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};p.checked=g.checked,a.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=g.raw+p.tokens[0].raw,p.tokens[0].text=g.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(g)):p.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):p.tokens.unshift(g)}}if(!a.loose){let h=p.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 p of a.items){p.loose=!0;for(let h of p.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=vt(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(vt(l,i.header.length).map((u,c)=>({text:u,tokens:this.lexer.inline(u),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=fe(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=Os(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)),kt(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 kt(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,u=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)){u+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+u);let p=[...s[0]][0].length,h=t.slice(0,o+s.index+p+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,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+o);(s=u.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,p=t.slice(0,o+s.index+c+a),h=p.slice(o,-o);return{type:"del",raw:p,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}}}},H=class He{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||oe,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:q,block:Ae.normal,inline:ge.normal};this.options.pedantic?(r.block=Ae.pedantic,r.inline=ge.pedantic):this.options.gfm&&(r.block=Ae.gfm,this.options.breaks?r.inline=ge.breaks:r.inline=ge.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ae,inline:ge}}static lex(e,r){return new He(r).lex(e)}static lexInline(e,r){return new He(r).inlineTokens(e)}lex(e){e=e.replace(q.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(q.tabCharGlobal," ").replace(q.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
+ `: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
+ `)?"":`
38
+ `)+l.raw,c.text+=`
39
+ `+l.text,this.inlineQueue.at(-1).src=c.text):r.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(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(`
40
+ `)?"":`
41
+ `)+l.raw,c.text+=`
42
+ `+l.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),r.push(l);continue}let u=e;if((a=this.options.extensions)!=null&&a.startBlock){let c=1/0,p=e.slice(1),h;this.options.extensions.startBlock.forEach(g=>{h=g.call({lexer:this},p),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){let c=r.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
43
+ `)?"":`
44
+ `)+l.raw,c.text+=`
45
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(l),s=u.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
+ `)?"":`
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 u,c,p,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=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:c.call({lexer:this},s))??s;let a=!1,l="";for(;e;){a||(l=""),a=!1;let d;if((h=(p=this.options.extensions)==null?void 0:p.inline)!=null&&h.some(m=>(d=m.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 m=r.at(-1);d.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.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 x=e;if((g=this.options.extensions)!=null&&g.startInline){let m=1/0,y=e.slice(1),v;this.options.extensions.startInline.forEach(C=>{v=C.call({lexer:this},y),typeof v=="number"&&v>=0&&(m=Math.min(m,v))}),m<1/0&&m>=0&&(x=e.substring(0,m+1))}if(d=this.tokenizer.inlineText(x)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),a=!0;let m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=d.raw,m.text+=d.text):r.push(d);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return r}},Me=class{constructor(t){F(this,"options");F(this,"parser");this.options=t||oe}space(t){return""}code({text:t,lang:e,escaped:r}){var i;let s=(i=(e||"").match(q.notSpaceStart))==null?void 0:i[0],o=t.replace(q.endingNewline,"")+`
49
+ `;return s?'<pre><code class="language-'+Q(s)+'">'+(r?o:Q(o,!0))+`</code></pre>
50
+ `:"<pre><code>"+(r?o:Q(o,!0))+`</code></pre>
51
+ `}blockquote({tokens:t}){return`<blockquote>
52
+ ${this.parser.parse(t)}</blockquote>
53
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
54
+ `}hr(t){return`<hr>
55
+ `}list(t){let e=t.ordered,r=t.start,s="";for(let a=0;a<t.items.length;a++){let l=t.items[a];s+=this.listitem(l)}let o=e?"ol":"ul",i=e&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
56
+ `+s+"</"+o+`>
57
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
58
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
59
+ `}table(t){let e="",r="";for(let o=0;o<t.header.length;o++)r+=this.tablecell(t.header[o]);e+=this.tablerow({text:r});let s="";for(let o=0;o<t.rows.length;o++){let i=t.rows[o];r="";for(let a=0;a<i.length;a++)r+=this.tablecell(i[a]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
60
+ <thead>
61
+ `+e+`</thead>
62
+ `+s+`</table>
63
+ `}tablerow({text:t}){return`<tr>
64
+ ${t}</tr>
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>${Q(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=mt(t);if(o===null)return s;t=o;let i='<a href="'+t+'"';return e&&(i+=' title="'+Q(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=mt(t);if(o===null)return Q(r);t=o;let i=`<img src="${t}" alt="${Q(r)}"`;return e&&(i+=` title="${Q(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Q(t.text)}},at=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}},Z=class Ze{constructor(e){F(this,"options");F(this,"renderer");F(this,"textRenderer");this.options=e||oe,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new at}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 u=a,c=this.options.extensions.renderers[u.type].call({parser:this},u);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.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 u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}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 u=l;switch(u.type){case"escape":{s+=r.text(u);break}case"html":{s+=r.html(u);break}case"link":{s+=r.link(u);break}case"image":{s+=r.image(u);break}case"checkbox":{s+=r.checkbox(u);break}case"strong":{s+=r.strong(u);break}case"em":{s+=r.em(u);break}case"codespan":{s+=r.codespan(u);break}case"br":{s+=r.br(u);break}case"del":{s+=r.del(u);break}case"text":{s+=r.text(u);break}default:{let c='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},Le,ke=(Le=class{constructor(t){F(this,"options");F(this,"block");this.options=t||oe}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?H.lex:H.lexInline}provideParser(){return this.block?Z.parse:Z.parseInline}},F(Le,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),F(Le,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Le),Us=class{constructor(...t){F(this,"defaults",Xe());F(this,"options",this.setOptions);F(this,"parse",this.parseMarkdown(!0));F(this,"parseInline",this.parseMarkdown(!1));F(this,"Parser",Z);F(this,"Renderer",Me);F(this,"TextRenderer",at);F(this,"Lexer",H);F(this,"Tokenizer",Re);F(this,"Hooks",ke);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 u of l)r=r.concat(this.walkTokens(u.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 u=a[l].flat(1/0);r=r.concat(this.walkTokens(u,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 Me(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],u=o[a];o[a]=(...c)=>{let p=l.apply(o,c);return p===!1&&(p=u.apply(o,c)),p||""}}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],u=o[a];o[a]=(...c)=>{let p=l.apply(o,c);return p===!1&&(p=u.apply(o,c)),p}}s.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new ke;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],u=o[a];ke.passThroughHooks.has(i)?o[a]=c=>{if(this.defaults.async&&ke.passThroughHooksRespectAsync.has(i))return(async()=>{let h=await l.call(o,c);return u.call(o,h)})();let p=l.call(o,c);return u.call(o,p)}:o[a]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(o,c);return h===!1&&(h=await u.apply(o,c)),h})();let p=l.apply(o,c);return p===!1&&(p=u.apply(o,c)),p}}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 H.lex(t,e??this.defaults)}parser(t,e){return Z.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?H.lex:H.lexInline)(a,o),u=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let c=await(o.hooks?await o.hooks.provideParser():t?Z.parse:Z.parseInline)(u,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?H.lex:H.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?Z.parse:Z.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>"+Q(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},ne=new Us;function M(t,e){return ne.parse(t,e)}M.options=M.setOptions=function(t){return ne.setOptions(t),M.defaults=ne.defaults,_t(M.defaults),M};M.getDefaults=Xe;M.defaults=oe;M.use=function(...t){return ne.use(...t),M.defaults=ne.defaults,_t(M.defaults),M};M.walkTokens=function(t,e){return ne.walkTokens(t,e)};M.parseInline=ne.parseInline;M.Parser=Z;M.parser=Z.parse;M.Renderer=Me;M.TextRenderer=at;M.Lexer=H;M.lexer=H.lex;M.Tokenizer=Re;M.Hooks=ke;M.parse=M;M.options;M.setOptions;M.use;M.walkTokens;M.parseInline;Z.parse;H.lex;function Jt(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 yt={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"},wt={critical:"Critical",high:"High",medium:"Med",low:"Low"};function Gs(t){const e=t.split(`
69
+ `),r=e.findIndex(i=>/^#\s+/.test(i));return(r>=0?e.slice(r+1):e).join(`
70
+ `).trim()}function Ws(t){return M.parse(t,{async:!1,gfm:!0,breaks:!0})}function Hs({feature:t,onClick:e,isDragging:r}){const{cardSettings:s}=O(),o=Jt(t.content),i=Gs(t.content),a=t.filePath&&t.filePath.split("/").pop()||"",l=h=>{if(!h)return null;const g=new Date(h),d=new Date,x=g.getTime()-d.getTime(),m=Math.ceil(x/(1e3*60*60*24));return m<0?{text:"Overdue",className:"text-red-500"}:m===0?{text:"Today",className:"text-orange-500"}:m===1?{text:"Tomorrow",className:"text-yellow-600 dark:text-yellow-400"}:m<=7?{text:`${m}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"}},u=t.status==="done"?null:l(t.dueDate),c=h=>{if(!h)return null;const g=new Date(h),x=new Date().getTime()-g.getTime(),m=Math.floor(x/(1e3*60)),y=Math.floor(x/(1e3*60*60)),v=Math.floor(x/(1e3*60*60*24));return m<1?"Just now":m<60?`${m}m ago`:y<24?`${y}h ago`:v===1?"1d ago":v<30?`${v}d ago`:v<365?`${Math.floor(v/30)}mo ago`:`${Math.floor(v/365)}y ago`},p=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 ${yt[t.priority]}`,children:wt[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 ${yt[t.priority]}`,children:wt[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:Ws(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(Oe,{size:12}),n.jsx("span",{children:t.attachments.length})]}),s.showDueDate&&u&&n.jsxs("div",{className:`flex items-center gap-1 ${u.className}`,children:[n.jsx(Ve,{size:12}),n.jsx("span",{children:u.text})]}),p&&n.jsxs("div",{className:"flex items-center gap-1",style:{color:"var(--vscode-descriptionForeground)"},children:[n.jsx(Ye,{size:12}),n.jsx("span",{children:p})]})]})]})}function Zs({column:t,features:e,onFeatureClick:r,onAddFeature:s,onEditColumn:o,onRemoveColumn:i,onDragStart:a,onDragOver:l,onDragOverCard:u,onDrop:c,onDragEnd:p,draggedFeature:h,dropTarget:g,layout:d}){const x=d==="vertical",m=g&&g.columnId===t.id,[y,v]=b.useState(!1),C=b.useRef(null);return b.useEffect(()=>{if(!y)return;const k=f=>{C.current&&!C.current.contains(f.target)&&v(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[y]),n.jsxs("div",{className:x?"flex flex-col bg-zinc-100 dark:bg-zinc-800/50 rounded-lg":"flex-shrink-0 w-72 h-full flex flex-col bg-zinc-100 dark:bg-zinc-800/50 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($e,{size:16,className:"text-zinc-500"})}),n.jsxs("div",{className:"relative",ref:C,children:[n.jsx("button",{type:"button",onClick:()=>v(!y),className:"p-1 rounded hover:bg-zinc-200/60 dark:hover:bg-zinc-700/60 transition-colors",title:"Column options",children:n.jsx(mr,{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:()=>{v(!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(vr,{size:14}),"Edit List"]}),n.jsxs("button",{type:"button",onClick:()=>{v(!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(Dt,{size:14}),"Remove List"]})]})]})]})]}),n.jsxs("div",{className:x?"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,f)=>n.jsxs("div",{children:[m&&g.index===f&&n.jsx("div",{className:"h-0.5 bg-blue-500 rounded-full mx-1 mb-1"}),n.jsx("div",{draggable:!0,onDragStart:A=>a(A,k),onDragOver:A=>u(A,t.id,f),onDragEnd:p,className:`${x?"w-64":""} ${(h==null?void 0:h.id)===k.id?"opacity-40":""}`,children:n.jsx(Hs,{feature:k,onClick:()=>r(k)})})]},k.id)),m&&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:x?"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 Qs({onFeatureClick:t,onAddFeature:e,onMoveFeature:r,onEditColumn:s,onRemoveColumn:o}){const i=O(k=>k.columns),a=O(k=>k.getFilteredFeaturesByStatus),l=O(k=>k.getFeaturesByStatus),u=O(k=>k.layout),[c,p]=b.useState(null),[h,g]=b.useState(null),d=b.useCallback((k,f)=>{p(f),k.dataTransfer.effectAllowed="move",k.dataTransfer.setData("text/plain",f.id)},[]),x=b.useCallback(k=>{k.preventDefault(),k.dataTransfer.dropEffect="move"},[]),m=b.useCallback((k,f,A)=>{k.preventDefault(),k.dataTransfer.dropEffect="move";const j=k.currentTarget.getBoundingClientRect(),z=j.top+j.height/2,N=k.clientY<z?A:A+1;g(S=>S&&S.columnId===f&&S.index===N?S:{columnId:f,index:N})},[]),y=b.useCallback((k,f)=>{if(k.preventDefault(),!c)return;const A=a(f);let j;if(h&&h.columnId===f?j=h.index:j=A.length,c.status===f){const R=A.findIndex(U=>U.id===c.id);if(R!==-1&&j>R&&j--,R===j){p(null),g(null);return}}const z=l(f).filter(R=>R.id!==c.id),N=A.filter(R=>R.id!==c.id);let S;if(N.length===0)S=z.length;else if(j>=N.length){const R=N[N.length-1];S=z.findIndex($=>$.id===R.id)+1}else{const R=N[j];S=z.findIndex(U=>U.id===R.id)}r(c.id,f,S),p(null),g(null)},[c,h,a,l,r]),v=b.useCallback(()=>{p(null),g(null)},[]),C=u==="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(k=>n.jsx(Zs,{column:k,features:a(k.id),onFeatureClick:t,onAddFeature:e,onEditColumn:s,onRemoveColumn:o,onDragStart:d,onDragOver:x,onDragOverCard:m,onDrop:y,onDragEnd:v,draggedFeature:c,dropTarget:h,layout:u},k.id))})})}function Xt(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=Xt(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function Vs(){for(var t,e,r=0,s="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Xt(t))&&(s&&(s+=" "),s+=e);return s}const it="-",Ys=t=>{const e=Xs(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:a=>{const l=a.split(it);return l[0]===""&&l.length!==1&&l.shift(),er(l,e)||Js(a)},getConflictingClassGroupIds:(a,l)=>{const u=r[a]||[];return l&&s[a]?[...u,...s[a]]:u}}},er=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),o=s?er(t.slice(1),s):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(it);return(a=e.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},jt=/^\[(.+)\]$/,Js=t=>{if(jt.test(t)){const e=jt.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},Xs=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return tn(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:zt(e,o);i.classGroupId=r;return}if(typeof o=="function"){if(en(o)){Qe(o(s),e,r,s);return}e.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{Qe(a,zt(e,i),r,s)})})},zt=(t,e)=>{let r=t;return e.split(it).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},en=t=>t.isThemeGetter,tn=(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,rn=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)}}},tr="!",sn=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,o=e[0],i=e.length,a=l=>{const u=[];let c=0,p=0,h;for(let y=0;y<l.length;y++){let v=l[y];if(c===0){if(v===o&&(s||l.slice(y,y+i)===e)){u.push(l.slice(p,y)),p=y+i;continue}if(v==="/"){h=y;continue}}v==="["?c++:v==="]"&&c--}const g=u.length===0?l:l.substring(p),d=g.startsWith(tr),x=d?g.substring(1):g,m=h&&h>p?h-p:void 0;return{modifiers:u,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:m}};return r?l=>r({className:l,parseClassName:a}):a},nn=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},on=t=>({cache:rn(t.cacheSize),parseClassName:sn(t),...Ys(t)}),ln=/\s+/,an=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=e,i=[],a=t.trim().split(ln);let l="";for(let u=a.length-1;u>=0;u-=1){const c=a[u],{modifiers:p,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:d}=r(c);let x=!!d,m=s(x?g.substring(0,d):g);if(!m){if(!x){l=c+(l.length>0?" "+l:l);continue}if(m=s(g),!m){l=c+(l.length>0?" "+l:l);continue}x=!1}const y=nn(p).join(":"),v=h?y+tr:y,C=v+m;if(i.includes(C))continue;i.push(C);const k=o(m,x);for(let f=0;f<k.length;++f){const A=k[f];i.push(v+A)}l=c+(l.length>0?" "+l:l)}return l};function cn(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=rr(e))&&(s&&(s+=" "),s+=r);return s}const rr=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=rr(t[s]))&&(r&&(r+=" "),r+=e);return r};function dn(t,...e){let r,s,o,i=a;function a(u){const c=e.reduce((p,h)=>h(p),t());return r=on(c),s=r.cache.get,o=r.cache.set,i=l,l(u)}function l(u){const c=s(u);if(c)return c;const p=an(u,r);return o(u,p),p}return function(){return i(cn.apply(null,arguments))}}const P=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},sr=/^\[(?:([a-z-]+):)?(.+)\]$/i,un=/^\d+\/\d+$/,pn=new Set(["px","full","screen"]),hn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gn=/\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$/,fn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,xn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Y=t=>ue(t)||pn.has(t)||un.test(t),ee=t=>pe(t,"length",Sn),ue=t=>!!t&&!Number.isNaN(Number(t)),_e=t=>pe(t,"number",ue),xe=t=>!!t&&Number.isInteger(Number(t)),mn=t=>t.endsWith("%")&&ue(t.slice(0,-1)),T=t=>sr.test(t),te=t=>hn.test(t),vn=new Set(["length","size","percentage"]),kn=t=>pe(t,vn,nr),yn=t=>pe(t,"position",nr),wn=new Set(["image","url"]),jn=t=>pe(t,wn,Nn),zn=t=>pe(t,"",Cn),be=()=>!0,pe=(t,e,r)=>{const s=sr.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},Sn=t=>gn.test(t)&&!fn.test(t),nr=()=>!1,Cn=t=>xn.test(t),Nn=t=>bn.test(t),Tn=()=>{const t=P("colors"),e=P("spacing"),r=P("blur"),s=P("brightness"),o=P("borderColor"),i=P("borderRadius"),a=P("borderSpacing"),l=P("borderWidth"),u=P("contrast"),c=P("grayscale"),p=P("hueRotate"),h=P("invert"),g=P("gap"),d=P("gradientColorStops"),x=P("gradientColorStopPositions"),m=P("inset"),y=P("margin"),v=P("opacity"),C=P("padding"),k=P("saturate"),f=P("scale"),A=P("sepia"),j=P("skew"),z=P("space"),N=P("translate"),S=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto",T,e],$=()=>[T,e],je=()=>["",Y,ee],le=()=>["auto",ue,T],ze=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["solid","dashed","dotted","double","none"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>["start","end","center","between","around","evenly","stretch"],re=()=>["","0",T],Ce=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[ue,T];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[Y,ee],blur:["none","",te,T],brightness:G(),borderColor:[t],borderRadius:["none","","full",te,T],borderSpacing:$(),borderWidth:je(),contrast:G(),grayscale:re(),hueRotate:G(),invert:re(),gap:$(),gradientColorStops:[t],gradientColorStopPositions:[mn,ee],inset:U(),margin:U(),opacity:G(),padding:$(),saturate:G(),scale:G(),sepia:re(),skew:G(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",T]}],container:["container"],columns:[{columns:[te]}],"break-after":[{"break-after":Ce()}],"break-before":[{"break-before":Ce()}],"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:[...ze(),T]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",xe,T]}],basis:[{basis:U()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",T]}],grow:[{grow:re()}],shrink:[{shrink:re()}],order:[{order:["first","last","none",xe,T]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",xe,T]},T]}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[xe,T]},T]}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",T]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",T]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...he()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...he(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...he(),"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:[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":[z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",T,e]}],"min-w":[{"min-w":[T,e,"min","max","fit"]}],"max-w":[{"max-w":[T,e,"none","full","min","max","fit","prose",{screen:[te]},te]}],h:[{h:[T,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[T,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[T,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[T,e,"auto","min","max","fit"]}],"font-size":[{text:["base",te,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",_e]}],"font-family":[{font:[be]}],"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",T]}],"line-clamp":[{"line-clamp":["none",ue,_e]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Y,T]}],"list-image":[{"list-image":["none",T]}],"list-style-type":[{list:["none","disc","decimal",T]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Y,ee]}],"underline-offset":[{"underline-offset":["auto",Y,T]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",T]}],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",T]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ze(),yn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jn]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"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":[v]}],"border-style":[{border:[...ae(),"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":[v]}],"divide-style":[{divide:ae()}],"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:["",...ae()]}],"outline-offset":[{"outline-offset":[Y,T]}],"outline-w":[{outline:[Y,ee]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Y,ee]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",te,zn]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Se()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",te,T]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[h]}],saturate:[{saturate:[k]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",T]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",T]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",T]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[f]}],"scale-x":[{"scale-x":[f]}],"scale-y":[{"scale-y":[f]}],rotate:[{rotate:[xe,T]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",T]}],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",T]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",T]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Y,ee,_e]}],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"]}}},An=dn(Tn);function K(...t){return An(Vs(t))}const Dn=["Mo","Tu","We","Th","Fr","Sa","Su"],Ln=["January","February","March","April","May","June","July","August","September","October","November","December"];function En({value:t,onChange:e,placeholder:r="Due date"}){const[s,o]=b.useState(!1),i=new Date,a=t?new Date(t+"T00:00:00"):null,[l,u]=b.useState((a==null?void 0:a.getFullYear())??i.getFullYear()),[c,p]=b.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 f=1;f<=h;f++)d.push(f);const x=()=>{c===0?(p(11),u(f=>f-1)):p(f=>f-1)},m=()=>{c===11?(p(0),u(f=>f+1)):p(f=>f+1)},y=f=>{const A=String(c+1).padStart(2,"0"),j=String(f).padStart(2,"0");e(`${l}-${A}-${j}`),o(!1)},v=f=>f===i.getDate()&&c===i.getMonth()&&l===i.getFullYear(),C=f=>a!==null&&f===a.getDate()&&c===a.getMonth()&&l===a.getFullYear(),k=f=>new Date(f+"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:f=>f.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:f=>f.currentTarget.style.background="transparent",children:[n.jsx("span",{children:t?k(t):r}),t&&n.jsx("span",{role:"button",onClick:f=>{f.stopPropagation(),e(""),o(!1)},className:"ml-0.5 hover:text-red-500 transition-colors",children:n.jsx(X,{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:x,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:f=>f.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:f=>f.currentTarget.style.background="transparent",children:n.jsx(kr,{size:14})}),n.jsxs("span",{className:"text-xs font-medium",style:{color:"var(--vscode-foreground)"},children:[Ln[c]," ",l]}),n.jsx("button",{type:"button",onClick:m,className:"p-1 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:f=>f.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:f=>f.currentTarget.style.background="transparent",children:n.jsx(yr,{size:14})})]}),n.jsx("div",{className:"grid grid-cols-7 mb-1",children:Dn.map(f=>n.jsx("div",{className:"text-center text-[10px] font-medium py-1",style:{color:"var(--vscode-descriptionForeground)"},children:f},f))}),n.jsx("div",{className:"grid grid-cols-7",children:d.map((f,A)=>n.jsx("div",{className:"flex items-center justify-center",children:f?n.jsx("button",{type:"button",onClick:()=>y(f),className:K("w-7 h-7 rounded-md text-[11px] transition-colors font-medium"),style:{background:C(f)?"var(--vscode-focusBorder)":v(f)?"var(--vscode-editor-selectionBackground)":void 0,color:C(f)?"var(--vscode-editor-background)":(v(f),"var(--vscode-foreground)")},onMouseEnter:j=>{C(f)||(j.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:j=>{!C(f)&&!v(f)?j.currentTarget.style.background="transparent":v(f)&&!C(f)&&(j.currentTarget.style.background="var(--vscode-editor-selectionBackground)")},children:f}):n.jsx("div",{className:"w-7 h-7"})},A))}),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 f=String(i.getMonth()+1).padStart(2,"0"),A=String(i.getDate()).padStart(2,"0");e(`${i.getFullYear()}-${f}-${A}`),o(!1)},className:"text-[11px] font-medium transition-colors",style:{color:"var(--vscode-textLink-foreground)"},onMouseEnter:f=>f.currentTarget.style.color="var(--vscode-textLink-activeForeground)",onMouseLeave:f=>f.currentTarget.style.color="var(--vscode-textLink-foreground)",children:"Today"})})]})]})]})}function Rn(t,e,r,s){const o=t.selectionStart,i=t.selectionEnd,a=e.substring(o,i);let l=e.substring(0,o);const u=e.substring(i);let c=a,p=0;switch(s){case"heading":{const g=e.lastIndexOf(`
71
+ `,o-1)+1,d=e.substring(g,o);d.startsWith("### ")?(l=e.substring(0,g)+d.slice(4),c=a,p=-4):d.startsWith("## ")?(l=e.substring(0,g)+"### "+d.slice(3),c=a,p=1):d.startsWith("# ")?(l=e.substring(0,g)+"## "+d.slice(2),c=a,p=1):(l=e.substring(0,g)+"# "+d,c=a,p=2);break}case"bold":c=a?`**${a}**`:"**bold**",p=a?4:2;break;case"italic":c=a?`_${a}_`:"_italic_",p=a?2:1;break;case"quote":{c=a?a.split(`
72
+ `).map(d=>`> ${d}`).join(`
73
+ `):"> ",p=a?c.length-a.length:2;break}case"code":a.includes(`
74
+ `)?(c=`\`\`\`
75
+ ${a}
76
+ \`\`\``,p=4):(c=a?`\`${a}\``:"`code`",p=a?2:1);break;case"link":c=a?`[${a}](url)`:"[text](url)",p=a?a.length+3:1;break;case"ul":{c=a?a.split(`
77
+ `).map(d=>`- ${d}`).join(`
78
+ `):"- ",p=a?c.length-a.length:2;break}case"ol":{c=a?a.split(`
79
+ `).map((d,x)=>`${x+1}. ${d}`).join(`
80
+ `):"1. ",p=a?c.length-a.length:3;break}case"tasklist":{c=a?a.split(`
81
+ `).map(d=>`- [ ] ${d}`).join(`
82
+ `):"- [ ] ",p=a?c.length-a.length:6;break}}const h=l+c+u;r(h),requestAnimationFrame(()=>{t.focus();const g=o+(a?c.length:p);t.selectionStart=t.selectionEnd=g})}function J({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 or({value:t,onChange:e,placeholder:r="Write markdown...",className:s,autoFocus:o}){const[i,a]=b.useState("write"),l=b.useRef(null),u=b.useMemo(()=>t.trim()?M.parse(t,{async:!1,gfm:!0,breaks:!0}):"",[t]);b.useEffect(()=>{i==="write"&&l.current&&l.current.focus()},[i]),b.useEffect(()=>{o&&l.current&&l.current.focus()},[o]);const c=b.useCallback(h=>{l.current&&Rn(l.current,t,e,h)},[t,e]),p=h=>{if(h.key==="Tab"){h.preventDefault();const g=h.currentTarget,d=g.selectionStart,x=g.selectionEnd,m=t.substring(0,d)+" "+t.substring(x);e(m),requestAnimationFrame(()=>{g.selectionStart=g.selectionEnd=d+2})}(h.metaKey||h.ctrlKey)&&h.key==="b"&&(h.preventDefault(),h.stopPropagation(),c("bold")),(h.metaKey||h.ctrlKey)&&h.key==="i"&&(h.preventDefault(),c("italic")),(h.metaKey||h.ctrlKey)&&h.key==="k"&&(h.preventDefault(),c("link"))};return n.jsxs("div",{className:K("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:()=>a("write"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:i==="write"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Write",i==="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:()=>a("preview"),className:"px-3 py-2 text-xs font-medium transition-colors relative",style:{color:i==="preview"?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"},children:["Preview",i==="preview"&&n.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] rounded-t",style:{background:"var(--vscode-focusBorder)"}})]}),i==="write"&&n.jsxs("div",{className:"flex items-center ml-auto pr-2 gap-0.5",children:[n.jsx(J,{icon:n.jsx(wr,{size:14}),title:"Heading",onClick:()=>c("heading")}),n.jsx(J,{icon:n.jsx(jr,{size:14}),title:"Bold (⌘B)",onClick:()=>c("bold")}),n.jsx(J,{icon:n.jsx(zr,{size:14}),title:"Italic (⌘I)",onClick:()=>c("italic")}),n.jsx(J,{icon:n.jsx(Sr,{size:14}),title:"Quote",onClick:()=>c("quote"),separator:!0}),n.jsx(J,{icon:n.jsx(Cr,{size:14}),title:"Code",onClick:()=>c("code")}),n.jsx(J,{icon:n.jsx(Nr,{size:14}),title:"Link (⌘K)",onClick:()=>c("link")}),n.jsx(J,{icon:n.jsx(Tr,{size:14}),title:"Bulleted list",onClick:()=>c("ul"),separator:!0}),n.jsx(J,{icon:n.jsx(Ar,{size:14}),title:"Numbered list",onClick:()=>c("ol")}),n.jsx(J,{icon:n.jsx(Dr,{size:14}),title:"Task list",onClick:()=>c("tasklist")})]})]}),n.jsx("div",{className:"flex-1 overflow-auto",children:i==="write"?n.jsx("textarea",{ref:l,value:t,onChange:h=>e(h.target.value),onKeyDown:p,placeholder:r,className:"markdown-editor-textarea",spellCheck:!1}):n.jsx("div",{className:"min-h-[200px]",children:u?n.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-4",dangerouslySetInnerHTML:{__html:u}}):n.jsx("p",{className:"p-4 text-sm italic",style:{color:"var(--vscode-descriptionForeground)"},children:"Nothing to preview"})})})]})}const Mn=[{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"}],$n=[{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]=b.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:K("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:K("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Fe,{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:u=>{l.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{l.value!==t&&(u.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:K("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 Fn({value:t,onChange:e}){const[r,s]=b.useState(!1),o=b.useRef(null),i=b.useRef(null),a=O(h=>h.features),l=b.useMemo(()=>{const h=new Set;return a.forEach(g=>{g.assignee&&h.add(g.assignee)}),Array.from(h).sort()},[a]),u=b.useMemo(()=>t.trim()?l.filter(h=>h.toLowerCase().includes(t.toLowerCase())&&h!==t):l,[t,l]),c=r&&u.length>0,p=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:[p&&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:p}),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:u.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 In({labels:t,onChange:e}){const[r,s]=b.useState(""),[o,i]=b.useState(!1),a=b.useRef(null),l=O(g=>g.features),u=b.useMemo(()=>{const g=new Set;return l.forEach(d=>d.labels.forEach(x=>g.add(x))),Array.from(g).sort()},[l]),c=b.useMemo(()=>{const g=u.filter(d=>!t.includes(d));return r.trim()?g.filter(d=>d.toLowerCase().includes(r.toLowerCase())):g},[r,u,t]),p=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(x=>x!==g))},className:"hover:text-red-500 transition-colors",children:n.jsx(X,{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)"}})]}),p&&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 me({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 Pn({isOpen:t,...e}){return t?n.jsx(Bn,{isOpen:t,...e}):null}function Bn({isOpen:t,onClose:e,onCreate:r,initialStatus:s}){const{cardSettings:o}=O(),[i,a]=b.useState(""),[l,u]=b.useState(s??o.defaultStatus),[c,p]=b.useState(o.defaultPriority),[h,g]=b.useState(""),[d,x]=b.useState(""),[m,y]=b.useState([]),[v,C]=b.useState(""),k=b.useRef(null);b.useEffect(()=>{const z=setTimeout(()=>{var N;return(N=k.current)==null?void 0:N.focus()},50);return()=>clearTimeout(z)},[]);const f=()=>{const z=v.trim(),N=i.trim(),S=N?`# ${N}${z?`
83
+
84
+ ${z}`:""}`:z;r({status:l,priority:c,content:S,assignee:h.trim()||null,dueDate:d||null,labels:m})},A=()=>{f(),e()},j=()=>{e()};return b.useEffect(()=>{const z=N=>{N.key==="Escape"&&j(),(N.metaKey||N.ctrlKey)&&N.key==="Enter"&&A(),(N.metaKey||N.ctrlKey)&&N.key==="s"&&(N.preventDefault(),A())};if(t)return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)}),n.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",children:[n.jsx("div",{className:"absolute inset-0 bg-black/30",onClick:j}),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:j,className:"p-1.5 rounded transition-colors",style:{color:"var(--vscode-descriptionForeground)"},onMouseEnter:z=>z.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:z=>z.currentTarget.style.background="transparent",children:n.jsx(X,{size:18})})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(me,{label:"Status",icon:n.jsx(Lt,{size:13}),children:n.jsx(St,{value:l,options:$n.map(z=>({value:z.value,label:z.label,dot:z.dot})),onChange:z=>u(z)})}),o.showPriorityBadges&&n.jsx(me,{label:"Priority",icon:n.jsx(Et,{size:13}),children:n.jsx(St,{value:c,options:Mn.map(z=>({value:z.value,label:z.label,dot:z.dot})),onChange:z=>p(z)})}),o.showAssignee&&n.jsx(me,{label:"Assignee",icon:n.jsx(Rt,{size:13}),children:n.jsx(Fn,{value:h,onChange:g})}),o.showDueDate&&n.jsx(me,{label:"Due date",icon:n.jsx(Ve,{size:13}),children:n.jsx(En,{value:d,onChange:x})}),o.showLabels&&n.jsx(me,{label:"Labels",icon:n.jsx(Mt,{size:13}),children:n.jsx(In,{labels:m,onChange:y})})]}),n.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[n.jsx("textarea",{ref:k,value:i,onChange:z=>a(z.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:z=>{const N=z.target;N.style.height="auto",N.style.height=N.scrollHeight+"px"},onKeyDown:z=>{z.key==="Enter"&&!z.shiftKey&&z.preventDefault()}}),n.jsx(or,{value:v,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:j,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:z=>z.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:z=>z.currentTarget.style.background="transparent",children:"Cancel"}),n.jsx("button",{type:"button",onClick:A,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:z=>z.currentTarget.style.background="var(--vscode-button-hoverBackground)",onMouseLeave:z=>z.currentTarget.style.background="var(--vscode-button-background)",children:"Save"})]})]})]})]})}const _n={critical:"Critical",high:"High",medium:"Medium",low:"Low"},On={backlog:"Backlog",todo:"To Do","in-progress":"In Progress",review:"Review",done:"Done"},qn=["critical","high","medium","low"],Kn=["backlog","todo","in-progress","review","done"],Un={critical:"bg-red-500",high:"bg-orange-500",medium:"bg-yellow-500",low:"bg-green-500"},Gn={backlog:"bg-zinc-400",todo:"bg-blue-400","in-progress":"bg-amber-400",review:"bg-purple-400",done:"bg-emerald-400"},Wn=[{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"}],Hn={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"}},Zn={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 Ct({value:t,options:e,onChange:r,className:s}){const[o,i]=b.useState(!1),a=e.find(l=>l.value===t);return n.jsxs("div",{className:K("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:K("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Fe,{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:u=>{l.value!==t&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{l.value!==t&&(u.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:K("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 ie({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 Qn({onSelect:t}){const[e,r]=b.useState(!1),[s,o]=b.useState("claude"),i=Zn[s],a=Hn[s];return n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>r(!e),className:K("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(Lr,{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(Fe,{size:11,className:K("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:Wn.map(l=>n.jsx("button",{onClick:()=>o(l.agent),className:K("flex-1 px-3 py-2.5 text-xs font-medium transition-all",s===l.agent?l.activeColor:K("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 Vn({labels:t,onChange:e}){const[r,s]=b.useState(""),[o,i]=b.useState(!1),a=b.useRef(null),l=O(d=>d.features),u=b.useMemo(()=>{const d=new Set;return l.forEach(x=>x.labels.forEach(m=>d.add(m))),Array.from(d).sort()},[l]),c=b.useMemo(()=>{const d=u.filter(x=>!t.includes(x));return r.trim()?d.filter(x=>x.toLowerCase().includes(r.toLowerCase())):d},[r,u,t]),p=o&&c.length>0,h=d=>{const x=(d||r).trim();x&&!t.includes(x)&&e([...t,x]),s("")},g=d=>{e(t.filter(x=>x!==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(X,{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($e,{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 x;d.key==="Enter"&&(d.preventDefault(),h()),d.key==="Backspace"&&!r&&t.length>0&&e(t.slice(0,-1)),d.key==="Escape"&&(s(""),(x=a.current)==null||x.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"}}),p&&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:x=>{x.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:x=>x.currentTarget.style.background="var(--vscode-list-hoverBackground)",onMouseLeave:x=>x.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 Yn({featureId:t,content:e,frontmatter:r,contentVersion:s,onSave:o,onClose:i,onDelete:a,onOpenFile:l,onStartWithAI:u,onAddAttachment:c,onOpenAttachment:p,onRemoveAttachment:h}){const{cardSettings:g}=O(),[d,x]=b.useState(r),[m,y]=b.useState(e),[v,C]=b.useState(!1),k=b.useRef(null),f=b.useRef(d),A=b.useRef(m);f.current=d,A.current=m;const j=b.useCallback(()=>{o(A.current,f.current)},[o]);b.useEffect(()=>()=>{k.current&&clearTimeout(k.current)},[]),b.useEffect(()=>{y(e)},[t,s]),b.useEffect(()=>{x(r)},[r]);const z=b.useCallback(S=>{y(S),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{o(S,f.current)},800)},[o]),N=b.useCallback(S=>{x(R=>{const U={...R,...S};return k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{o(A.current,U)},800),U})},[o]);return b.useEffect(()=>{const S=R=>{(R.metaKey||R.ctrlKey)&&R.key==="s"&&(R.preventDefault(),k.current&&clearTimeout(k.current),j()),(R.metaKey||R.ctrlKey)&&R.key==="b"&&g.showBuildWithAI&&(R.preventDefault(),u("claude","default")),R.key==="Escape"&&(k.current&&(clearTimeout(k.current),j()),i())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[j,i,u,g.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}),v?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:()=>{C(!1),a()},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:()=>C(!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:()=>{l(),i()},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:()=>C(!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(Dt,{size:16}),n.jsx("span",{className:"text-xs",children:"DELETE"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[g.showBuildWithAI&&n.jsx(Qn,{onSelect:u}),n.jsx("button",{onClick:i,className:"p-1.5 rounded transition-colors vscode-hover-bg",style:{color:"var(--vscode-descriptionForeground)"},children:n.jsx(X,{size:18})})]})]}),n.jsxs("div",{className:"flex flex-col py-0.5",style:{borderBottom:"1px solid var(--vscode-panel-border)"},children:[n.jsx(ie,{label:"Status",icon:n.jsx(Lt,{size:13}),children:n.jsx(Ct,{value:d.status,options:Kn.map(S=>({value:S,label:On[S],dot:Gn[S]})),onChange:S=>N({status:S})})}),g.showPriorityBadges&&n.jsx(ie,{label:"Priority",icon:n.jsx(Et,{size:13}),children:n.jsx(Ct,{value:d.priority,options:qn.map(S=>({value:S,label:_n[S],dot:Un[S]})),onChange:S=>N({priority:S})})}),g.showAssignee&&n.jsx(ie,{label:"Assignee",icon:n.jsx(Rt,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-2",children:[d.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:d.assignee.split(/\s+/).filter(Boolean).map(S=>S[0]).join("").toUpperCase().slice(0,2)}),n.jsx("input",{type:"text",value:d.assignee||"",onChange:S=>N({assignee:S.target.value||null}),placeholder:"No assignee",className:"bg-transparent border-none outline-none text-xs w-32",style:{color:d.assignee?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})]})}),g.showDueDate&&n.jsx(ie,{label:"Due date",icon:n.jsx(Ve,{size:13}),children:n.jsx("input",{type:"date",value:d.dueDate||"",onChange:S=>N({dueDate:S.target.value||null}),className:"bg-transparent border-none outline-none text-xs",style:{color:d.dueDate?"var(--vscode-foreground)":"var(--vscode-descriptionForeground)"}})}),g.showLabels&&n.jsx(ie,{label:"Labels",icon:n.jsx(Mt,{size:13}),children:n.jsx(Vn,{labels:d.labels,onChange:S=>N({labels:S})})}),n.jsx(ie,{label:"Attachments",icon:n.jsx(Oe,{size:13}),children:n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[d.attachments.map(S=>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:()=>p(S),className:"inline-flex items-center gap-1 hover:underline",title:S,children:[n.jsx(Oe,{size:9}),S]}),n.jsx("button",{type:"button",onClick:()=>h(S),className:"hover:text-red-500 transition-colors",children:n.jsx(X,{size:9})})]},S)),n.jsx("button",{type:"button",onClick:c,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($e,{size:10})})]})})]}),n.jsx(or,{value:m,onChange:z,placeholder:"Start writing...",className:"flex-1 min-h-0"})]})}const Jn=[{value:"all",label:"All Priorities"},{value:"critical",label:"Critical"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Xn=[{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"}],De="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 eo({onOpenSettings:t,onAddColumn:e}){const{searchQuery:r,setSearchQuery:s,priorityFilter:o,setPriorityFilter:i,assigneeFilter:a,setAssigneeFilter:l,labelFilter:u,setLabelFilter:c,dueDateFilter:p,setDueDateFilter:h,clearAllFilters:g,getUniqueAssignees:d,getUniqueLabels:x,hasActiveFilters:m,layout:y,toggleLayout:v,cardSettings:C}=O(),k=d(),f=x(),A=m();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(Er,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-zinc-400"}),n.jsx("input",{type:"text",value:r,onChange:j=>s(j.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"})]}),C.showPriorityBadges&&n.jsx("select",{value:o,onChange:j=>i(j.target.value),className:De,children:Jn.map(j=>n.jsx("option",{value:j.value,children:j.label},j.value))}),C.showAssignee&&n.jsxs("select",{value:a,onChange:j=>l(j.target.value),className:De,children:[n.jsx("option",{value:"all",children:"All Assignees"}),n.jsx("option",{value:"unassigned",children:"Unassigned"}),k.map(j=>n.jsx("option",{value:j,children:j},j))]}),C.showLabels&&n.jsxs("select",{value:u,onChange:j=>c(j.target.value),className:De,children:[n.jsx("option",{value:"all",children:"All Labels"}),f.map(j=>n.jsx("option",{value:j,children:j},j))]}),C.showDueDate&&n.jsx("select",{value:p,onChange:j=>h(j.target.value),className:De,children:Xn.map(j=>n.jsx("option",{value:j.value,children:j.label},j.value))}),A&&n.jsxs("button",{onClick:g,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(X,{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($e,{size:16}),n.jsx("span",{children:"Add List"})]}),n.jsx("button",{onClick:v,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:y==="horizontal"?"Switch to vertical layout":"Switch to horizontal layout",children:y==="horizontal"?n.jsx(Rr,{size:16}):n.jsx(Mr,{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($r,{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 to({message:t,onUndo:e,onExpire:r,duration:s,index:o}){const[i,a]=b.useState(100);return b.useEffect(()=>{const u=50/s*100,c=setInterval(()=>{a(p=>{const h=p-u;return h<=0?(clearInterval(c),0):h})},50);return()=>clearInterval(c)},[s]),b.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 ro=[{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"}],so=[{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 no({isOpen:t,settings:e,onClose:r,onSave:s}){return t?n.jsx(lo,{settings:e,onClose:r,onSave:s}):null}function oo({checked:t,onChange:e}){return n.jsx("button",{type:"button",onClick:()=>e(!t),className:K("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 Nt({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 ce({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(oo,{checked:r,onChange:s})]})}function Tt({label:t,value:e,options:r,onChange:s}){const[o,i]=b.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:K("w-2 h-2 rounded-full shrink-0",a.dot)}),n.jsx("span",{children:a==null?void 0:a.label}),n.jsx(Fe,{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:u=>{l.value!==e&&(u.currentTarget.style.background="var(--vscode-list-hoverBackground)")},onMouseLeave:u=>{l.value!==e&&(u.currentTarget.style.background="transparent")},children:[l.dot&&n.jsx("span",{className:K("w-2 h-2 rounded-full shrink-0",l.dot)}),n.jsx("span",{className:"flex-1 text-left",children:l.label})]},l.value))})]})]})]})}function lo({settings:t,onClose:e,onSave:r}){const[s,o]=b.useState(t);b.useEffect(()=>{o(t)},[t]);const i=a=>{const l={...s,...a};o(l),r(l)};return b.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(X,{size:18})})]}),n.jsxs("div",{className:"flex-1 overflow-auto",children:[n.jsxs(Nt,{title:"Card Display",children:[n.jsx(ce,{label:"Show Priority Badges",description:"Display priority indicators on feature cards",checked:s.showPriorityBadges,onChange:a=>i({showPriorityBadges:a})}),n.jsx(ce,{label:"Show Assignee",description:"Display assigned person on feature cards",checked:s.showAssignee,onChange:a=>i({showAssignee:a})}),n.jsx(ce,{label:"Show Due Date",description:"Display due dates on feature cards",checked:s.showDueDate,onChange:a=>i({showDueDate:a})}),n.jsx(ce,{label:"Show Labels",description:"Display labels on feature cards and in editors",checked:s.showLabels,onChange:a=>i({showLabels:a})}),n.jsx(ce,{label:"Show Filename",description:"Display the source markdown filename on cards",checked:s.showFileName,onChange:a=>i({showFileName:a})}),n.jsx(ce,{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(Nt,{title:"Defaults",children:[n.jsx(Tt,{label:"Default Priority",value:s.defaultPriority,options:ro,onChange:a=>i({defaultPriority:a})}),n.jsx(Tt,{label:"Default Status",value:s.defaultStatus,options:so,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 ao=["#6b7280","#3b82f6","#f59e0b","#8b5cf6","#22c55e","#ef4444","#ec4899","#14b8a6","#f97316","#06b6d4"];function io({isOpen:t,onClose:e,onSave:r,initial:s,title:o}){const[i,a]=b.useState((s==null?void 0:s.name)??""),[l,u]=b.useState((s==null?void 0:s.color)??"#3b82f6"),c=b.useRef(null);return b.useEffect(()=>{t&&(a((s==null?void 0:s.name)??""),u((s==null?void 0:s.color)??"#3b82f6"),setTimeout(()=>{var p;return(p=c.current)==null?void 0:p.focus()},50))},[t,s]),b.useEffect(()=>{if(!t)return;const p=h=>{h.key==="Escape"&&e(),h.key==="Enter"&&(h.ctrlKey||h.metaKey)&&i.trim()&&r({name:i.trim(),color:l})};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[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(X,{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:p=>a(p.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:[ao.map(p=>n.jsx("button",{type:"button",onClick:()=>u(p),className:`w-6 h-6 rounded-full border-2 transition-all ${l===p?"border-zinc-900 dark:border-white scale-110":"border-transparent hover:scale-110"}`,style:{backgroundColor:p},title:p},p)),n.jsx("input",{type:"color",value:l,onChange:p=>u(p.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 co(){const{columns:t,cardSettings:e,settingsOpen:r,setFeatures:s,setColumns:o,setIsDarkMode:i,setCardSettings:a,setSettingsOpen:l}=O(),[u,c]=b.useState(!1),[p,h]=b.useState("backlog"),[g,d]=b.useState(!1),[x,m]=b.useState(null),y=b.useRef(0),[v,C]=b.useState(null),[k,f]=b.useState([]),A=b.useRef(k);b.useEffect(()=>{A.current=k},[k]);const j=b.useRef(0),z=b.useCallback(w=>{const{features:D}=O.getState(),L=D.find(W=>W.id===w);if(!L)return;s(D.filter(W=>W.id!==w)),(v==null?void 0:v.id)===w&&C(null);const B=String(j.current++);f(W=>[...W,{id:B,feature:L}])},[v,s]),N=b.useCallback(w=>{const D=A.current.find(L=>L.id===w);D&&(_.postMessage({type:"deleteFeature",featureId:D.feature.id}),f(L=>L.filter(B=>B.id!==w)))},[]),S=b.useCallback(w=>{const D=A.current.find(B=>B.id===w);if(!D)return;const{features:L}=O.getState();s([...L,D.feature]),f(B=>B.filter(W=>W.id!==w))},[s]),R=b.useCallback(()=>{const w=A.current;w.length!==0&&S(w[w.length-1].id)},[S]);b.useEffect(()=>{let w=!1,D=null;const L=I=>{if(I.key==="Alt"){w=!0,D&&clearTimeout(D),D=setTimeout(()=>{w=!1},1e3);return}if(I.altKey&&(w=!1,D&&(clearTimeout(D),D=null)),I.key==="z"&&(I.ctrlKey||I.metaKey)&&!I.shiftKey&&A.current.length>0){I.preventDefault(),R();return}if(!(I.target instanceof HTMLInputElement||I.target instanceof HTMLTextAreaElement||I.target instanceof HTMLSelectElement||I.target instanceof HTMLElement&&I.target.isContentEditable))switch(I.key){case"n":if(I.ctrlKey||I.metaKey||I.altKey||I.shiftKey)return;I.preventDefault(),h("backlog"),c(!0);break;case"Escape":u&&c(!1);break}},B=I=>{I.key==="Alt"&&w&&(w=!1,D&&(clearTimeout(D),D=null),_.postMessage({type:"focusMenuBar"}))},W=()=>{w=!1};return window.addEventListener("keydown",L),window.addEventListener("keyup",B),window.addEventListener("mousedown",W),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",B),window.removeEventListener("mousedown",W),D&&clearTimeout(D)}},[u,R]),b.useEffect(()=>{const w=()=>{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")};w();const D=new MutationObserver(w);return D.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>D.disconnect()},[i]),b.useEffect(()=>{const w=D=>{const L=D.data;if(!(!L||typeof L.type!="string"))switch(L.type){case"init":s(L.features),o(L.columns),L.settings&&(L.settings.markdownEditorMode&&v&&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:B}=O.getState();if(B.markdownEditorMode)break;y.current+=1,C({id:L.featureId,content:L.content,frontmatter:L.frontmatter,contentVersion:y.current});break}}};return window.addEventListener("message",w),_.postMessage({type:"ready"}),()=>window.removeEventListener("message",w)},[s,o,a,l]);const U=w=>{_.postMessage({type:"openFeature",featureId:w.id})},$=(w,D)=>{v&&_.postMessage({type:"saveFeatureContent",featureId:v.id,content:w,frontmatter:D})},je=()=>{C(null),_.postMessage({type:"closeFeature"})},le=()=>{v&&z(v.id)},ze=()=>{v&&_.postMessage({type:"openFile",featureId:v.id})},ae=(w,D)=>{_.postMessage({type:"startWithAI",agent:w,permissionMode:D})},Se=()=>{v&&_.postMessage({type:"addAttachment",featureId:v.id})},he=w=>{v&&_.postMessage({type:"openAttachment",featureId:v.id,attachment:w})},re=w=>{v&&_.postMessage({type:"removeAttachment",featureId:v.id,attachment:w})},Ce=w=>{_.postMessage({type:"saveSettings",settings:w})},G=()=>{m(null),d(!0)},lr=w=>{const D=t.find(L=>L.id===w);D&&(m(D),d(!0))},ar=w=>{!t.find(B=>B.id===w)||O.getState().features.filter(B=>B.status===w).length>0||_.postMessage({type:"removeColumn",columnId:w})},ir=w=>{x?_.postMessage({type:"editColumn",columnId:x.id,updates:w}):_.postMessage({type:"addColumn",column:w}),d(!1),m(null)},cr=w=>{h(w),c(!0)},dr=w=>{_.postMessage({type:"createFeature",data:w})},ur=(w,D,L)=>{const{features:B}=O.getState();if(B.find(I=>I.id===w)){const I=B.filter(V=>V.status===D&&V.id!==w).sort((V,ct)=>V.order<ct.order?-1:V.order>ct.order?1:0),Ne=Math.max(0,Math.min(L,I.length)),pr=Ne>0?I[Ne-1].order:null,hr=Ne<I.length?I[Ne].order:null,gr=Hr(pr,hr),fr=B.map(V=>V.id===w?{...V,status:D,order:gr}:V);s(fr)}_.postMessage({type:"moveFeature",featureId:w,newStatus:D,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(eo,{onOpenSettings:()=>_.postMessage({type:"openSettings"}),onAddColumn:G}),n.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[n.jsx("div",{className:v?"w-1/2":"w-full",children:n.jsx(Qs,{onFeatureClick:U,onAddFeature:cr,onMoveFeature:ur,onEditColumn:lr,onRemoveColumn:ar})}),v&&n.jsx("div",{className:"w-1/2",children:n.jsx(Yn,{featureId:v.id,content:v.content,frontmatter:v.frontmatter,contentVersion:v.contentVersion,onSave:$,onClose:je,onDelete:le,onOpenFile:ze,onStartWithAI:ae,onAddAttachment:Se,onOpenAttachment:he,onRemoveAttachment:re})})]}),n.jsx(Pn,{isOpen:u,onClose:()=>c(!1),onCreate:dr,initialStatus:p}),n.jsx(no,{isOpen:r,settings:e,onClose:()=>l(!1),onSave:Ce}),n.jsx(io,{isOpen:g,onClose:()=>{d(!1),m(null)},onSave:ir,initial:x?{name:x.name,color:x.color}:void 0,title:x?"Edit List":"Add List"}),k.map((w,D)=>n.jsx(to,{message:`Deleted "${Jt(w.feature.content)}"`,onUndo:()=>S(w.id),onExpire:()=>N(w.id),duration:5e3,index:D},w.id))]})}It(document.getElementById("root")).render(n.jsx(b.StrictMode,{children:n.jsx(co,{})}));
85
+ //# sourceMappingURL=index.js.map