hotsheet 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -622,6 +622,14 @@ async function getAttachments(ticketId) {
622
622
  );
623
623
  return result.rows;
624
624
  }
625
+ async function getAttachment(id) {
626
+ const db2 = await getDb();
627
+ const result = await db2.query(
628
+ `SELECT * FROM attachments WHERE id = $1`,
629
+ [id]
630
+ );
631
+ return result.rows[0] ?? null;
632
+ }
625
633
  async function deleteAttachment(id) {
626
634
  const db2 = await getDb();
627
635
  const result = await db2.query(
@@ -2190,6 +2198,23 @@ apiRoutes.delete("/attachments/:id", async (c) => {
2190
2198
  notifyChange();
2191
2199
  return c.json({ ok: true });
2192
2200
  });
2201
+ apiRoutes.post("/attachments/:id/reveal", async (c) => {
2202
+ const id = parseInt(c.req.param("id"), 10);
2203
+ const attachment = await getAttachment(id);
2204
+ if (!attachment) return c.json({ error: "Not found" }, 404);
2205
+ if (!existsSync6(attachment.stored_path)) return c.json({ error: "File not found on disk" }, 404);
2206
+ const { execFile } = await import("child_process");
2207
+ const { dirname: dirname3 } = await import("path");
2208
+ const platform = process.platform;
2209
+ if (platform === "darwin") {
2210
+ execFile("open", ["-R", attachment.stored_path]);
2211
+ } else if (platform === "win32") {
2212
+ execFile("explorer", ["/select,", attachment.stored_path]);
2213
+ } else {
2214
+ execFile("xdg-open", [dirname3(attachment.stored_path)]);
2215
+ }
2216
+ return c.json({ ok: true });
2217
+ });
2193
2218
  apiRoutes.get("/attachments/file/*", async (c) => {
2194
2219
  const filePath = c.req.path.replace("/api/attachments/file/", "");
2195
2220
  const dataDir2 = c.get("dataDir");
@@ -2440,6 +2465,13 @@ pageRoutes.get("/", (c) => {
2440
2465
  /* @__PURE__ */ jsx("span", { children: "AI tool skills created. Restart your AI tool to use the new ticket creation skills (hs-bug, hs-feature, etc.)." }),
2441
2466
  /* @__PURE__ */ jsx("button", { id: "skills-banner-dismiss", className: "btn btn-sm", children: "Dismiss" })
2442
2467
  ] }),
2468
+ /* @__PURE__ */ jsx("div", { id: "update-banner", className: "update-banner", style: "display:none", children: [
2469
+ /* @__PURE__ */ jsx("span", { id: "update-banner-label", children: "Update available" }),
2470
+ /* @__PURE__ */ jsx("div", { className: "update-banner-actions", children: [
2471
+ /* @__PURE__ */ jsx("button", { id: "update-install-btn", className: "btn btn-sm btn-accent", children: "Install Update" }),
2472
+ /* @__PURE__ */ jsx("button", { id: "update-banner-dismiss", className: "btn btn-sm", children: "Later" })
2473
+ ] })
2474
+ ] }),
2443
2475
  /* @__PURE__ */ jsx("div", { className: "app-body", children: [
2444
2476
  /* @__PURE__ */ jsx("nav", { className: "sidebar", children: [
2445
2477
  /* @__PURE__ */ jsx("div", { className: "sidebar-copy-prompt", id: "copy-prompt-section", style: "display:none", children: /* @__PURE__ */ jsx("button", { className: "copy-prompt-btn", id: "copy-prompt-btn", title: "Copy worklist prompt to clipboard", children: [
@@ -2633,6 +2665,11 @@ pageRoutes.get("/", (c) => {
2633
2665
  /* @__PURE__ */ jsx("button", { className: "detail-close", id: "settings-close", children: raw("×") })
2634
2666
  ] }),
2635
2667
  /* @__PURE__ */ jsx("div", { className: "settings-body", children: [
2668
+ /* @__PURE__ */ jsx("div", { className: "settings-field", children: [
2669
+ /* @__PURE__ */ jsx("label", { children: "App name" }),
2670
+ /* @__PURE__ */ jsx("input", { type: "text", id: "settings-app-name", placeholder: "Hot Sheet" }),
2671
+ /* @__PURE__ */ jsx("span", { className: "settings-hint", id: "settings-app-name-hint", children: "Custom name shown in the title bar. Leave empty for default." })
2672
+ ] }),
2636
2673
  /* @__PURE__ */ jsx("div", { className: "settings-field", children: [
2637
2674
  /* @__PURE__ */ jsx("label", { children: "Auto-clear trash after (days)" }),
2638
2675
  /* @__PURE__ */ jsx("input", { type: "number", id: "settings-trash-days", min: "1", value: "3" })
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var Te=Object.defineProperty;var Ie=(e,t,s)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Z=(e,t,s)=>Ie(e,typeof t!="symbol"?t+"":t,s);function ee(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function te(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var k=class{constructor(t){Z(this,"__html");this.__html=t}toString(){return this.__html}};function E(e){return new k(e)}var we=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function q(e){return e==null||typeof e=="boolean"?"":e instanceof k?e.__html:typeof e=="string"?ee(e):typeof e=="number"?String(e):Array.isArray(e)?e.map(q).join(""):""}function Le(e,t){if(t==null||t===!1)return"";if(t===!0)return` ${e}`;let s=e==="className"?"class":e==="htmlFor"?"for":e,a;return t instanceof k?a=t.__html:typeof t=="number"?a=String(t):typeof t=="string"?a=te(t):a="",` ${s}="${a}"`}function l(e,t){if(typeof e=="function")return e(t);let{children:s,...a}=t,i=Object.entries(a).map(([r,d])=>Le(r,d)).join("");if(we.has(e))return new k(`<${e}${i}>`);let o=s!=null?q(s):"";return new k(`<${e}${i}>${o}</${e}>`)}function I({children:e}){return new k(e!=null?q(e):"")}function y(e){let t=document.createElement("template");return t.innerHTML=e.toString(),t.content.firstElementChild}function ne(e){document.getElementById("network-error-popup")?.remove();let t=y(l("div",{id:"network-error-popup",className:"error-popup",children:l("div",{className:"error-popup-content",children:[l("strong",{children:"Connection Error"}),l("p",{children:e}),l("button",{children:E("Dismiss")})]})}));t.querySelector("button").addEventListener("click",()=>t.remove()),document.body.appendChild(t)}async function c(e,t={}){try{return(await fetch("/api"+e,{headers:t.body!==void 0?{"Content-Type":"application/json"}:{},method:t.method,body:t.body!==void 0?JSON.stringify(t.body):void 0})).json()}catch(s){throw ne("Unable to reach the server. It may have been stopped."),s}}async function se(e,t){try{let s=new FormData;return s.append("file",t),(await fetch("/api"+e,{method:"POST",body:s})).json()}catch(s){throw ne("Unable to reach the server. It may have been stopped."),s}}var xe={detail_position:"side",detail_width:360,detail_height:300,trash_cleanup_days:3,verified_cleanup_days:30},n={tickets:[],selectedIds:new Set,lastClickedId:null,activeTicketId:null,view:"all",layout:"list",sortBy:"created",sortDir:"desc",search:"",settings:{...xe},backupPreview:null},Se={issue:"#6b7280",bug:"#ef4444",feature:"#22c55e",requirement_change:"#f97316",task:"#3b82f6",investigation:"#8b5cf6"},_e={issue:"ISS",bug:"BUG",feature:"FEA",requirement_change:"REQ",task:"TSK",investigation:"INV"},Be={highest:"\u2B06\u2B06",high:"\u2B06",default:"\u2014",low:"\u2B07",lowest:"\u2B07\u2B07"},Ce={highest:"#ef4444",high:"#f97316",default:"#6b7280",low:"#3b82f6",lowest:"#94a3b8"},He={not_started:"\u25CB",started:"\u25D4",completed:"\u2713",verified:"svg"},K='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 7 17l-5-5"/><path d="m22 10-9.5 9.5-2-2"/></svg>';function b(e){return Se[e]||"#6b7280"}function T(e){return _e[e]||"ISS"}function S(e){return Be[e]||"\u2014"}function w(e){return Ce[e]||"#6b7280"}function U(e){return He[e]||"\u25CB"}function N(e){n.activeTicketId=e,oe(e)}function ie(){n.selectedIds.clear(),n.activeTicketId=null;let e=new CustomEvent("hotsheet:render");document.dispatchEvent(e)}function _(){let e=n.view==="trash",t=!!n.backupPreview?.active,s=document.getElementById("detail-panel"),a=document.getElementById("detail-resize-handle");if(n.selectedIds.size===1&&!e){let i=Array.from(n.selectedIds)[0];s.style.display="flex",a&&(a.style.display=""),n.activeTicketId!==i&&(n.activeTicketId=i,t?Me(i):oe(i))}else n.activeTicketId!=null&&(n.activeTicketId=null),s.style.display="none",a&&(a.style.display="none")}function ae(e){let t=document.getElementById("detail-title"),s=document.getElementById("detail-details"),a=document.getElementById("detail-category"),i=document.getElementById("detail-priority"),o=document.getElementById("detail-status"),r=document.getElementById("detail-upnext"),d=document.querySelector(".upload-btn");t.readOnly=e,s.readOnly=e,a.disabled=e,i.disabled=e,o.disabled=e,r.disabled=e,d&&(d.style.display=e?"none":"")}function Me(e){let t=n.backupPreview?.tickets.find(r=>r.id===e);if(!t||n.activeTicketId!==e)return;document.getElementById("detail-ticket-number").textContent=t.ticket_number,document.getElementById("detail-title").value=t.title,document.getElementById("detail-category").value=t.category,document.getElementById("detail-priority").value=t.priority,document.getElementById("detail-status").value=t.status,document.getElementById("detail-upnext").checked=t.up_next,document.getElementById("detail-details").value=t.details,ae(!0),document.getElementById("detail-attachments").innerHTML="";let s=document.getElementById("detail-notes-section"),a=document.getElementById("detail-notes"),i=le(t.notes);i.length>0?(s.style.display="",a.innerHTML=l(I,{children:i.map(r=>l("div",{className:"note-entry",children:[r.created_at?l("div",{className:"note-timestamp",children:new Date(r.created_at).toLocaleString()}):null,l("div",{className:"note-text",children:r.text})]}))}).toString()):(s.style.display="none",a.innerHTML="");let o=document.getElementById("detail-meta");o.innerHTML=l(I,{children:[l("div",{children:["Created: ",new Date(t.created_at).toLocaleString()]}),l("div",{children:["Updated: ",new Date(t.updated_at).toLocaleString()]}),t.completed_at?l("div",{children:["Completed: ",new Date(t.completed_at).toLocaleString()]}):null,t.verified_at?l("div",{children:["Verified: ",new Date(t.verified_at).toLocaleString()]}):null]}).toString()}async function oe(e){let t=await c(`/tickets/${e}`);if(n.activeTicketId!==e)return;ae(!1),document.getElementById("detail-ticket-number").textContent=t.ticket_number,document.getElementById("detail-title").value=t.title,document.getElementById("detail-category").value=t.category,document.getElementById("detail-priority").value=t.priority,document.getElementById("detail-status").value=t.status,document.getElementById("detail-upnext").checked=t.up_next,document.getElementById("detail-details").value=t.details;let s=document.getElementById("detail-attachments");t.attachments.length>0?s.innerHTML=l(I,{children:t.attachments.map(d=>l("div",{className:"attachment-item",children:[l("span",{className:"attachment-name",children:d.original_filename}),l("button",{className:"attachment-delete","data-att-id":String(d.id),title:"Remove",children:E("&times;")})]}))}).toString():s.innerHTML="";let a=document.getElementById("detail-notes-section"),i=document.getElementById("detail-notes"),o=le(t.notes);o.length>0?(a.style.display="",i.innerHTML=l(I,{children:o.map(d=>l("div",{className:"note-entry",children:[d.created_at?l("div",{className:"note-timestamp",children:new Date(d.created_at).toLocaleString()}):null,l("div",{className:"note-text",children:d.text})]}))}).toString()):(a.style.display="none",i.innerHTML="");let r=document.getElementById("detail-meta");r.innerHTML=l(I,{children:[l("div",{children:["Created: ",new Date(t.created_at).toLocaleString()]}),l("div",{children:["Updated: ",new Date(t.updated_at).toLocaleString()]}),t.completed_at?l("div",{children:["Completed: ",new Date(t.completed_at).toLocaleString()]}):null,t.verified_at?l("div",{children:["Verified: ",new Date(t.verified_at).toLocaleString()]}):null]}).toString()}function le(e){if(!e||e==="")return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.trim()?[{text:e,created_at:""}]:[]}async function P(){try{let e=await c("/stats"),t=document.getElementById("status-bar");t&&(t.textContent=`${e.total} tickets \xB7 ${e.open} open \xB7 ${e.up_next} up next`)}catch{}}function F(e){let t=document.getElementById("content-area");t.classList.remove("detail-side","detail-bottom"),t.classList.add(e==="bottom"?"detail-bottom":"detail-side")}function V(){let e=document.getElementById("detail-panel");n.settings.detail_position==="bottom"?(e.style.width="",e.style.height=`${n.settings.detail_height}px`):(e.style.height="",e.style.width=`${n.settings.detail_width}px`)}function re(){let e=document.getElementById("detail-resize-handle"),t=document.getElementById("detail-panel"),s=document.getElementById("content-area"),a=!1;e.addEventListener("mousedown",i=>{i.preventDefault(),a=!0,document.body.style.cursor=n.settings.detail_position==="bottom"?"row-resize":"col-resize",document.body.style.userSelect="none"}),document.addEventListener("mousemove",i=>{if(!a)return;let o=s.getBoundingClientRect();if(n.settings.detail_position==="bottom"){let r=Math.max(150,Math.min(500,o.bottom-i.clientY));n.settings.detail_height=r,t.style.height=`${r}px`}else{let r=Math.max(250,Math.min(600,o.right-i.clientX));n.settings.detail_width=r,t.style.width=`${r}px`}}),document.addEventListener("mouseup",()=>{a&&(a=!1,document.body.style.cursor="",document.body.style.userSelect="",n.settings.detail_position==="bottom"?c("/settings",{method:"PATCH",body:{detail_height:String(n.settings.detail_height)}}):c("/settings",{method:"PATCH",body:{detail_width:String(n.settings.detail_width)}}))})}function D(e,t){let s=t.getBoundingClientRect(),a=e.getBoundingClientRect(),i=window.innerWidth,o=window.innerHeight,r=s.left;r+a.width>i-8&&(r=s.right-a.width),r<8&&(r=8);let d=s.bottom+4;d+a.height>o-8&&(d=s.top-a.height-4),d<8&&(d=8),e.style.left=`${r}px`,e.style.top=`${d}px`}function $(e,t){let s=y(l("div",{className:"dropdown-menu",style:"visibility:hidden;top:0;left:0",children:t.map(d=>l("button",{className:`dropdown-item${d.active?" active":""}`,"data-key":d.key,children:[d.color?l("span",{className:"dropdown-dot",style:`background-color:${d.color}`}):null,l("span",{className:"dropdown-label",children:d.label}),d.shortcut?l("kbd",{className:"dropdown-kbd",children:d.shortcut}):null]}))}));s.querySelectorAll(".dropdown-item").forEach((d,m)=>{d.addEventListener("click",()=>{t[m].action(),s.remove()})});function i(d){let m=t.find(u=>d.key.toLowerCase()===u.key.toLowerCase());m?(d.preventDefault(),d.stopPropagation(),m.action(),o()):d.key==="Escape"&&(d.preventDefault(),o())}function o(){s.remove(),document.removeEventListener("keydown",i,!0),document.removeEventListener("click",r)}function r(){o()}return document.addEventListener("keydown",i,!0),setTimeout(()=>{document.addEventListener("click",r)},0),s}function A(){document.querySelectorAll(".dropdown-menu").forEach(e=>{e.remove()})}var z=null,B=!1,C=null,j="",v=[],R=[{key:"i",value:"issue",label:"Issue"},{key:"b",value:"bug",label:"Bug"},{key:"f",value:"feature",label:"Feature"},{key:"r",value:"requirement_change",label:"Req Change"},{key:"k",value:"task",label:"Task"},{key:"g",value:"investigation",label:"Investigation"}],W=[{key:"1",value:"highest",label:"Highest"},{key:"2",value:"high",label:"High"},{key:"3",value:"default",label:"Default"},{key:"4",value:"low",label:"Low"},{key:"5",value:"lowest",label:"Lowest"}];function Ne(){let e=document.activeElement;if(!e||!(e instanceof HTMLElement))return null;let t=e.closest(".ticket-row");if(!t)return null;if(t.classList.contains("draft-row"))return"draft";let s=t.dataset.id;return s!==void 0&&s!==""?parseInt(s,10):null}function Pe(e){e!=null&&(B=!0,e==="draft"?h():document.querySelector(`.ticket-row[data-id="${e}"] .ticket-title-input`)?.focus(),B=!1)}function O(){let e=n.view;return e!=="completed"&&e!=="verified"&&e!=="trash"}function ue(){return n.view==="up-next"||n.view==="open"?[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"}]:n.view==="non-verified"?[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"},{status:"completed",label:"Completed"}]:[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"},{status:"completed",label:"Completed"},{status:"verified",label:"Verified"}]}function g(){let e=!!n.backupPreview?.active;if(n.layout==="columns"&&O()){if(e){$e();return}Re();return}let t=n.view==="trash",s=e?null:Ne(),a=null;if(s!=null&&s!=="draft"){let o=document.querySelector(`.ticket-row[data-id="${s}"] .ticket-title-input`);o&&(a=o.value)}let i=document.getElementById("ticket-list");if(i.innerHTML="",i.classList.remove("ticket-list-columns"),!t&&!e&&i.appendChild(pe()),n.tickets.length===0){let o=t?"Trash is empty":e?"No tickets match this view":"";o&&i.appendChild(y(l("div",{className:"ticket-list-empty",children:o})))}for(let o of n.tickets)e?i.appendChild(De(o)):t?i.appendChild(Fe(o)):i.appendChild(Ue(o));if(e){let o=document.getElementById("batch-toolbar");o&&(o.style.display="none"),H(),_()}else{let o=document.getElementById("batch-toolbar");if(o&&(o.style.display=""),s!=null&&s!=="draft"&&a!=null){let r=document.querySelector(`.ticket-row[data-id="${s}"] .ticket-title-input`);r&&r.value!==a&&(r.value=a)}Pe(s),L()}P()}function De(e){let t=n.selectedIds.has(e.id),s=e.status==="completed"||e.status==="verified",a=e.status==="verified",i=y(l("div",{className:`ticket-row${t?" selected":""}${s?" completed":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("span",{className:"ticket-checkbox-spacer"}),l("span",{className:`ticket-status-btn${a?" verified":""}`,style:"cursor:default",children:a?E(K):U(e.status)}),l("span",{className:"ticket-category-badge",style:`background-color:${b(e.category)};cursor:default`,title:e.category,children:T(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-title-input",style:"cursor:default",children:e.title}),l("span",{className:"ticket-priority-indicator",style:`color:${w(e.priority)};cursor:default`,title:e.priority,children:S(e.priority)}),l("span",{className:`ticket-star${e.up_next?" active":""}`,style:"cursor:default",children:e.up_next?"\u2605":"\u2606"})]}));return i.addEventListener("click",()=>{n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,H(),_()}),i}function $e(){let e=document.getElementById("ticket-list");e.innerHTML="",e.classList.add("ticket-list-columns");let t=ue(),s=y(l("div",{className:"columns-container"}));for(let i of t){let o=n.tickets.filter(m=>m.status===i.status),r=y(l("div",{className:"column","data-status":i.status,children:[l("div",{className:"column-header",children:[l("span",{className:"column-title",children:i.label}),l("span",{className:"column-count",children:String(o.length)})]}),l("div",{className:"column-body"})]})),d=r.querySelector(".column-body");for(let m of o)d.appendChild(Ae(m));s.appendChild(r)}e.appendChild(s);let a=document.getElementById("batch-toolbar");a&&(a.style.display="none"),P()}function Ae(e){let t=n.selectedIds.has(e.id),s=y(l("div",{className:`column-card${t?" selected":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("div",{className:"column-card-header",children:[l("span",{className:"ticket-category-badge",style:`background-color:${b(e.category)}`,children:T(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-priority-indicator",style:`color:${w(e.priority)};cursor:default`,children:S(e.priority)}),l("span",{className:`ticket-star${e.up_next?" active":""}`,style:"cursor:default",children:e.up_next?"\u2605":"\u2606"})]}),l("div",{className:"column-card-title",children:e.title})]}));return s.addEventListener("click",()=>{n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,me(),_()}),s}function Re(){let e=document.getElementById("ticket-list");e.innerHTML="",e.classList.add("ticket-list-columns"),e.appendChild(pe());let t=ue(),s=y(l("div",{className:"columns-container"}));for(let a of t){let i=n.tickets.filter(d=>d.status===a.status),o=y(l("div",{className:"column","data-status":a.status,children:[l("div",{className:"column-header",children:[l("span",{className:"column-title",children:a.label}),l("span",{className:"column-count",children:String(i.length)})]}),l("div",{className:"column-body"})]})),r=o.querySelector(".column-body");for(let d of i)r.appendChild(Oe(d));r.addEventListener("dragover",d=>{d.preventDefault(),d.dataTransfer.dropEffect="move",o.classList.add("column-drop-target")}),r.addEventListener("dragleave",d=>{let m=d.relatedTarget;(!m||!r.contains(m))&&o.classList.remove("column-drop-target")}),r.addEventListener("drop",d=>{d.preventDefault(),o.classList.remove("column-drop-target");let m=v;v=[],m.length!==0&&c("/tickets/batch",{method:"POST",body:{ids:m,action:"status",value:a.status}}).then(()=>{f()})}),s.appendChild(o)}e.appendChild(s),L(),P()}function Oe(e){let t=n.selectedIds.has(e.id),s=y(l("div",{className:`column-card${t?" selected":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("div",{className:"column-card-header",children:[l("span",{className:"ticket-category-badge",style:`background-color:${b(e.category)}`,children:T(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-priority-indicator",style:`color:${w(e.priority)}`,children:S(e.priority)}),l("button",{className:`ticket-star${e.up_next?" active":""}`,title:e.up_next?"Remove from Up Next":"Add to Up Next",children:e.up_next?"\u2605":"\u2606"})]}),l("div",{className:"column-card-title",children:e.title})]})),a=s.querySelector(".ticket-priority-indicator");return a.addEventListener("click",i=>{i.stopPropagation(),ve(a,e)}),s.querySelector(".ticket-star").addEventListener("click",i=>{i.stopPropagation(),ge(e)}),s.draggable=!0,s.addEventListener("dragstart",i=>{n.selectedIds.has(e.id)&&n.selectedIds.size>1?v=Array.from(n.selectedIds):v=[e.id],i.dataTransfer.setData("text/plain",JSON.stringify(v)),i.dataTransfer.effectAllowed="move"}),s.addEventListener("dragend",()=>{v=[]}),s.addEventListener("click",i=>{if(i.metaKey||i.ctrlKey)n.selectedIds.has(e.id)?n.selectedIds.delete(e.id):n.selectedIds.add(e.id),n.lastClickedId=e.id;else if(i.shiftKey&&n.lastClickedId!=null){let o=n.tickets.map(m=>m.id),r=o.indexOf(n.lastClickedId),d=o.indexOf(e.id);if(r!==-1&&d!==-1){let m=Math.min(r,d),u=Math.max(r,d);n.selectedIds.clear();for(let p=m;p<=u;p++)n.selectedIds.add(o[p])}}else n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id;me(),L()}),s}function me(){document.querySelectorAll(".column-card[data-id]").forEach(e=>{let t=parseInt(e.dataset.id,10);n.selectedIds.has(t)?e.classList.add("selected"):e.classList.remove("selected")})}function pe(){let e=fe(),t=n.view.startsWith("category:"),s=y(l("div",{className:"ticket-row draft-row",children:[l("span",{className:"ticket-checkbox-spacer"}),l("span",{className:"ticket-status-btn draft-placeholder",children:"\u25CB"}),l("span",{className:"ticket-category-badge draft-badge",style:`background-color:${b(e)}${t?"":";cursor:pointer;opacity:1"}`,children:T(e)}),l("span",{className:"ticket-number draft-number"}),l("input",{type:"text",className:"ticket-title-input draft-input",placeholder:"New ticket...",value:j}),l("span",{className:"ticket-priority-indicator draft-placeholder"}),l("span",{className:"ticket-star draft-placeholder"})]}));if(!t){let i=s.querySelector(".ticket-category-badge");i.addEventListener("click",o=>{o.stopPropagation(),Ke(i)})}let a=s.querySelector(".draft-input");return a.addEventListener("input",()=>{j=a.value}),a.addEventListener("keydown",async i=>{if(i.key==="Enter"&&a.value.trim()){i.preventDefault();let o=a.value.trim();j="",a.value="";let r=qe();C&&!n.view.startsWith("category:")&&(r.category=C);let d=await c("/tickets",{method:"POST",body:{title:o,defaults:r}});d&&(n.selectedIds.clear(),n.selectedIds.add(d.id)),await f(),h()}else i.key==="ArrowDown"&&(i.preventDefault(),n.tickets.length>0&&document.querySelector(`.ticket-row[data-id="${n.tickets[0].id}"] .ticket-title-input`)?.focus())}),s}function h(){document.querySelector(".draft-row .draft-input")?.focus()}function qe(){let e=n.view;return e==="up-next"?{up_next:!0}:e==="open"?{}:e==="completed"?{status:"completed"}:e.startsWith("category:")?{category:e.split(":")[1]}:e.startsWith("priority:")?{priority:e.split(":")[1]}:{}}function fe(){if(C)return C;let e=n.view;return e.startsWith("category:")?e.split(":")[1]:"issue"}function Ke(e){A();let s=navigator.platform.includes("Mac")?"\u2318":"Ctrl+",a=fe(),i=$(e,R.map(o=>({label:o.label,key:o.key,shortcut:`${s}${o.key.toUpperCase()}`,color:b(o.value),active:a===o.value,action:()=>{C=o.value,g(),h()}})));document.body.appendChild(i),D(i,e),i.style.visibility=""}function Ue(e){let t=n.selectedIds.has(e.id),s=e.status==="completed"||e.status==="verified",a=e.status==="verified",i=y(l("div",{className:`ticket-row${t?" selected":""}${s?" completed":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("input",{type:"checkbox",className:"ticket-checkbox",checked:t}),l("button",{className:`ticket-status-btn${a?" verified":""}`,title:e.status.replace("_"," "),children:a?E(K):U(e.status)}),l("span",{className:"ticket-category-badge",style:`background-color:${b(e.category)}`,title:e.category,children:T(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("input",{type:"text",className:"ticket-title-input",value:e.title}),l("span",{className:"ticket-priority-indicator",style:`color:${w(e.priority)}`,title:e.priority,children:S(e.priority)}),l("button",{className:`ticket-star${e.up_next?" active":""}`,title:e.up_next?"Remove from Up Next":"Add to Up Next",children:e.up_next?"\u2605":"\u2606"})]}));i.addEventListener("mousedown",u=>{let p=u.target;p.tagName!=="INPUT"&&p.tagName!=="BUTTON"&&(i.draggable=!0)}),i.addEventListener("mouseup",()=>{i.draggable=!1}),i.addEventListener("dragend",()=>{i.draggable=!1,v=[]}),i.addEventListener("dragstart",u=>{n.selectedIds.has(e.id)&&n.selectedIds.size>1?v=Array.from(n.selectedIds):v=[e.id],u.dataTransfer.setData("text/plain",JSON.stringify(v)),u.dataTransfer.effectAllowed="move"}),i.addEventListener("mousedown",u=>{(u.metaKey||u.ctrlKey||u.shiftKey)&&(u.preventDefault(),ye(u,e)&&u.stopPropagation())});let o=i.querySelector(".ticket-checkbox");o.addEventListener("click",u=>u.stopPropagation()),o.addEventListener("change",()=>{o.checked?n.selectedIds.add(e.id):n.selectedIds.delete(e.id),n.lastClickedId=e.id,g()}),i.querySelector(".ticket-status-btn").addEventListener("click",u=>{u.stopPropagation(),We(e)});let r=i.querySelector(".ticket-category-badge");r.addEventListener("click",u=>{u.stopPropagation(),Ye(r,e)});let d=i.querySelector(".ticket-title-input");d.addEventListener("focus",()=>{B||n.selectedIds.size===1&&n.selectedIds.has(e.id)||(n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,H(),L())}),d.addEventListener("input",()=>{Je(e.id,{title:d.value})}),d.addEventListener("keydown",u=>{Ve(u,e,d)});let m=i.querySelector(".ticket-priority-indicator");return m.addEventListener("click",u=>{u.stopPropagation(),ve(m,e)}),i.querySelector(".ticket-star").addEventListener("click",u=>{u.stopPropagation(),ge(e)}),i}function Fe(e){let t=n.selectedIds.has(e.id),s=e.deleted_at?new Date(e.deleted_at):null,a=y(l("div",{className:`ticket-row trash-row${t?" selected":""}`,"data-id":String(e.id),children:[l("input",{type:"checkbox",className:"ticket-checkbox",checked:t}),l("span",{className:"ticket-category-badge",style:`background-color:${b(e.category)}`,children:T(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-title-input trash-title",style:"cursor:default",children:e.title}),l("span",{className:"ticket-number",title:s?`Deleted: ${s.toLocaleString()}`:"",children:s?s.toLocaleDateString():""}),l("button",{className:"btn btn-sm",title:"Restore from trash",children:"Restore"})]}));a.addEventListener("mousedown",o=>{(o.metaKey||o.ctrlKey||o.shiftKey)&&(o.preventDefault(),ye(o,e)&&o.stopPropagation())});let i=a.querySelector(".ticket-checkbox");return i.addEventListener("click",o=>o.stopPropagation()),i.addEventListener("change",()=>{i.checked?n.selectedIds.add(e.id):n.selectedIds.delete(e.id),n.lastClickedId=e.id,g()}),a.querySelector(".trash-title").addEventListener("click",()=>{n.selectedIds.size===1&&n.selectedIds.has(e.id)||(n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,H(),L())}),a.querySelector(".btn").addEventListener("click",async o=>{o.stopPropagation(),await c(`/tickets/${e.id}/restore`,{method:"POST"}),f()}),a}function ye(e,t){let s=e.metaKey||e.ctrlKey,a=e.shiftKey;if(s)n.selectedIds.has(t.id)?n.selectedIds.delete(t.id):n.selectedIds.add(t.id),n.lastClickedId=t.id,g();else if(a&&n.lastClickedId!=null){let i=n.tickets.map(d=>d.id),o=i.indexOf(n.lastClickedId),r=i.indexOf(t.id);if(o!==-1&&r!==-1){let d=Math.min(o,r),m=Math.max(o,r);n.selectedIds.clear();for(let u=d;u<=m;u++)n.selectedIds.add(i[u])}g()}else return!1;return!0}function Ve(e,t,s){if(e.key==="Enter")e.preventDefault(),h();else if(e.key==="Backspace"&&s.value==="")e.preventDefault(),Ge(t.id);else if(e.key==="ArrowDown"&&e.shiftKey)e.preventDefault(),de(t.id,1);else if(e.key==="ArrowUp"&&e.shiftKey)e.preventDefault(),de(t.id,-1);else if(e.key==="ArrowDown")e.preventDefault(),ze(t.id);else if(e.key==="ArrowUp")e.preventDefault(),je(t.id);else if((e.metaKey||e.ctrlKey)&&!e.altKey&&R.some(a=>a.key===e.key)){e.preventDefault();let a=R.find(i=>i.key===e.key);ce(t,"category",a.value)}else if(e.altKey&&!e.metaKey&&!e.ctrlKey&&W.some(a=>a.key===e.key)){e.preventDefault();let a=W.find(i=>i.key===e.key);ce(t,"priority",a.value)}}function ze(e){let t=n.tickets.findIndex(s=>s.id===e);t<n.tickets.length-1&&document.querySelector(`.ticket-row[data-id="${n.tickets[t+1].id}"] .ticket-title-input`)?.focus()}function je(e){let t=n.tickets.findIndex(s=>s.id===e);t>0?document.querySelector(`.ticket-row[data-id="${n.tickets[t-1].id}"] .ticket-title-input`)?.focus():h()}function de(e,t){let a=n.tickets.findIndex(r=>r.id===e)+t;if(a<0||a>=n.tickets.length)return;let i=n.tickets[a].id;n.selectedIds.add(e),n.selectedIds.has(i)?n.selectedIds.delete(e):n.selectedIds.add(i),B=!0,document.querySelector(`.ticket-row[data-id="${i}"] .ticket-title-input`)?.focus(),B=!1,H(),L()}async function We(e){let s={not_started:"started",started:"completed",completed:"verified",verified:"not_started"}[e.status]||"not_started",a=await c(`/tickets/${e.id}`,{method:"PATCH",body:{status:s}});Object.assign(e,a),g()}async function ge(e){!e.up_next&&(e.status==="completed"||e.status==="verified")?await c(`/tickets/${e.id}`,{method:"PATCH",body:{status:"not_started",up_next:!0}}):await c(`/tickets/${e.id}/up-next`,{method:"POST"}),f()}async function ce(e,t,s){let a=await c(`/tickets/${e.id}`,{method:"PATCH",body:{[t]:s}});Object.assign(e,a),g()}async function Ge(e){let t=n.tickets.findIndex(s=>s.id===e);if(await c(`/tickets/${e}`,{method:"DELETE"}),n.tickets=n.tickets.filter(s=>s.id!==e),n.selectedIds.delete(e),g(),t>0&&n.tickets.length>0){let s=Math.min(t-1,n.tickets.length-1);document.querySelector(`.ticket-row[data-id="${n.tickets[s].id}"] .ticket-title-input`)?.focus()}else h()}function Je(e,t){z&&clearTimeout(z),z=setTimeout(()=>{c(`/tickets/${e}`,{method:"PATCH",body:t})},300)}function Ye(e,t){A();let a=navigator.platform.includes("Mac")?"\u2318":"Ctrl+",i=$(e,R.map(o=>({label:o.label,key:o.key,shortcut:`${a}${o.key.toUpperCase()}`,color:b(o.value),active:t.category===o.value,action:async()=>{let r=await c(`/tickets/${t.id}`,{method:"PATCH",body:{category:o.value}});Object.assign(t,r),g()}})));document.body.appendChild(i),D(i,e),i.style.visibility=""}function ve(e,t){A();let s=$(e,W.map(a=>({label:a.label,key:a.key,shortcut:`Alt+${a.key}`,color:w(a.value),active:t.priority===a.value,action:async()=>{let i=await c(`/tickets/${t.id}`,{method:"PATCH",body:{priority:a.value}});Object.assign(t,i),g()}})));document.body.appendChild(s),D(s,e),s.style.visibility=""}function H(){document.querySelectorAll(".ticket-row[data-id]").forEach(e=>{let t=parseInt(e.dataset.id,10),s=e.querySelector(".ticket-checkbox");n.selectedIds.has(t)?(e.classList.add("selected"),s&&(s.checked=!0)):(e.classList.remove("selected"),s&&(s.checked=!1))})}function L(){let e=n.selectedIds.size,t=n.tickets.length,s=e>0,a=n.view==="trash",i=document.getElementById("batch-select-all");i.checked=t>0&&e===t,i.indeterminate=e>0&&e<t,document.getElementById("batch-count").textContent=s?`${e} selected`:"";let o=["batch-category","batch-priority","batch-status","batch-upnext","batch-delete"];for(let p of o){let M=document.getElementById(p);M.style.display=a?"none":"",a||(M.disabled=!s)}let r=document.getElementById("batch-restore"),d=document.getElementById("batch-empty-trash");if(a){let p=document.getElementById("batch-toolbar");r||(r=y(l("button",{id:"batch-restore",className:"btn btn-sm",children:"Restore"})),r.addEventListener("click",async()=>{await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"restore"}}),n.selectedIds.clear(),f()}),p.insertBefore(r,document.getElementById("batch-count"))),r.disabled=!s,r.style.display="",d||(d=y(l("button",{id:"batch-empty-trash",className:"btn btn-sm btn-danger",children:"Empty Trash"})),d.addEventListener("click",async()=>{await c("/trash/empty",{method:"POST"}),n.selectedIds.clear(),f()}),p.insertBefore(d,document.getElementById("batch-count"))),d.disabled=t===0,d.style.display=""}else r&&(r.style.display="none"),d&&(d.style.display="none");let m=document.querySelector(".batch-star-icon"),u=document.getElementById("batch-upnext");if(!a&&m&&s){let p=n.tickets.filter(x=>n.selectedIds.has(x.id)),M=p.every(x=>x.up_next),Ee=p.every(x=>!x.up_next);M?(m.textContent="\u2605",u.classList.add("active"),u.classList.remove("mixed")):Ee?(m.textContent="\u2606",u.classList.remove("active","mixed")):(m.innerHTML=l("span",{className:"star-mixed-wrap",children:[l("span",{className:"star-mixed-fill",children:"\u2605"}),"\u2606"]}).toString(),u.classList.remove("active"),u.classList.add("mixed"))}else m&&(m.textContent="\u2606",u.classList.remove("active","mixed"));_()}async function f(){if(n.backupPreview?.active){Xe();return}let e=new URLSearchParams;n.view==="trash"?e.set("status","deleted"):n.view==="up-next"?e.set("up_next","true"):n.view==="open"?e.set("status","open"):n.view==="completed"?e.set("status","completed"):n.view==="non-verified"?e.set("status","non_verified"):n.view==="verified"?e.set("status","verified"):n.view.startsWith("category:")?e.set("category",n.view.split(":")[1]):n.view.startsWith("priority:")&&e.set("priority",n.view.split(":")[1]),n.search&&e.set("search",n.search),e.set("sort_by",n.sortBy),e.set("sort_dir",n.sortDir);let t=e.toString();n.tickets=await c(`/tickets${t?"?"+t:""}`),g()}function Xe(){let e=[...n.backupPreview?.tickets||[]];if(n.view==="trash")e=e.filter(t=>t.status==="deleted");else if(n.view==="up-next")e=e.filter(t=>t.up_next&&t.status!=="deleted");else if(n.view==="open")e=e.filter(t=>t.status==="not_started"||t.status==="started");else if(n.view==="completed")e=e.filter(t=>t.status==="completed");else if(n.view==="non-verified")e=e.filter(t=>t.status!=="verified"&&t.status!=="deleted");else if(n.view==="verified")e=e.filter(t=>t.status==="verified");else if(n.view.startsWith("category:")){let t=n.view.split(":")[1];e=e.filter(s=>s.category===t&&s.status!=="deleted")}else if(n.view.startsWith("priority:")){let t=n.view.split(":")[1];e=e.filter(s=>s.priority===t&&s.status!=="deleted")}else e=e.filter(t=>t.status!=="deleted");if(n.search){let t=n.search.toLowerCase();e=e.filter(s=>s.title.toLowerCase().includes(t)||s.ticket_number.toLowerCase().includes(t)||s.details&&s.details.toLowerCase().includes(t))}n.tickets=e,g()}function Qe(e){let t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function Ze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function et(e){return e==="5min"?"Recent (every 5 min)":e==="hourly"?"Hourly":e==="daily"?"Daily":e}async function G(){var t;let e=document.getElementById("backup-list");if(e)try{let s=await c("/backups");if(s.backups.length===0){e.textContent="No backups yet. First backup will be created shortly.";return}let a={};for(let i of s.backups)(a[t=i.tier]||(a[t]=[])).push(i);e.innerHTML="";for(let i of["5min","hourly","daily"]){let o=a[i];if(!(!o||o.length===0)){e.appendChild(y(l("div",{className:"backup-tier-label",children:et(i)})));for(let r of o){let d=y(l("div",{className:"backup-row","data-tier":r.tier,"data-filename":r.filename,children:[l("span",{className:"backup-row-time",children:Qe(r.createdAt)}),l("span",{className:"backup-row-meta",children:[new Date(r.createdAt).toLocaleString()," \xB7 ",Ze(r.sizeBytes)]})]}));d.addEventListener("click",()=>{tt(r.tier,r.filename,r.createdAt)}),e.appendChild(d)}}}}catch{e.textContent="Failed to load backups."}}async function tt(e,t,s){let a=document.getElementById("settings-overlay");a.style.display="none";let i=document.getElementById("backup-preview-banner"),o=document.getElementById("backup-preview-label");o.textContent="Loading backup preview...",i.style.display="flex";try{let r=await c(`/backups/preview/${e}/${t}`);n.backupPreview={active:!0,tickets:r.tickets,timestamp:s,tier:e,filename:t},n.selectedIds.clear(),n.activeTicketId=null,o.textContent=`Previewing backup from ${new Date(s).toLocaleString()} (${r.stats.total} tickets, ${r.stats.open} open) \u2014 read-only`,f()}catch{o.textContent="Failed to load backup preview.",setTimeout(()=>{i.style.display="none"},3e3)}}async function nt(){let e=document.getElementById("backup-preview-banner");e.style.display="none",n.backupPreview=null,n.selectedIds.clear(),n.activeTicketId=null,await c("/backups/preview/cleanup",{method:"POST"}),f()}async function st(){if(!n.backupPreview)return;let e=document.getElementById("backup-restore-btn");e.textContent="Restoring...",e.disabled=!0;try{await c("/backups/restore",{method:"POST",body:{tier:n.backupPreview.tier,filename:n.backupPreview.filename}}),window.location.reload()}catch{e.textContent="Restore failed",e.disabled=!1,setTimeout(()=>{e.textContent="Restore This Backup"},3e3)}}function he(){document.getElementById("backup-cancel-btn")?.addEventListener("click",()=>{nt()}),document.getElementById("backup-restore-btn")?.addEventListener("click",()=>{st()});let e=document.getElementById("backup-now-btn");e?.addEventListener("click",async()=>{e.textContent="Backing up...",e.disabled=!0;try{(await c("/backups/now",{method:"POST"})).error?e.textContent="In progress...":(e.textContent="Done!",G())}catch{e.textContent="Failed"}setTimeout(()=>{e.textContent="Backup Now",e.disabled=!1},1500)})}async function it(){await at(),await f(),mt(),dt(),ct(),pt(),ft(),yt(),gt(),bt(),ot(),he(),rt(),re(),kt(),document.addEventListener("hotsheet:render",()=>g()),h()}async function at(){try{let e=await c("/settings");(e.detail_position==="side"||e.detail_position==="bottom")&&(n.settings.detail_position=e.detail_position),e.detail_width&&(n.settings.detail_width=parseInt(e.detail_width,10)||360),e.detail_height&&(n.settings.detail_height=parseInt(e.detail_height,10)||300),e.trash_cleanup_days&&(n.settings.trash_cleanup_days=parseInt(e.trash_cleanup_days,10)||3),e.verified_cleanup_days&&(n.settings.verified_cleanup_days=parseInt(e.verified_cleanup_days,10)||30),(e.layout==="list"||e.layout==="columns")&&(n.layout=e.layout)}catch{}F(n.settings.detail_position),V()}function ot(){let e=document.getElementById("settings-overlay"),t=document.getElementById("settings-close");document.getElementById("settings-btn").addEventListener("click",()=>{document.getElementById("settings-trash-days").value=String(n.settings.trash_cleanup_days),document.getElementById("settings-verified-days").value=String(n.settings.verified_cleanup_days),e.style.display="flex",G(),c("/file-settings").then(p=>{document.getElementById("settings-backup-dir").value=p.backupDir||""})}),t.addEventListener("click",()=>{e.style.display="none"}),e.addEventListener("click",p=>{p.target===e&&(e.style.display="none")});let a=document.getElementById("settings-trash-days"),i=null;a.addEventListener("input",()=>{i&&clearTimeout(i),i=setTimeout(()=>{let p=Math.max(1,parseInt(a.value,10)||3);a.value=String(p),n.settings.trash_cleanup_days=p,c("/settings",{method:"PATCH",body:{trash_cleanup_days:String(p)}})},500)});let o=document.getElementById("settings-verified-days"),r=null;o.addEventListener("input",()=>{r&&clearTimeout(r),r=setTimeout(()=>{let p=Math.max(1,parseInt(o.value,10)||30);o.value=String(p),n.settings.verified_cleanup_days=p,c("/settings",{method:"PATCH",body:{verified_cleanup_days:String(p)}})},500)});let d=document.getElementById("settings-backup-dir"),m=document.getElementById("settings-backup-dir-hint"),u=null;d.addEventListener("input",()=>{u&&clearTimeout(u),u=setTimeout(()=>{let p=d.value.trim();c("/file-settings",{method:"PATCH",body:{backupDir:p}}).then(()=>{m.textContent=p?"Saved. New backups will use this location.":"Using default location inside the data directory."})},800)})}function lt(){let e=document.getElementById("skills-banner");if(!e)return;e.style.display="flex",document.getElementById("skills-banner-dismiss")?.addEventListener("click",()=>{e.style.display="none"})}function rt(){let e=document.getElementById("copy-prompt-section"),t=document.getElementById("copy-prompt-btn"),s=document.getElementById("copy-prompt-label"),a=document.getElementById("copy-prompt-icon"),i="";c("/worklist-info").then(o=>{i=o.prompt,e.style.display="",o.skillCreated&&lt()}),t.addEventListener("click",()=>{i!==""&&navigator.clipboard.writeText(i).then(()=>{s.textContent="Copied!",a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>',setTimeout(()=>{s.textContent="Copy AI prompt",a.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>'},1500)})})}function Q(){let e=document.getElementById("layout-toggle"),t=O(),s=e.querySelector('[data-layout="columns"]');s.disabled=!t,s.style.opacity=t?"":"0.3";let a=n.layout==="columns"&&!t?"list":n.layout;e.querySelectorAll(".layout-btn").forEach(i=>{i.classList.toggle("active",i.dataset.layout===a)})}function dt(){document.getElementById("layout-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.addEventListener("click",()=>{let s=t.dataset.layout;s==="columns"&&!O()||(n.layout=s,Q(),g(),c("/settings",{method:"PATCH",body:{layout:s}}))})}),Q()}function be(){document.getElementById("detail-position-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.classList.toggle("active",t.dataset.position===n.settings.detail_position)})}function ct(){document.getElementById("detail-position-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.addEventListener("click",()=>{let s=t.dataset.position;n.settings.detail_position=s,F(s),V(),be(),c("/settings",{method:"PATCH",body:{detail_position:s}})})}),be()}function ke(e){return e==="up-next"?{action:"up_next",value:!0}:e==="open"?{action:"status",value:"not_started"}:e==="completed"?{action:"status",value:"completed"}:e==="verified"?{action:"status",value:"verified"}:e==="trash"?{action:"delete",value:null}:e.startsWith("category:")?{action:"category",value:e.split(":")[1]}:e.startsWith("priority:")?{action:"priority",value:e.split(":")[1]}:null}async function ut(e,t){let s=ke(e);s&&(s.action==="delete"?await c("/tickets/batch",{method:"POST",body:{ids:t,action:"delete"}}):await c("/tickets/batch",{method:"POST",body:{ids:t,action:s.action,value:s.value}}),f())}function mt(){let e=document.querySelectorAll(".sidebar-item[data-view]");e.forEach(t=>{t.addEventListener("click",()=>{e.forEach(a=>{a.classList.remove("active")}),t.classList.add("active"),n.view=t.dataset.view,n.selectedIds.clear(),Q(),f()});let s=t.dataset.view;ke(s)&&(t.addEventListener("dragover",a=>{a.preventDefault(),a.dataTransfer.dropEffect="move",t.classList.add("drop-target")}),t.addEventListener("dragleave",()=>{t.classList.remove("drop-target")}),t.addEventListener("drop",a=>{a.preventDefault(),t.classList.remove("drop-target");let i=[...v];i.length!==0&&ut(s,i)}))})}function pt(){let e=document.getElementById("sort-select");e.addEventListener("change",()=>{let[t,s]=e.value.split(":");n.sortBy=t,n.sortDir=s,f()})}var J=null;function ft(){let e=document.getElementById("search-input");e.addEventListener("input",()=>{J&&clearTimeout(J),J=setTimeout(()=>{n.search=e.value,f()},200)}),e.addEventListener("keydown",t=>{t.key==="Escape"&&(e.value="",n.search="",f())})}function yt(){let e=document.getElementById("batch-category");e.addEventListener("change",async()=>{e.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"category",value:e.value}}),e.value="",f())});let t=document.getElementById("batch-priority");t.addEventListener("change",async()=>{t.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"priority",value:t.value}}),t.value="",f())});let s=document.getElementById("batch-status");s.addEventListener("change",async()=>{s.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"status",value:s.value}}),s.value="",f())}),document.getElementById("batch-upnext").addEventListener("click",async()=>{let a=n.tickets.filter(r=>n.selectedIds.has(r.id)),o=!a.every(r=>r.up_next);if(o){let r=a.filter(d=>d.status==="completed"||d.status==="verified");r.length>0&&await c("/tickets/batch",{method:"POST",body:{ids:r.map(d=>d.id),action:"status",value:"not_started"}})}await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:o}}),f()}),document.getElementById("batch-delete").addEventListener("click",async()=>{await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"delete"}}),n.selectedIds.clear(),f()}),document.getElementById("batch-select-all").addEventListener("change",a=>{if(a.target.checked)for(let o of n.tickets)n.selectedIds.add(o.id);else n.selectedIds.clear();g()})}var Y=null;function gt(){document.getElementById("detail-close").addEventListener("click",ie);let e=["detail-title","detail-details"];for(let s of e){let a=document.getElementById(s);a.addEventListener("input",()=>{Y&&clearTimeout(Y),Y=setTimeout(()=>{if(n.activeTicketId==null)return;let i=s.replace("detail-","");c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{[i]:a.value}}).then(()=>{f()})},300)})}let t=["detail-category","detail-priority","detail-status"];for(let s of t){let a=document.getElementById(s);a.addEventListener("change",async()=>{if(n.activeTicketId==null)return;let i=s.replace("detail-","");await c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{[i]:a.value}}),f()})}document.getElementById("detail-upnext").addEventListener("change",async()=>{if(n.activeTicketId==null)return;let s=n.tickets.find(i=>i.id===n.activeTicketId);document.getElementById("detail-upnext").checked&&s&&(s.status==="completed"||s.status==="verified")?await c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{status:"not_started",up_next:!0}}):await c(`/tickets/${n.activeTicketId}/up-next`,{method:"POST"}),f(),N(n.activeTicketId)}),document.getElementById("detail-file-input").addEventListener("change",async s=>{let a=s.target,i=a.files?.[0];!i||n.activeTicketId==null||(await se(`/tickets/${n.activeTicketId}/attachments`,i),a.value="",N(n.activeTicketId),f())}),document.getElementById("detail-attachments").addEventListener("click",async s=>{let i=s.target.closest(".attachment-delete");if(i===null)return;let o=i.dataset.attId;o===void 0||o===""||(await c(`/attachments/${o}`,{method:"DELETE"}),n.activeTicketId!=null&&N(n.activeTicketId))})}function vt(e){if(!e||e==="")return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.trim()?[{text:e,created_at:""}]:[]}function ht(e){let t=[];t.push(`${e.ticket_number}: ${e.title}`),e.details.trim()&&(t.push(""),t.push(e.details.trim()));let s=vt(e.notes);if(s.length>0){t.push("");for(let a of s)t.push(`- ${a.text}`)}return t.join(`
2
- `)}function bt(){document.addEventListener("keydown",e=>{let t=e.target.tagName,s=t==="INPUT"||t==="TEXTAREA"||t==="SELECT",a=document.getElementById("settings-overlay");if(e.key==="Escape"&&a.style.display!=="none"){a.style.display="none";return}if(e.key==="Escape"){n.selectedIds.size>0&&(n.selectedIds.clear(),g());return}if((e.metaKey||e.ctrlKey)&&e.key==="a"&&!s){e.preventDefault(),n.selectedIds.clear();for(let i of n.tickets)n.selectedIds.add(i.id);g();return}if((e.metaKey||e.ctrlKey)&&e.key==="d"){if(n.selectedIds.size>0){e.preventDefault();let i=n.tickets.filter(d=>n.selectedIds.has(d.id)),r=!i.every(d=>d.up_next);if(r){let d=i.filter(m=>m.status==="completed"||m.status==="verified");if(d.length>0){c("/tickets/batch",{method:"POST",body:{ids:d.map(m=>m.id),action:"status",value:"not_started"}}).then(()=>c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:!0}})).then(()=>{f()});return}}c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:r}}).then(()=>{f()})}return}if((e.metaKey||e.ctrlKey)&&e.key==="c"&&n.selectedIds.size>0&&!(s&&!e.altKey)){let i=!e.altKey&&window.getSelection();if(!(i&&!i.isCollapsed&&i.toString().trim()!=="")){e.preventDefault();let r=n.tickets.filter(d=>n.selectedIds.has(d.id)).map(ht).join(`
1
+ "use strict";(()=>{var Se=Object.defineProperty;var xe=(e,t,s)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ne=(e,t,s)=>xe(e,typeof t!="symbol"?t+"":t,s);function se(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ie(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var E=class{constructor(t){ne(this,"__html");this.__html=t}toString(){return this.__html}};function T(e){return new E(e)}var _e=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function U(e){return e==null||typeof e=="boolean"?"":e instanceof E?e.__html:typeof e=="string"?se(e):typeof e=="number"?String(e):Array.isArray(e)?e.map(U).join(""):""}function Be(e,t){if(t==null||t===!1)return"";if(t===!0)return` ${e}`;let s=e==="className"?"class":e==="htmlFor"?"for":e,i;return t instanceof E?i=t.__html:typeof t=="number"?i=String(t):typeof t=="string"?i=ie(t):i="",` ${s}="${i}"`}function l(e,t){if(typeof e=="function")return e(t);let{children:s,...i}=t,a=Object.entries(i).map(([o,d])=>Be(o,d)).join("");if(_e.has(e))return new E(`<${e}${a}>`);let r=s!=null?U(s):"";return new E(`<${e}${a}>${r}</${e}>`)}function L({children:e}){return new E(e!=null?U(e):"")}function y(e){let t=document.createElement("template");return t.innerHTML=e.toString(),t.content.firstElementChild}function ae(e){document.getElementById("network-error-popup")?.remove();let t=y(l("div",{id:"network-error-popup",className:"error-popup",children:l("div",{className:"error-popup-content",children:[l("strong",{children:"Connection Error"}),l("p",{children:e}),l("button",{children:T("Dismiss")})]})}));t.querySelector("button").addEventListener("click",()=>t.remove()),document.body.appendChild(t)}async function c(e,t={}){try{return(await fetch("/api"+e,{headers:t.body!==void 0?{"Content-Type":"application/json"}:{},method:t.method,body:t.body!==void 0?JSON.stringify(t.body):void 0})).json()}catch(s){throw ae("Unable to reach the server. It may have been stopped."),s}}async function oe(e,t){try{let s=new FormData;return s.append("file",t),(await fetch("/api"+e,{method:"POST",body:s})).json()}catch(s){throw ae("Unable to reach the server. It may have been stopped."),s}}var Ce={detail_position:"side",detail_width:360,detail_height:300,trash_cleanup_days:3,verified_cleanup_days:30},n={tickets:[],selectedIds:new Set,lastClickedId:null,activeTicketId:null,view:"all",layout:"list",sortBy:"created",sortDir:"desc",search:"",settings:{...Ce},backupPreview:null},He={issue:"#6b7280",bug:"#ef4444",feature:"#22c55e",requirement_change:"#f97316",task:"#3b82f6",investigation:"#8b5cf6"},Me={issue:"ISS",bug:"BUG",feature:"FEA",requirement_change:"REQ",task:"TSK",investigation:"INV"},Ne={highest:"\u2B06\u2B06",high:"\u2B06",default:"\u2014",low:"\u2B07",lowest:"\u2B07\u2B07"},Pe={highest:"#ef4444",high:"#f97316",default:"#6b7280",low:"#3b82f6",lowest:"#94a3b8"},De={not_started:"\u25CB",started:"\u25D4",completed:"\u2713",verified:"svg"},K='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 7 17l-5-5"/><path d="m22 10-9.5 9.5-2-2"/></svg>';function k(e){return He[e]||"#6b7280"}function I(e){return Me[e]||"ISS"}function B(e){return Ne[e]||"\u2014"}function S(e){return Pe[e]||"#6b7280"}function F(e){return De[e]||"\u25CB"}function P(e){n.activeTicketId=e,de(e)}function le(){n.selectedIds.clear(),n.activeTicketId=null;let e=new CustomEvent("hotsheet:render");document.dispatchEvent(e)}function C(){let e=n.view==="trash",t=!!n.backupPreview?.active,s=document.getElementById("detail-panel"),i=document.getElementById("detail-resize-handle");if(n.selectedIds.size===1&&!e){let a=Array.from(n.selectedIds)[0];s.style.display="flex",i&&(i.style.display=""),n.activeTicketId!==a&&(n.activeTicketId=a,t?Ae(a):de(a))}else n.activeTicketId!=null&&(n.activeTicketId=null),s.style.display="none",i&&(i.style.display="none")}function re(e){let t=document.getElementById("detail-title"),s=document.getElementById("detail-details"),i=document.getElementById("detail-category"),a=document.getElementById("detail-priority"),r=document.getElementById("detail-status"),o=document.getElementById("detail-upnext"),d=document.querySelector(".upload-btn");t.readOnly=e,s.readOnly=e,i.disabled=e,a.disabled=e,r.disabled=e,o.disabled=e,d&&(d.style.display=e?"none":"")}function Ae(e){let t=n.backupPreview?.tickets.find(o=>o.id===e);if(!t||n.activeTicketId!==e)return;document.getElementById("detail-ticket-number").textContent=t.ticket_number,document.getElementById("detail-title").value=t.title,document.getElementById("detail-category").value=t.category,document.getElementById("detail-priority").value=t.priority,document.getElementById("detail-status").value=t.status,document.getElementById("detail-upnext").checked=t.up_next,document.getElementById("detail-details").value=t.details,re(!0),document.getElementById("detail-attachments").innerHTML="";let s=document.getElementById("detail-notes-section"),i=document.getElementById("detail-notes"),a=ce(t.notes);a.length>0?(s.style.display="",i.innerHTML=l(L,{children:a.map(o=>l("div",{className:"note-entry",children:[o.created_at?l("div",{className:"note-timestamp",children:new Date(o.created_at).toLocaleString()}):null,l("div",{className:"note-text",children:o.text})]}))}).toString()):(s.style.display="none",i.innerHTML="");let r=document.getElementById("detail-meta");r.innerHTML=l(L,{children:[l("div",{children:["Created: ",new Date(t.created_at).toLocaleString()]}),l("div",{children:["Updated: ",new Date(t.updated_at).toLocaleString()]}),t.completed_at?l("div",{children:["Completed: ",new Date(t.completed_at).toLocaleString()]}):null,t.verified_at?l("div",{children:["Verified: ",new Date(t.verified_at).toLocaleString()]}):null]}).toString()}async function de(e){let t=await c(`/tickets/${e}`);if(n.activeTicketId!==e)return;re(!1),document.getElementById("detail-ticket-number").textContent=t.ticket_number,document.getElementById("detail-title").value=t.title,document.getElementById("detail-category").value=t.category,document.getElementById("detail-priority").value=t.priority,document.getElementById("detail-status").value=t.status,document.getElementById("detail-upnext").checked=t.up_next,document.getElementById("detail-details").value=t.details;let s=document.getElementById("detail-attachments");t.attachments.length>0?s.innerHTML=l(L,{children:t.attachments.map(d=>l("div",{className:"attachment-item",children:[l("span",{className:"attachment-name",children:d.original_filename}),l("button",{className:"attachment-reveal","data-att-id":String(d.id),title:"Show in file manager",children:T('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>')}),l("button",{className:"attachment-delete","data-att-id":String(d.id),title:"Remove",children:T("&times;")})]}))}).toString():s.innerHTML="";let i=document.getElementById("detail-notes-section"),a=document.getElementById("detail-notes"),r=ce(t.notes);r.length>0?(i.style.display="",a.innerHTML=l(L,{children:r.map(d=>l("div",{className:"note-entry",children:[d.created_at?l("div",{className:"note-timestamp",children:new Date(d.created_at).toLocaleString()}):null,l("div",{className:"note-text",children:d.text})]}))}).toString()):(i.style.display="none",a.innerHTML="");let o=document.getElementById("detail-meta");o.innerHTML=l(L,{children:[l("div",{children:["Created: ",new Date(t.created_at).toLocaleString()]}),l("div",{children:["Updated: ",new Date(t.updated_at).toLocaleString()]}),t.completed_at?l("div",{children:["Completed: ",new Date(t.completed_at).toLocaleString()]}):null,t.verified_at?l("div",{children:["Verified: ",new Date(t.verified_at).toLocaleString()]}):null]}).toString()}function ce(e){if(!e||e==="")return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.trim()?[{text:e,created_at:""}]:[]}async function D(){try{let e=await c("/stats"),t=document.getElementById("status-bar");t&&(t.textContent=`${e.total} tickets \xB7 ${e.open} open \xB7 ${e.up_next} up next`)}catch{}}function V(e){let t=document.getElementById("content-area");t.classList.remove("detail-side","detail-bottom"),t.classList.add(e==="bottom"?"detail-bottom":"detail-side")}function z(){let e=document.getElementById("detail-panel");n.settings.detail_position==="bottom"?(e.style.width="",e.style.height=`${n.settings.detail_height}px`):(e.style.height="",e.style.width=`${n.settings.detail_width}px`)}function ue(){let e=document.getElementById("detail-resize-handle"),t=document.getElementById("detail-panel"),s=document.getElementById("content-area"),i=!1;e.addEventListener("mousedown",a=>{a.preventDefault(),i=!0,document.body.style.cursor=n.settings.detail_position==="bottom"?"row-resize":"col-resize",document.body.style.userSelect="none"}),document.addEventListener("mousemove",a=>{if(!i)return;let r=s.getBoundingClientRect();if(n.settings.detail_position==="bottom"){let o=Math.max(150,Math.min(500,r.bottom-a.clientY));n.settings.detail_height=o,t.style.height=`${o}px`}else{let o=Math.max(250,Math.min(600,r.right-a.clientX));n.settings.detail_width=o,t.style.width=`${o}px`}}),document.addEventListener("mouseup",()=>{i&&(i=!1,document.body.style.cursor="",document.body.style.userSelect="",n.settings.detail_position==="bottom"?c("/settings",{method:"PATCH",body:{detail_height:String(n.settings.detail_height)}}):c("/settings",{method:"PATCH",body:{detail_width:String(n.settings.detail_width)}}))})}function A(e,t){let s=t.getBoundingClientRect(),i=e.getBoundingClientRect(),a=window.innerWidth,r=window.innerHeight,o=s.left;o+i.width>a-8&&(o=s.right-i.width),o<8&&(o=8);let d=s.bottom+4;d+i.height>r-8&&(d=s.top-i.height-4),d<8&&(d=8),e.style.left=`${o}px`,e.style.top=`${d}px`}function $(e,t){let s=y(l("div",{className:"dropdown-menu",style:"visibility:hidden;top:0;left:0",children:t.map(d=>l("button",{className:`dropdown-item${d.active?" active":""}`,"data-key":d.key,children:[d.color?l("span",{className:"dropdown-dot",style:`background-color:${d.color}`}):null,l("span",{className:"dropdown-label",children:d.label}),d.shortcut?l("kbd",{className:"dropdown-kbd",children:d.shortcut}):null]}))}));s.querySelectorAll(".dropdown-item").forEach((d,m)=>{d.addEventListener("click",()=>{t[m].action(),s.remove()})});function a(d){let m=t.find(u=>d.key.toLowerCase()===u.key.toLowerCase());m?(d.preventDefault(),d.stopPropagation(),m.action(),r()):d.key==="Escape"&&(d.preventDefault(),r())}function r(){s.remove(),document.removeEventListener("keydown",a,!0),document.removeEventListener("click",o)}function o(){r()}return document.addEventListener("keydown",a,!0),setTimeout(()=>{document.addEventListener("click",o)},0),s}function R(){document.querySelectorAll(".dropdown-menu").forEach(e=>{e.remove()})}var j=null,H=!1,M=null,W="",h=[],q=[{key:"i",value:"issue",label:"Issue"},{key:"b",value:"bug",label:"Bug"},{key:"f",value:"feature",label:"Feature"},{key:"r",value:"requirement_change",label:"Req Change"},{key:"k",value:"task",label:"Task"},{key:"g",value:"investigation",label:"Investigation"}],G=[{key:"1",value:"highest",label:"Highest"},{key:"2",value:"high",label:"High"},{key:"3",value:"default",label:"Default"},{key:"4",value:"low",label:"Low"},{key:"5",value:"lowest",label:"Lowest"}];function $e(){let e=document.activeElement;if(!e||!(e instanceof HTMLElement))return null;let t=e.closest(".ticket-row");if(!t)return null;if(t.classList.contains("draft-row"))return"draft";let s=t.dataset.id;return s!==void 0&&s!==""?parseInt(s,10):null}function Re(e){e!=null&&(H=!0,e==="draft"?b():document.querySelector(`.ticket-row[data-id="${e}"] .ticket-title-input`)?.focus(),H=!1)}function O(){let e=n.view;return e!=="completed"&&e!=="verified"&&e!=="trash"}function fe(){return n.view==="up-next"||n.view==="open"?[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"}]:n.view==="non-verified"?[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"},{status:"completed",label:"Completed"}]:[{status:"not_started",label:"Not Started"},{status:"started",label:"Started"},{status:"completed",label:"Completed"},{status:"verified",label:"Verified"}]}function g(){let e=!!n.backupPreview?.active;if(n.layout==="columns"&&O()){if(e){Oe();return}Ke();return}let t=n.view==="trash",s=e?null:$e(),i=null;if(s!=null&&s!=="draft"){let o=document.querySelector(`.ticket-row[data-id="${s}"] .ticket-title-input`);o&&(i=o.value)}let a=document.getElementById("ticket-list"),r=a.scrollTop;if(a.innerHTML="",a.classList.remove("ticket-list-columns"),!t&&!e&&a.appendChild(he()),n.tickets.length===0){let o=t?"Trash is empty":e?"No tickets match this view":"";o&&a.appendChild(y(l("div",{className:"ticket-list-empty",children:o})))}for(let o of n.tickets)e?a.appendChild(qe(o)):t?a.appendChild(We(o)):a.appendChild(je(o));if(a.scrollTop=r,e){let o=document.getElementById("batch-toolbar");o&&(o.style.display="none"),N(),C()}else{let o=document.getElementById("batch-toolbar");if(o&&(o.style.display=""),s!=null&&s!=="draft"&&i!=null){let d=document.querySelector(`.ticket-row[data-id="${s}"] .ticket-title-input`);d&&d.value!==i&&(d.value=i)}Re(s),x()}D()}function qe(e){let t=n.selectedIds.has(e.id),s=e.status==="completed"||e.status==="verified",i=e.status==="verified",a=y(l("div",{className:`ticket-row${t?" selected":""}${s?" completed":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("span",{className:"ticket-checkbox-spacer"}),l("span",{className:`ticket-status-btn${i?" verified":""}`,style:"cursor:default",children:i?T(K):F(e.status)}),l("span",{className:"ticket-category-badge",style:`background-color:${k(e.category)};cursor:default`,title:e.category,children:I(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-title-input",style:"cursor:default",children:e.title}),l("span",{className:"ticket-priority-indicator",style:`color:${S(e.priority)};cursor:default`,title:e.priority,children:B(e.priority)}),l("span",{className:`ticket-star${e.up_next?" active":""}`,style:"cursor:default",children:e.up_next?"\u2605":"\u2606"})]}));return a.addEventListener("click",()=>{n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,N(),C()}),a}function ye(e){let t={scrollLeft:0,columns:{}},s=e.querySelector(".columns-container");return s&&(t.scrollLeft=s.scrollLeft,s.querySelectorAll(".column[data-status]").forEach(i=>{let a=i.dataset.status,r=i.querySelector(".column-body");r&&(t.columns[a]=r.scrollTop)})),t}function ge(e,t){let s=e.querySelector(".columns-container");s&&(s.scrollLeft=t.scrollLeft,s.querySelectorAll(".column[data-status]").forEach(i=>{let a=i.dataset.status,r=i.querySelector(".column-body");r&&t.columns[a]!=null&&(r.scrollTop=t.columns[a])}))}function Oe(){let e=document.getElementById("ticket-list"),t=ye(e);e.innerHTML="",e.classList.add("ticket-list-columns");let s=fe(),i=y(l("div",{className:"columns-container"}));for(let r of s){let o=n.tickets.filter(u=>u.status===r.status),d=y(l("div",{className:"column","data-status":r.status,children:[l("div",{className:"column-header",children:[l("span",{className:"column-title",children:r.label}),l("span",{className:"column-count",children:String(o.length)})]}),l("div",{className:"column-body"})]})),m=d.querySelector(".column-body");for(let u of o)m.appendChild(Ue(u));i.appendChild(d)}e.appendChild(i),ge(e,t);let a=document.getElementById("batch-toolbar");a&&(a.style.display="none"),D()}function Ue(e){let t=n.selectedIds.has(e.id),s=y(l("div",{className:`column-card${t?" selected":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("div",{className:"column-card-header",children:[l("span",{className:"ticket-category-badge",style:`background-color:${k(e.category)}`,children:I(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-priority-indicator",style:`color:${S(e.priority)};cursor:default`,children:B(e.priority)}),l("span",{className:`ticket-star${e.up_next?" active":""}`,style:"cursor:default",children:e.up_next?"\u2605":"\u2606"})]}),l("div",{className:"column-card-title",children:e.title})]}));return s.addEventListener("click",()=>{n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,ve(),C()}),s}function Ke(){let e=document.getElementById("ticket-list"),t=ye(e);e.innerHTML="",e.classList.add("ticket-list-columns"),e.appendChild(he());let s=fe(),i=y(l("div",{className:"columns-container"}));for(let a of s){let r=n.tickets.filter(m=>m.status===a.status),o=y(l("div",{className:"column","data-status":a.status,children:[l("div",{className:"column-header",children:[l("span",{className:"column-title",children:a.label}),l("span",{className:"column-count",children:String(r.length)})]}),l("div",{className:"column-body"})]})),d=o.querySelector(".column-body");for(let m of r)d.appendChild(Fe(m));d.addEventListener("dragover",m=>{m.preventDefault(),m.dataTransfer.dropEffect="move",o.classList.add("column-drop-target")}),d.addEventListener("dragleave",m=>{let u=m.relatedTarget;(!u||!d.contains(u))&&o.classList.remove("column-drop-target")}),d.addEventListener("drop",m=>{m.preventDefault(),o.classList.remove("column-drop-target");let u=h;h=[],u.length!==0&&c("/tickets/batch",{method:"POST",body:{ids:u,action:"status",value:a.status}}).then(()=>{p()})}),i.appendChild(o)}e.appendChild(i),ge(e,t),x(),D()}function Fe(e){let t=n.selectedIds.has(e.id),s=y(l("div",{className:`column-card${t?" selected":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("div",{className:"column-card-header",children:[l("span",{className:"ticket-category-badge",style:`background-color:${k(e.category)}`,children:I(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-priority-indicator",style:`color:${S(e.priority)}`,children:B(e.priority)}),l("button",{className:`ticket-star${e.up_next?" active":""}`,title:e.up_next?"Remove from Up Next":"Add to Up Next",children:e.up_next?"\u2605":"\u2606"})]}),l("div",{className:"column-card-title",children:e.title})]})),i=s.querySelector(".ticket-priority-indicator");return i.addEventListener("click",a=>{a.stopPropagation(),Te(i,e)}),s.querySelector(".ticket-star").addEventListener("click",a=>{a.stopPropagation(),Ee(e)}),s.draggable=!0,s.addEventListener("dragstart",a=>{n.selectedIds.has(e.id)&&n.selectedIds.size>1?h=Array.from(n.selectedIds):h=[e.id],a.dataTransfer.setData("text/plain",JSON.stringify(h)),a.dataTransfer.effectAllowed="move"}),s.addEventListener("dragend",()=>{h=[]}),s.addEventListener("click",a=>{if(a.metaKey||a.ctrlKey)n.selectedIds.has(e.id)?n.selectedIds.delete(e.id):n.selectedIds.add(e.id),n.lastClickedId=e.id;else if(a.shiftKey&&n.lastClickedId!=null){let r=n.tickets.map(m=>m.id),o=r.indexOf(n.lastClickedId),d=r.indexOf(e.id);if(o!==-1&&d!==-1){let m=Math.min(o,d),u=Math.max(o,d);n.selectedIds.clear();for(let v=m;v<=u;v++)n.selectedIds.add(r[v])}}else n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id;ve(),x()}),s}function ve(){document.querySelectorAll(".column-card[data-id]").forEach(e=>{let t=parseInt(e.dataset.id,10);n.selectedIds.has(t)?e.classList.add("selected"):e.classList.remove("selected")})}function he(){let e=be(),t=n.view.startsWith("category:"),s=y(l("div",{className:"ticket-row draft-row",children:[l("span",{className:"ticket-checkbox-spacer"}),l("span",{className:"ticket-status-btn draft-placeholder",children:"\u25CB"}),l("span",{className:"ticket-category-badge draft-badge",style:`background-color:${k(e)}${t?"":";cursor:pointer;opacity:1"}`,children:I(e)}),l("span",{className:"ticket-number draft-number"}),l("input",{type:"text",className:"ticket-title-input draft-input",placeholder:"New ticket...",value:W}),l("span",{className:"ticket-priority-indicator draft-placeholder"}),l("span",{className:"ticket-star draft-placeholder"})]}));if(!t){let a=s.querySelector(".ticket-category-badge");a.addEventListener("click",r=>{r.stopPropagation(),ze(a)})}let i=s.querySelector(".draft-input");return i.addEventListener("input",()=>{W=i.value}),i.addEventListener("keydown",async a=>{if(a.key==="Enter"&&i.value.trim()){a.preventDefault();let r=i.value.trim();W="",i.value="";let o=Ve();M&&!n.view.startsWith("category:")&&(o.category=M);let d=await c("/tickets",{method:"POST",body:{title:r,defaults:o}});d&&(n.selectedIds.clear(),n.selectedIds.add(d.id)),await p(),b()}else a.key==="ArrowDown"&&(a.preventDefault(),n.tickets.length>0&&document.querySelector(`.ticket-row[data-id="${n.tickets[0].id}"] .ticket-title-input`)?.focus())}),s}function b(){document.querySelector(".draft-row .draft-input")?.focus()}function Ve(){let e=n.view;return e==="up-next"?{up_next:!0}:e==="open"?{}:e==="completed"?{status:"completed"}:e.startsWith("category:")?{category:e.split(":")[1]}:e.startsWith("priority:")?{priority:e.split(":")[1]}:{}}function be(){if(M)return M;let e=n.view;return e.startsWith("category:")?e.split(":")[1]:"issue"}function ze(e){R();let s=navigator.platform.includes("Mac")?"\u2318":"Ctrl+",i=be(),a=$(e,q.map(r=>({label:r.label,key:r.key,shortcut:`${s}${r.key.toUpperCase()}`,color:k(r.value),active:i===r.value,action:()=>{M=r.value,g(),b()}})));document.body.appendChild(a),A(a,e),a.style.visibility=""}function je(e){let t=n.selectedIds.has(e.id),s=e.status==="completed"||e.status==="verified",i=e.status==="verified",a=y(l("div",{className:`ticket-row${t?" selected":""}${s?" completed":""}${e.up_next?" up-next":""}`,"data-id":String(e.id),children:[l("input",{type:"checkbox",className:"ticket-checkbox",checked:t}),l("button",{className:`ticket-status-btn${i?" verified":""}`,title:e.status.replace("_"," "),children:i?T(K):F(e.status)}),l("span",{className:"ticket-category-badge",style:`background-color:${k(e.category)}`,title:e.category,children:I(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("input",{type:"text",className:"ticket-title-input",value:e.title}),l("span",{className:"ticket-priority-indicator",style:`color:${S(e.priority)}`,title:e.priority,children:B(e.priority)}),l("button",{className:`ticket-star${e.up_next?" active":""}`,title:e.up_next?"Remove from Up Next":"Add to Up Next",children:e.up_next?"\u2605":"\u2606"})]}));a.addEventListener("mousedown",u=>{let v=u.target;v.tagName!=="INPUT"&&v.tagName!=="BUTTON"&&(a.draggable=!0)}),a.addEventListener("mouseup",()=>{a.draggable=!1}),a.addEventListener("dragend",()=>{a.draggable=!1,h=[]}),a.addEventListener("dragstart",u=>{n.selectedIds.has(e.id)&&n.selectedIds.size>1?h=Array.from(n.selectedIds):h=[e.id],u.dataTransfer.setData("text/plain",JSON.stringify(h)),u.dataTransfer.effectAllowed="move"}),a.addEventListener("mousedown",u=>{(u.metaKey||u.ctrlKey||u.shiftKey)&&(u.preventDefault(),ke(u,e)&&u.stopPropagation())});let r=a.querySelector(".ticket-checkbox");r.addEventListener("click",u=>u.stopPropagation()),r.addEventListener("change",()=>{r.checked?n.selectedIds.add(e.id):n.selectedIds.delete(e.id),n.lastClickedId=e.id,g()}),a.querySelector(".ticket-status-btn").addEventListener("click",u=>{u.stopPropagation(),Xe(e)});let o=a.querySelector(".ticket-category-badge");o.addEventListener("click",u=>{u.stopPropagation(),et(o,e)});let d=a.querySelector(".ticket-title-input");d.addEventListener("focus",()=>{H||n.selectedIds.size===1&&n.selectedIds.has(e.id)||(n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,N(),x())}),d.addEventListener("input",()=>{Ze(e.id,{title:d.value})}),d.addEventListener("keydown",u=>{Ge(u,e,d)});let m=a.querySelector(".ticket-priority-indicator");return m.addEventListener("click",u=>{u.stopPropagation(),Te(m,e)}),a.querySelector(".ticket-star").addEventListener("click",u=>{u.stopPropagation(),Ee(e)}),a}function We(e){let t=n.selectedIds.has(e.id),s=e.deleted_at?new Date(e.deleted_at):null,i=y(l("div",{className:`ticket-row trash-row${t?" selected":""}`,"data-id":String(e.id),children:[l("input",{type:"checkbox",className:"ticket-checkbox",checked:t}),l("span",{className:"ticket-category-badge",style:`background-color:${k(e.category)}`,children:I(e.category)}),l("span",{className:"ticket-number",children:e.ticket_number}),l("span",{className:"ticket-title-input trash-title",style:"cursor:default",children:e.title}),l("span",{className:"ticket-number",title:s?`Deleted: ${s.toLocaleString()}`:"",children:s?s.toLocaleDateString():""}),l("button",{className:"btn btn-sm",title:"Restore from trash",children:"Restore"})]}));i.addEventListener("mousedown",r=>{(r.metaKey||r.ctrlKey||r.shiftKey)&&(r.preventDefault(),ke(r,e)&&r.stopPropagation())});let a=i.querySelector(".ticket-checkbox");return a.addEventListener("click",r=>r.stopPropagation()),a.addEventListener("change",()=>{a.checked?n.selectedIds.add(e.id):n.selectedIds.delete(e.id),n.lastClickedId=e.id,g()}),i.querySelector(".trash-title").addEventListener("click",()=>{n.selectedIds.size===1&&n.selectedIds.has(e.id)||(n.selectedIds.clear(),n.selectedIds.add(e.id),n.lastClickedId=e.id,N(),x())}),i.querySelector(".btn").addEventListener("click",async r=>{r.stopPropagation(),await c(`/tickets/${e.id}/restore`,{method:"POST"}),p()}),i}function ke(e,t){let s=e.metaKey||e.ctrlKey,i=e.shiftKey;if(s)n.selectedIds.has(t.id)?n.selectedIds.delete(t.id):n.selectedIds.add(t.id),n.lastClickedId=t.id,g();else if(i&&n.lastClickedId!=null){let a=n.tickets.map(d=>d.id),r=a.indexOf(n.lastClickedId),o=a.indexOf(t.id);if(r!==-1&&o!==-1){let d=Math.min(r,o),m=Math.max(r,o);n.selectedIds.clear();for(let u=d;u<=m;u++)n.selectedIds.add(a[u])}g()}else return!1;return!0}function Ge(e,t,s){if(e.key==="Enter")e.preventDefault(),b();else if(e.key==="Backspace"&&s.value==="")e.preventDefault(),Qe(t.id);else if(e.key==="ArrowDown"&&e.shiftKey)e.preventDefault(),me(t.id,1);else if(e.key==="ArrowUp"&&e.shiftKey)e.preventDefault(),me(t.id,-1);else if(e.key==="ArrowDown")e.preventDefault(),Je(t.id);else if(e.key==="ArrowUp")e.preventDefault(),Ye(t.id);else if((e.metaKey||e.ctrlKey)&&!e.altKey&&q.some(i=>i.key===e.key)){e.preventDefault();let i=q.find(a=>a.key===e.key);pe(t,"category",i.value)}else if(e.altKey&&!e.metaKey&&!e.ctrlKey&&G.some(i=>i.key===e.key)){e.preventDefault();let i=G.find(a=>a.key===e.key);pe(t,"priority",i.value)}}function Je(e){let t=n.tickets.findIndex(s=>s.id===e);t<n.tickets.length-1&&document.querySelector(`.ticket-row[data-id="${n.tickets[t+1].id}"] .ticket-title-input`)?.focus()}function Ye(e){let t=n.tickets.findIndex(s=>s.id===e);t>0?document.querySelector(`.ticket-row[data-id="${n.tickets[t-1].id}"] .ticket-title-input`)?.focus():b()}function me(e,t){let i=n.tickets.findIndex(o=>o.id===e)+t;if(i<0||i>=n.tickets.length)return;let a=n.tickets[i].id;n.selectedIds.add(e),n.selectedIds.has(a)?n.selectedIds.delete(e):n.selectedIds.add(a),H=!0,document.querySelector(`.ticket-row[data-id="${a}"] .ticket-title-input`)?.focus(),H=!1,N(),x()}async function Xe(e){let s={not_started:"started",started:"completed",completed:"verified",verified:"not_started"}[e.status]||"not_started",i=await c(`/tickets/${e.id}`,{method:"PATCH",body:{status:s}});Object.assign(e,i),g()}async function Ee(e){!e.up_next&&(e.status==="completed"||e.status==="verified")?await c(`/tickets/${e.id}`,{method:"PATCH",body:{status:"not_started",up_next:!0}}):await c(`/tickets/${e.id}/up-next`,{method:"POST"}),p()}async function pe(e,t,s){let i=await c(`/tickets/${e.id}`,{method:"PATCH",body:{[t]:s}});Object.assign(e,i),g()}async function Qe(e){let t=n.tickets.findIndex(s=>s.id===e);if(await c(`/tickets/${e}`,{method:"DELETE"}),n.tickets=n.tickets.filter(s=>s.id!==e),n.selectedIds.delete(e),g(),t>0&&n.tickets.length>0){let s=Math.min(t-1,n.tickets.length-1);document.querySelector(`.ticket-row[data-id="${n.tickets[s].id}"] .ticket-title-input`)?.focus()}else b()}function Ze(e,t){j&&clearTimeout(j),j=setTimeout(()=>{c(`/tickets/${e}`,{method:"PATCH",body:t})},300)}function et(e,t){R();let i=navigator.platform.includes("Mac")?"\u2318":"Ctrl+",a=$(e,q.map(r=>({label:r.label,key:r.key,shortcut:`${i}${r.key.toUpperCase()}`,color:k(r.value),active:t.category===r.value,action:async()=>{let o=await c(`/tickets/${t.id}`,{method:"PATCH",body:{category:r.value}});Object.assign(t,o),g()}})));document.body.appendChild(a),A(a,e),a.style.visibility=""}function Te(e,t){R();let s=$(e,G.map(i=>({label:i.label,key:i.key,shortcut:`Alt+${i.key}`,color:S(i.value),active:t.priority===i.value,action:async()=>{let a=await c(`/tickets/${t.id}`,{method:"PATCH",body:{priority:i.value}});Object.assign(t,a),g()}})));document.body.appendChild(s),A(s,e),s.style.visibility=""}function N(){document.querySelectorAll(".ticket-row[data-id]").forEach(e=>{let t=parseInt(e.dataset.id,10),s=e.querySelector(".ticket-checkbox");n.selectedIds.has(t)?(e.classList.add("selected"),s&&(s.checked=!0)):(e.classList.remove("selected"),s&&(s.checked=!1))})}function x(){let e=n.selectedIds.size,t=n.tickets.length,s=e>0,i=n.view==="trash",a=document.getElementById("batch-select-all");a.checked=t>0&&e===t,a.indeterminate=e>0&&e<t,document.getElementById("batch-count").textContent=s?`${e} selected`:"";let r=["batch-category","batch-priority","batch-status","batch-upnext","batch-delete"];for(let v of r){let w=document.getElementById(v);w.style.display=i?"none":"",i||(w.disabled=!s)}let o=document.getElementById("batch-restore"),d=document.getElementById("batch-empty-trash");if(i){let v=document.getElementById("batch-toolbar");o||(o=y(l("button",{id:"batch-restore",className:"btn btn-sm",children:"Restore"})),o.addEventListener("click",async()=>{await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"restore"}}),n.selectedIds.clear(),p()}),v.insertBefore(o,document.getElementById("batch-count"))),o.disabled=!s,o.style.display="",d||(d=y(l("button",{id:"batch-empty-trash",className:"btn btn-sm btn-danger",children:"Empty Trash"})),d.addEventListener("click",async()=>{await c("/trash/empty",{method:"POST"}),n.selectedIds.clear(),p()}),v.insertBefore(d,document.getElementById("batch-count"))),d.disabled=t===0,d.style.display=""}else o&&(o.style.display="none"),d&&(d.style.display="none");let m=document.querySelector(".batch-star-icon"),u=document.getElementById("batch-upnext");if(!i&&m&&s){let v=n.tickets.filter(f=>n.selectedIds.has(f.id)),w=v.every(f=>f.up_next),_=v.every(f=>!f.up_next);w?(m.textContent="\u2605",u.classList.add("active"),u.classList.remove("mixed")):_?(m.textContent="\u2606",u.classList.remove("active","mixed")):(m.innerHTML=l("span",{className:"star-mixed-wrap",children:[l("span",{className:"star-mixed-fill",children:"\u2605"}),"\u2606"]}).toString(),u.classList.remove("active"),u.classList.add("mixed"))}else m&&(m.textContent="\u2606",u.classList.remove("active","mixed"));C()}async function p(){if(n.backupPreview?.active){tt();return}let e=new URLSearchParams;n.view==="trash"?e.set("status","deleted"):n.view==="up-next"?e.set("up_next","true"):n.view==="open"?e.set("status","open"):n.view==="completed"?e.set("status","completed"):n.view==="non-verified"?e.set("status","non_verified"):n.view==="verified"?e.set("status","verified"):n.view.startsWith("category:")?e.set("category",n.view.split(":")[1]):n.view.startsWith("priority:")&&e.set("priority",n.view.split(":")[1]),n.search&&e.set("search",n.search),e.set("sort_by",n.sortBy),e.set("sort_dir",n.sortDir);let t=e.toString();n.tickets=await c(`/tickets${t?"?"+t:""}`),g()}function tt(){let e=[...n.backupPreview?.tickets||[]];if(n.view==="trash")e=e.filter(t=>t.status==="deleted");else if(n.view==="up-next")e=e.filter(t=>t.up_next&&t.status!=="deleted");else if(n.view==="open")e=e.filter(t=>t.status==="not_started"||t.status==="started");else if(n.view==="completed")e=e.filter(t=>t.status==="completed");else if(n.view==="non-verified")e=e.filter(t=>t.status!=="verified"&&t.status!=="deleted");else if(n.view==="verified")e=e.filter(t=>t.status==="verified");else if(n.view.startsWith("category:")){let t=n.view.split(":")[1];e=e.filter(s=>s.category===t&&s.status!=="deleted")}else if(n.view.startsWith("priority:")){let t=n.view.split(":")[1];e=e.filter(s=>s.priority===t&&s.status!=="deleted")}else e=e.filter(t=>t.status!=="deleted");if(n.search){let t=n.search.toLowerCase();e=e.filter(s=>s.title.toLowerCase().includes(t)||s.ticket_number.toLowerCase().includes(t)||s.details&&s.details.toLowerCase().includes(t))}n.tickets=e,g()}function nt(e){let t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function st(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function it(e){return e==="5min"?"Recent (every 5 min)":e==="hourly"?"Hourly":e==="daily"?"Daily":e}async function J(){var t;let e=document.getElementById("backup-list");if(e)try{let s=await c("/backups");if(s.backups.length===0){e.textContent="No backups yet. First backup will be created shortly.";return}let i={};for(let a of s.backups)(i[t=a.tier]||(i[t]=[])).push(a);e.innerHTML="";for(let a of["5min","hourly","daily"]){let r=i[a];if(!(!r||r.length===0)){e.appendChild(y(l("div",{className:"backup-tier-label",children:it(a)})));for(let o of r){let d=y(l("div",{className:"backup-row","data-tier":o.tier,"data-filename":o.filename,children:[l("span",{className:"backup-row-time",children:nt(o.createdAt)}),l("span",{className:"backup-row-meta",children:[new Date(o.createdAt).toLocaleString()," \xB7 ",st(o.sizeBytes)]})]}));d.addEventListener("click",()=>{at(o.tier,o.filename,o.createdAt)}),e.appendChild(d)}}}}catch{e.textContent="Failed to load backups."}}async function at(e,t,s){let i=document.getElementById("settings-overlay");i.style.display="none";let a=document.getElementById("backup-preview-banner"),r=document.getElementById("backup-preview-label");r.textContent="Loading backup preview...",a.style.display="flex";try{let o=await c(`/backups/preview/${e}/${t}`);n.backupPreview={active:!0,tickets:o.tickets,timestamp:s,tier:e,filename:t},n.selectedIds.clear(),n.activeTicketId=null,r.textContent=`Previewing backup from ${new Date(s).toLocaleString()} (${o.stats.total} tickets, ${o.stats.open} open) \u2014 read-only`,p()}catch{r.textContent="Failed to load backup preview.",setTimeout(()=>{a.style.display="none"},3e3)}}async function ot(){let e=document.getElementById("backup-preview-banner");e.style.display="none",n.backupPreview=null,n.selectedIds.clear(),n.activeTicketId=null,await c("/backups/preview/cleanup",{method:"POST"}),p()}async function lt(){if(!n.backupPreview)return;let e=document.getElementById("backup-restore-btn");e.textContent="Restoring...",e.disabled=!0;try{await c("/backups/restore",{method:"POST",body:{tier:n.backupPreview.tier,filename:n.backupPreview.filename}}),window.location.reload()}catch{e.textContent="Restore failed",e.disabled=!1,setTimeout(()=>{e.textContent="Restore This Backup"},3e3)}}function Ie(){document.getElementById("backup-cancel-btn")?.addEventListener("click",()=>{ot()}),document.getElementById("backup-restore-btn")?.addEventListener("click",()=>{lt()});let e=document.getElementById("backup-now-btn");e?.addEventListener("click",async()=>{e.textContent="Backing up...",e.disabled=!0;try{(await c("/backups/now",{method:"POST"})).error?e.textContent="In progress...":(e.textContent="Done!",J())}catch{e.textContent="Failed"}setTimeout(()=>{e.textContent="Backup Now",e.disabled=!1},1500)})}async function rt(){await dt(),ct(),await p(),bt(),gt(),vt(),kt(),Et(),Tt(),It(),St(),ut(),Ie(),yt(),ue(),xt(),mt(),document.addEventListener("hotsheet:render",()=>g()),b()}async function dt(){try{let e=await c("/settings");(e.detail_position==="side"||e.detail_position==="bottom")&&(n.settings.detail_position=e.detail_position),e.detail_width&&(n.settings.detail_width=parseInt(e.detail_width,10)||360),e.detail_height&&(n.settings.detail_height=parseInt(e.detail_height,10)||300),e.trash_cleanup_days&&(n.settings.trash_cleanup_days=parseInt(e.trash_cleanup_days,10)||3),e.verified_cleanup_days&&(n.settings.verified_cleanup_days=parseInt(e.verified_cleanup_days,10)||30),(e.layout==="list"||e.layout==="columns")&&(n.layout=e.layout)}catch{}V(n.settings.detail_position),z()}async function ct(){try{let e=await c("/file-settings");if(e.appName){document.title=e.appName;let t=document.querySelector(".app-title h1");t&&(t.textContent=e.appName)}}catch{}}function ut(){let e=document.getElementById("settings-overlay"),t=document.getElementById("settings-close");document.getElementById("settings-btn").addEventListener("click",()=>{document.getElementById("settings-trash-days").value=String(n.settings.trash_cleanup_days),document.getElementById("settings-verified-days").value=String(n.settings.verified_cleanup_days),e.style.display="flex",J(),c("/file-settings").then(f=>{document.getElementById("settings-app-name").value=f.appName||"",document.getElementById("settings-backup-dir").value=f.backupDir||""})}),t.addEventListener("click",()=>{e.style.display="none"}),e.addEventListener("click",f=>{f.target===e&&(e.style.display="none")});let i=document.getElementById("settings-trash-days"),a=null;i.addEventListener("input",()=>{a&&clearTimeout(a),a=setTimeout(()=>{let f=Math.max(1,parseInt(i.value,10)||3);i.value=String(f),n.settings.trash_cleanup_days=f,c("/settings",{method:"PATCH",body:{trash_cleanup_days:String(f)}})},500)});let r=document.getElementById("settings-verified-days"),o=null;r.addEventListener("input",()=>{o&&clearTimeout(o),o=setTimeout(()=>{let f=Math.max(1,parseInt(r.value,10)||30);r.value=String(f),n.settings.verified_cleanup_days=f,c("/settings",{method:"PATCH",body:{verified_cleanup_days:String(f)}})},500)});let d=document.getElementById("settings-app-name"),m=document.getElementById("settings-app-name-hint"),u=null;d.addEventListener("input",()=>{u&&clearTimeout(u),u=setTimeout(()=>{let f=d.value.trim();c("/file-settings",{method:"PATCH",body:{appName:f}}).then(()=>{let ee=f||"Hot Sheet";document.title=ee;let te=document.querySelector(".app-title h1");te&&(te.textContent=ee),m.textContent=f?"Saved. Restart the desktop app to update the title bar.":"Using default name."})},800)});let v=document.getElementById("settings-backup-dir"),w=document.getElementById("settings-backup-dir-hint"),_=null;v.addEventListener("input",()=>{_&&clearTimeout(_),_=setTimeout(()=>{let f=v.value.trim();c("/file-settings",{method:"PATCH",body:{backupDir:f}}).then(()=>{w.textContent=f?"Saved. New backups will use this location.":"Using default location inside the data directory."})},800)})}async function mt(){let e=window.__TAURI__;if(e?.core?.invoke)try{let t=await e.core.invoke("get_pending_update");t&&pt(t)}catch{}}function pt(e){let t=document.getElementById("update-banner");if(!t)return;let s=document.getElementById("update-banner-label");s&&(s.textContent=`Update available: v${e}`),t.style.display="flex";let i=document.getElementById("update-install-btn");i?.addEventListener("click",async()=>{if(i){i.textContent="Installing...",i.disabled=!0;try{await window.__TAURI__?.core?.invoke("install_update"),s&&(s.textContent="Update installed! Restart the app to apply."),i.style.display="none"}catch{i.textContent="Install Failed",i.disabled=!1}}}),document.getElementById("update-banner-dismiss")?.addEventListener("click",()=>{t.style.display="none"})}function ft(){let e=document.getElementById("skills-banner");if(!e)return;e.style.display="flex",document.getElementById("skills-banner-dismiss")?.addEventListener("click",()=>{e.style.display="none"})}function yt(){let e=document.getElementById("copy-prompt-section"),t=document.getElementById("copy-prompt-btn"),s=document.getElementById("copy-prompt-label"),i=document.getElementById("copy-prompt-icon"),a="";c("/worklist-info").then(r=>{a=r.prompt,e.style.display="",r.skillCreated&&ft()}),t.addEventListener("click",()=>{a!==""&&navigator.clipboard.writeText(a).then(()=>{s.textContent="Copied!",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5"/></svg>',setTimeout(()=>{s.textContent="Copy AI prompt",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>'},1500)})})}function Z(){let e=document.getElementById("layout-toggle"),t=O(),s=e.querySelector('[data-layout="columns"]');s.disabled=!t,s.style.opacity=t?"":"0.3";let i=n.layout==="columns"&&!t?"list":n.layout;e.querySelectorAll(".layout-btn").forEach(a=>{a.classList.toggle("active",a.dataset.layout===i)})}function gt(){document.getElementById("layout-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.addEventListener("click",()=>{let s=t.dataset.layout;s==="columns"&&!O()||(n.layout=s,Z(),g(),c("/settings",{method:"PATCH",body:{layout:s}}))})}),Z()}function we(){document.getElementById("detail-position-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.classList.toggle("active",t.dataset.position===n.settings.detail_position)})}function vt(){document.getElementById("detail-position-toggle").querySelectorAll(".layout-btn").forEach(t=>{t.addEventListener("click",()=>{let s=t.dataset.position;n.settings.detail_position=s,V(s),z(),we(),c("/settings",{method:"PATCH",body:{detail_position:s}})})}),we()}function Le(e){return e==="up-next"?{action:"up_next",value:!0}:e==="open"?{action:"status",value:"not_started"}:e==="completed"?{action:"status",value:"completed"}:e==="verified"?{action:"status",value:"verified"}:e==="trash"?{action:"delete",value:null}:e.startsWith("category:")?{action:"category",value:e.split(":")[1]}:e.startsWith("priority:")?{action:"priority",value:e.split(":")[1]}:null}async function ht(e,t){let s=Le(e);s&&(s.action==="delete"?await c("/tickets/batch",{method:"POST",body:{ids:t,action:"delete"}}):await c("/tickets/batch",{method:"POST",body:{ids:t,action:s.action,value:s.value}}),p())}function bt(){let e=document.querySelectorAll(".sidebar-item[data-view]");e.forEach(t=>{t.addEventListener("click",()=>{e.forEach(i=>{i.classList.remove("active")}),t.classList.add("active"),n.view=t.dataset.view,n.selectedIds.clear(),Z(),p()});let s=t.dataset.view;Le(s)&&(t.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t.classList.add("drop-target")}),t.addEventListener("dragleave",()=>{t.classList.remove("drop-target")}),t.addEventListener("drop",i=>{i.preventDefault(),t.classList.remove("drop-target");let a=[...h];a.length!==0&&ht(s,a)}))})}function kt(){let e=document.getElementById("sort-select");e.addEventListener("change",()=>{let[t,s]=e.value.split(":");n.sortBy=t,n.sortDir=s,p()})}var Y=null;function Et(){let e=document.getElementById("search-input");e.addEventListener("input",()=>{Y&&clearTimeout(Y),Y=setTimeout(()=>{n.search=e.value,p()},200)}),e.addEventListener("keydown",t=>{t.key==="Escape"&&(e.value="",n.search="",p())})}function Tt(){let e=document.getElementById("batch-category");e.addEventListener("change",async()=>{e.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"category",value:e.value}}),e.value="",p())});let t=document.getElementById("batch-priority");t.addEventListener("change",async()=>{t.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"priority",value:t.value}}),t.value="",p())});let s=document.getElementById("batch-status");s.addEventListener("change",async()=>{s.value&&(await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"status",value:s.value}}),s.value="",p())}),document.getElementById("batch-upnext").addEventListener("click",async()=>{let i=n.tickets.filter(o=>n.selectedIds.has(o.id)),r=!i.every(o=>o.up_next);if(r){let o=i.filter(d=>d.status==="completed"||d.status==="verified");o.length>0&&await c("/tickets/batch",{method:"POST",body:{ids:o.map(d=>d.id),action:"status",value:"not_started"}})}await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:r}}),p()}),document.getElementById("batch-delete").addEventListener("click",async()=>{await c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"delete"}}),n.selectedIds.clear(),p()}),document.getElementById("batch-select-all").addEventListener("change",i=>{if(i.target.checked)for(let r of n.tickets)n.selectedIds.add(r.id);else n.selectedIds.clear();g()})}var X=null;function It(){document.getElementById("detail-close").addEventListener("click",le);let e=["detail-title","detail-details"];for(let s of e){let i=document.getElementById(s);i.addEventListener("input",()=>{X&&clearTimeout(X),X=setTimeout(()=>{if(n.activeTicketId==null)return;let a=s.replace("detail-","");c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{[a]:i.value}}).then(()=>{p()})},300)})}let t=["detail-category","detail-priority","detail-status"];for(let s of t){let i=document.getElementById(s);i.addEventListener("change",async()=>{if(n.activeTicketId==null)return;let a=s.replace("detail-","");await c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{[a]:i.value}}),p()})}document.getElementById("detail-upnext").addEventListener("change",async()=>{if(n.activeTicketId==null)return;let s=n.tickets.find(a=>a.id===n.activeTicketId);document.getElementById("detail-upnext").checked&&s&&(s.status==="completed"||s.status==="verified")?await c(`/tickets/${n.activeTicketId}`,{method:"PATCH",body:{status:"not_started",up_next:!0}}):await c(`/tickets/${n.activeTicketId}/up-next`,{method:"POST"}),p(),P(n.activeTicketId)}),document.getElementById("detail-file-input").addEventListener("change",async s=>{let i=s.target,a=i.files?.[0];!a||n.activeTicketId==null||(await oe(`/tickets/${n.activeTicketId}/attachments`,a),i.value="",P(n.activeTicketId),p())}),document.getElementById("detail-attachments").addEventListener("click",async s=>{let i=s.target,a=i.closest(".attachment-reveal");if(a){let d=a.dataset.attId;d&&c(`/attachments/${d}/reveal`,{method:"POST"});return}let r=i.closest(".attachment-delete");if(r===null)return;let o=r.dataset.attId;o===void 0||o===""||(await c(`/attachments/${o}`,{method:"DELETE"}),n.activeTicketId!=null&&P(n.activeTicketId))})}function wt(e){if(!e||e==="")return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.trim()?[{text:e,created_at:""}]:[]}function Lt(e){let t=[];t.push(`${e.ticket_number}: ${e.title}`),e.details.trim()&&(t.push(""),t.push(e.details.trim()));let s=wt(e.notes);if(s.length>0){t.push("");for(let i of s)t.push(`- ${i.text}`)}return t.join(`
2
+ `)}function St(){document.addEventListener("keydown",e=>{let t=e.target.tagName,s=t==="INPUT"||t==="TEXTAREA"||t==="SELECT",i=document.getElementById("settings-overlay");if(e.key==="Escape"&&i.style.display!=="none"){i.style.display="none";return}if(e.key==="Escape"){n.selectedIds.size>0&&(n.selectedIds.clear(),g());return}if((e.metaKey||e.ctrlKey)&&e.key==="a"&&!s){e.preventDefault(),n.selectedIds.clear();for(let a of n.tickets)n.selectedIds.add(a.id);g();return}if((e.metaKey||e.ctrlKey)&&e.key==="d"){if(n.selectedIds.size>0){e.preventDefault();let a=n.tickets.filter(d=>n.selectedIds.has(d.id)),o=!a.every(d=>d.up_next);if(o){let d=a.filter(m=>m.status==="completed"||m.status==="verified");if(d.length>0){c("/tickets/batch",{method:"POST",body:{ids:d.map(m=>m.id),action:"status",value:"not_started"}}).then(()=>c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:!0}})).then(()=>{p()});return}}c("/tickets/batch",{method:"POST",body:{ids:Array.from(n.selectedIds),action:"up_next",value:o}}).then(()=>{p()})}return}if((e.metaKey||e.ctrlKey)&&e.key==="c"&&n.selectedIds.size>0&&!(s&&!e.altKey)){let a=!e.altKey&&window.getSelection();if(!(a&&!a.isCollapsed&&a.toString().trim()!=="")){e.preventDefault();let o=n.tickets.filter(d=>n.selectedIds.has(d.id)).map(Lt).join(`
3
3
 
4
- `);navigator.clipboard.writeText(r);return}}if((e.metaKey||e.ctrlKey)&&e.key==="n"){e.preventDefault(),h();return}if((e.metaKey||e.ctrlKey)&&e.key==="f"){e.preventDefault(),document.getElementById("search-input").focus();return}if(e.key==="n"&&!s){e.preventDefault(),h();return}})}var X=0;function kt(){async function e(){try{let t=await c(`/poll?version=${X}`);t.version>X&&(X=t.version,n.backupPreview?.active||f())}catch{await new Promise(t=>setTimeout(t,5e3))}setTimeout(e,100)}e()}it();})();
4
+ `);navigator.clipboard.writeText(o);return}}if((e.metaKey||e.ctrlKey)&&e.key==="n"){e.preventDefault(),b();return}if((e.metaKey||e.ctrlKey)&&e.key==="f"){e.preventDefault(),document.getElementById("search-input").focus();return}if(e.key==="n"&&!s){e.preventDefault(),b();return}})}var Q=0;function xt(){async function e(){try{let t=await c(`/poll?version=${Q}`);t.version>Q&&(Q=t.version,n.backupPreview?.active||p())}catch{await new Promise(t=>setTimeout(t,5e3))}setTimeout(e,100)}e()}rt();})();
@@ -1 +1 @@
1
- *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}:root{--bg: #ffffff;--bg-secondary: #f9fafb;--bg-hover: #f3f4f6;--bg-selected: #eff6ff;--border: #e5e7eb;--text: #111827;--text-secondary: #6b7280;--text-muted: #9ca3af;--accent: #3b82f6;--accent-hover: #2563eb;--danger: #ef4444;--star: #eab308;--radius: 6px;--shadow: 0 1px 3px rgba(0,0,0,0.08)}html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.5;color:var(--text);background:var(--bg)}button{cursor:pointer;border:none;background:none;font:inherit;color:inherit}input,select,textarea{font:inherit;color:inherit}.app{display:flex;flex-direction:column;height:100vh}.app-header{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--bg);gap:16px;flex-shrink:0}.app-header h1{font-size:18px;font-weight:700;white-space:nowrap}.header-controls{display:flex;align-items:center;gap:12px;flex:1;max-width:500px}.search-box{flex:1}.search-box input{width:100%;padding:6px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary);outline:none}.search-box input:focus{border-color:var(--accent);background:var(--bg)}.layout-toggle{display:flex;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;flex-shrink:0}.layout-btn{display:flex;align-items:center;justify-content:center;padding:4px 8px;color:var(--text-secondary);background:var(--bg);border:none;border-right:1px solid var(--border);cursor:pointer}.layout-btn:last-child{border-right:none}.layout-btn:hover:not(:disabled){background:var(--bg-hover);color:var(--text)}.layout-btn.active{background:var(--bg-selected);color:var(--accent)}.layout-btn:disabled{cursor:default}.sort-controls select{padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);cursor:pointer}.settings-btn{font-size:18px;color:var(--text-muted);padding:4px;border-radius:var(--radius);flex-shrink:0}.settings-btn:hover{color:var(--text);background:var(--bg-hover)}.app-body{display:flex;flex:1;overflow:hidden}.content-area{flex:1;display:flex;overflow:hidden;min-width:0}.content-area.detail-side{flex-direction:row}.content-area.detail-bottom{flex-direction:column}.sidebar{width:180px;border-right:1px solid var(--border);background:var(--bg-secondary);overflow-y:auto;flex-shrink:0;padding:8px 0}.sidebar-copy-prompt{padding:8px 10px 4px}.copy-prompt-btn{display:flex;align-items:center;gap:6px;width:100%;padding:6px 8px;font-size:12px;color:var(--text-secondary);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all .15s}.copy-prompt-btn:hover{color:var(--accent);border-color:var(--accent);background:var(--bg-selected)}.copy-prompt-icon{display:flex;align-items:center;flex-shrink:0}.sidebar-section{margin-bottom:8px}.sidebar-label{padding:8px 16px 4px;font-size:11px;font-weight:600;text-transform:uppercase;color:var(--text-muted);letter-spacing:.5px}.sidebar-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 16px;text-align:left;font-size:13px;color:var(--text-secondary);border-radius:0}.sidebar-item:hover{background:var(--bg-hover);color:var(--text)}.sidebar-item.active{background:var(--bg-selected);color:var(--accent);font-weight:500}.sidebar-item.drop-target{background:var(--bg-selected);color:var(--accent);outline:2px dashed var(--accent);outline-offset:-2px}.cat-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}.sidebar-stats{padding:12px 16px;font-size:12px;color:var(--text-muted);border-top:1px solid var(--border);margin-top:8px}.main-content{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0}.batch-toolbar{display:flex;align-items:center;gap:8px;padding:6px 16px 6px 19px;background:var(--bg-secondary);border-bottom:1px solid var(--border);flex-shrink:0;flex-wrap:wrap;min-height:36px}.batch-toolbar select:disabled,.batch-toolbar .btn:disabled{opacity:.4;cursor:default;pointer-events:none}.batch-toolbar select{padding:4px 8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:12px}.batch-select-all{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}.batch-star-btn{font-size:16px;color:var(--text-muted);padding:2px 6px;border-radius:var(--radius);line-height:1}.batch-star-btn:hover:not(:disabled){color:var(--star);background:var(--bg-hover)}.batch-star-btn.active{color:var(--star)}.batch-star-btn.mixed{color:var(--star)}.batch-star-btn:disabled{opacity:.4;cursor:default;pointer-events:none}.star-mixed-wrap{position:relative;display:inline-block}.star-mixed-fill{position:absolute;left:0;top:0;overflow:hidden;width:50%}.batch-delete-btn.btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 6px;border:none;background:none}.batch-count{font-size:12px;color:var(--text-muted);margin-left:auto;white-space:nowrap}.btn{padding:4px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:12px;cursor:pointer}.btn:hover{background:var(--bg-hover)}.btn-sm{padding:3px 8px;font-size:11px}.btn-danger{color:var(--danger)}.btn-danger:hover:not(:disabled){background:#fef2f2}.ticket-list{flex:1;overflow-y:auto;padding:4px 0}.ticket-list-empty,.ticket-list-loading{padding:40px 20px;text-align:center;color:var(--text-muted);font-size:14px}.ticket-row{display:flex;align-items:center;gap:8px;padding:4px 16px;border-bottom:1px solid rgba(0,0,0,0);border-left:3px solid rgba(0,0,0,0);min-height:36px}.ticket-row:hover{background:var(--bg-hover)}.ticket-row.selected{background:var(--bg-selected)}.ticket-row.completed .ticket-title-input{text-decoration:line-through;color:var(--text-muted)}.ticket-row.up-next{border-left:3px solid var(--star)}.ticket-checkbox{flex-shrink:0;width:14px;height:14px;cursor:pointer;accent-color:var(--accent)}.ticket-status-btn{flex-shrink:0;width:20px;height:20px;font-size:14px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--text-secondary)}.ticket-status-btn:hover{background:var(--bg-hover)}.ticket-status-btn.verified{color:#22c55e}.ticket-category-badge{flex-shrink:0;width:4em;padding:1px 0;border-radius:3px;font-size:10px;font-weight:600;color:#fff;text-transform:uppercase;text-align:center;cursor:pointer;letter-spacing:.3px}.ticket-category-badge:hover{opacity:.85}.ticket-number{flex-shrink:0;font-size:11px;color:var(--text-muted);font-family:"SF Mono",Monaco,"Cascadia Code",monospace;min-width:5em}.ticket-title-input{flex:1;border:none;background:rgba(0,0,0,0);padding:2px 0;outline:none;min-width:0}.ticket-title-input:focus{border-bottom:1px solid var(--accent)}.ticket-title-input::placeholder{color:var(--text-muted)}.ticket-priority-indicator{flex-shrink:0;font-size:12px;cursor:pointer;padding:2px 4px;border-radius:3px;min-width:24px;text-align:center}.ticket-priority-indicator:hover{background:var(--bg-hover)}.ticket-star{flex-shrink:0;font-size:16px;color:var(--text-muted);padding:0}.ticket-star.active{color:var(--star)}.ticket-star:hover{color:var(--star)}.trash-row .trash-title{flex:1;color:var(--text-muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trash-row .btn{flex-shrink:0}.draft-row{border-bottom:1px dashed var(--border) !important;background:var(--bg-secondary)}.draft-row:hover{background:var(--bg-secondary)}.draft-row .draft-placeholder{opacity:.35;pointer-events:none}.draft-row .draft-badge{opacity:.35}.draft-row .draft-input::placeholder{color:var(--text-muted);font-style:italic}.ticket-checkbox-spacer{width:14px;flex-shrink:0}.detail-resize-handle{flex-shrink:0;background:rgba(0,0,0,0);position:relative;z-index:10}.detail-resize-handle:hover,.detail-resize-handle:active{background:var(--accent);opacity:.3}.detail-side .detail-resize-handle{width:4px;cursor:col-resize}.detail-bottom .detail-resize-handle{height:4px;cursor:row-resize}.detail-panel{border-left:1px solid var(--border);background:var(--bg);flex-shrink:0;display:flex;flex-direction:column;overflow:hidden}.detail-side .detail-panel{width:360px;border-left:1px solid var(--border);border-top:none}.detail-bottom .detail-panel{height:300px;width:auto;border-left:none;border-top:1px solid var(--border)}.detail-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);font-weight:600}.detail-ticket-number{font-family:"SF Mono",Monaco,"Cascadia Code",monospace;font-size:13px;color:var(--accent)}.detail-close{font-size:20px;color:var(--text-muted);padding:0 4px}.detail-close:hover{color:var(--text)}.detail-body{flex:1;overflow-y:auto;padding:16px}.detail-fields-row{display:contents}.detail-bottom .detail-body{display:flex;flex-wrap:wrap;gap:0 16px;align-content:flex-start}.detail-bottom .detail-body .detail-fields-row{display:flex;gap:16px;width:100%}.detail-bottom .detail-body .detail-fields-row .detail-field{flex:1;min-width:0}.detail-bottom .detail-body .detail-field-full{width:100%;flex-basis:100%}.detail-field{margin-bottom:16px}.detail-field label{display:block;font-size:12px;font-weight:500;color:var(--text-secondary);margin-bottom:4px}.detail-field input[type=text],.detail-field textarea,.detail-field select{width:100%;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);outline:none}.detail-field input[type=text]:focus,.detail-field textarea:focus,.detail-field select:focus{border-color:var(--accent)}.detail-field textarea{resize:vertical;min-height:80px}.detail-upnext-label{display:flex !important;align-items:center;gap:8px;cursor:pointer;font-size:14px !important;font-weight:400 !important;color:var(--text) !important}.detail-upnext-label input[type=checkbox]{width:auto;accent-color:var(--star)}.detail-attachments{margin-bottom:8px}.attachment-item{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:var(--bg-secondary);border-radius:var(--radius);margin-bottom:4px;font-size:12px}.attachment-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-delete{color:var(--text-muted);font-size:16px;padding:0 4px;cursor:pointer;border:none;background:none}.attachment-delete:hover{color:var(--danger)}.upload-btn{cursor:pointer;display:inline-flex;align-items:center;gap:4px;margin-top:4px}.detail-meta{padding-top:12px;border-top:1px solid var(--border);font-size:11px;color:var(--text-muted)}.detail-meta div{margin-bottom:2px}.dropdown-menu{position:fixed;z-index:1000;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:4px 0;min-width:140px}.dropdown-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 12px;text-align:left;font-size:13px;text-transform:capitalize}.dropdown-item:hover{background:var(--bg-hover)}.dropdown-item.active{color:var(--accent);font-weight:500}.dropdown-label{flex:1}.dropdown-kbd{font-size:11px;color:var(--text-muted);padding:1px 5px;border:1px solid var(--border);border-radius:3px;background:var(--bg-secondary);font-family:inherit;flex-shrink:0}.dropdown-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}.settings-overlay{position:fixed;inset:0;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;z-index:2000}.settings-dialog{background:var(--bg);border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,.15);width:480px;max-width:90vw;max-height:85vh;overflow-y:auto}.settings-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}.settings-header h2{font-size:16px;font-weight:600}.settings-body{padding:20px}.settings-field{margin-bottom:16px}.settings-field:last-child{margin-bottom:0}.settings-field label{display:block;font-size:13px;font-weight:500;color:var(--text-secondary);margin-bottom:6px}.settings-field select,.settings-field input[type=number],.settings-field input[type=text]{width:100%;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);outline:none}.settings-field select:focus,.settings-field input[type=number]:focus,.settings-field input[type=text]:focus{border-color:var(--accent)}.settings-hint{display:block;font-size:11px;color:var(--text-secondary);margin-top:4px}.skills-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;background:#dbeafe;border-bottom:2px solid #3b82f6;font-size:13px;color:#1e3a5f;flex-shrink:0}@media(prefers-color-scheme: dark){.skills-banner{background:#1e293b;border-bottom-color:#3b82f6;color:#93c5fd}}.backup-preview-banner{display:flex;align-items:center;justify-content:space-between;padding:8px 20px;background:#fef3c7;border-bottom:2px solid #f59e0b;font-size:13px;font-weight:500;color:#92400e;flex-shrink:0}@media(prefers-color-scheme: dark){.backup-preview-banner{background:#451a03;border-bottom-color:#d97706;color:#fbbf24}}.backup-preview-actions{display:flex;gap:8px;flex-shrink:0}.settings-section{margin-top:20px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{font-size:14px;font-weight:600;margin-bottom:12px}.settings-section-header{display:flex;align-items:center;justify-content:space-between}.settings-section-header h3{margin-bottom:0}.settings-section-header{margin-bottom:12px}.backup-list{max-height:300px;overflow-y:auto;font-size:13px;color:var(--text-muted)}.backup-tier-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;padding:8px 0 4px;border-bottom:1px solid var(--border);margin-bottom:2px}.backup-tier-label:first-child{padding-top:0}.backup-row{display:flex;align-items:center;justify-content:space-between;padding:5px 8px;border-radius:var(--radius);cursor:pointer}.backup-row:hover{background:var(--bg-hover)}.backup-row-time{color:var(--text);font-weight:500}.backup-row-meta{font-size:11px;color:var(--text-muted)}.app-footer{display:flex;align-items:center;justify-content:space-between;padding:6px 20px;border-top:1px solid var(--border);background:var(--bg-secondary);font-size:12px;color:var(--text-muted);flex-shrink:0}.keyboard-hints{display:flex;gap:16px}.keyboard-hints kbd{display:inline-block;padding:1px 5px;border:1px solid var(--border);border-radius:3px;background:var(--bg);font-family:inherit;font-size:11px}.status-bar{font-size:12px}.ticket-list-columns{display:flex;flex-direction:column;overflow:hidden}.ticket-list-columns .draft-row{flex-shrink:0}.columns-container{display:flex;flex:1;gap:1px;background:var(--border);overflow-x:auto;min-height:0}.column{flex:1;min-width:180px;display:flex;flex-direction:column;background:var(--bg-secondary);overflow:hidden}.column.column-drop-target{background:var(--bg-selected)}.column.column-drop-target .column-body{outline:2px dashed var(--accent);outline-offset:-2px}.column-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:12px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.3px;border-bottom:1px solid var(--border);background:var(--bg);flex-shrink:0}.column-count{font-size:11px;font-weight:500;color:var(--text-muted);background:var(--bg-secondary);padding:1px 6px;border-radius:10px}.column-body{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:6px}.column-card{padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);cursor:grab;box-shadow:var(--shadow)}.column-card:hover{border-color:var(--accent)}.column-card.selected{border-color:var(--accent);background:var(--bg-selected)}.column-card.up-next{border-left:3px solid var(--star)}.column-card:active{cursor:grabbing}.column-card-header{display:flex;align-items:center;gap:6px;margin-bottom:4px}.column-card-title{font-size:13px;line-height:1.4;word-break:break-word}@media(max-width: 768px){.sidebar{width:140px}.detail-side .detail-panel{width:280px}.keyboard-hints{display:none}}@media(max-width: 600px){.sidebar{display:none}}.error-popup{position:fixed;inset:0;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;z-index:3000}.error-popup-content{background:var(--bg);border:1px solid var(--danger);border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,.15);padding:24px;max-width:360px;text-align:center}.error-popup-content strong{display:block;font-size:16px;margin-bottom:8px;color:var(--danger)}.error-popup-content p{font-size:14px;color:var(--text-secondary);margin-bottom:16px}.error-popup-content button{padding:6px 16px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:13px;cursor:pointer}.error-popup-content button:hover{background:var(--bg-hover)}.detail-notes{display:flex;flex-direction:column;gap:8px}.note-entry{padding:8px 10px;background:var(--bg-secondary);border-radius:var(--radius);border-left:3px solid var(--accent)}.note-timestamp{font-size:11px;color:var(--text-muted);margin-bottom:2px}.note-text{font-size:13px;color:var(--text);white-space:pre-wrap}
1
+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}:root{--bg: #ffffff;--bg-secondary: #f9fafb;--bg-hover: #f3f4f6;--bg-selected: #eff6ff;--border: #e5e7eb;--text: #111827;--text-secondary: #6b7280;--text-muted: #9ca3af;--accent: #3b82f6;--accent-hover: #2563eb;--danger: #ef4444;--star: #eab308;--radius: 6px;--shadow: 0 1px 3px rgba(0,0,0,0.08)}html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.5;color:var(--text);background:var(--bg)}button{cursor:pointer;border:none;background:none;font:inherit;color:inherit}input,select,textarea{font:inherit;color:inherit}.app{display:flex;flex-direction:column;height:100vh}.app-header{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--bg);gap:16px;flex-shrink:0}.app-header h1{font-size:18px;font-weight:700;white-space:nowrap}.header-controls{display:flex;align-items:center;gap:12px;flex:1;max-width:500px}.search-box{flex:1}.search-box input{width:100%;padding:6px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary);outline:none}.search-box input:focus{border-color:var(--accent);background:var(--bg)}.layout-toggle{display:flex;border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;flex-shrink:0}.layout-btn{display:flex;align-items:center;justify-content:center;padding:4px 8px;color:var(--text-secondary);background:var(--bg);border:none;border-right:1px solid var(--border);cursor:pointer}.layout-btn:last-child{border-right:none}.layout-btn:hover:not(:disabled){background:var(--bg-hover);color:var(--text)}.layout-btn.active{background:var(--bg-selected);color:var(--accent)}.layout-btn:disabled{cursor:default}.sort-controls select{padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);cursor:pointer}.settings-btn{font-size:18px;color:var(--text-muted);padding:4px;border-radius:var(--radius);flex-shrink:0}.settings-btn:hover{color:var(--text);background:var(--bg-hover)}.app-body{display:flex;flex:1;overflow:hidden}.content-area{flex:1;display:flex;overflow:hidden;min-width:0}.content-area.detail-side{flex-direction:row}.content-area.detail-bottom{flex-direction:column}.sidebar{width:180px;border-right:1px solid var(--border);background:var(--bg-secondary);overflow-y:auto;flex-shrink:0;padding:8px 0}.sidebar-copy-prompt{padding:8px 10px 4px}.copy-prompt-btn{display:flex;align-items:center;gap:6px;width:100%;padding:6px 8px;font-size:12px;color:var(--text-secondary);background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all .15s}.copy-prompt-btn:hover{color:var(--accent);border-color:var(--accent);background:var(--bg-selected)}.copy-prompt-icon{display:flex;align-items:center;flex-shrink:0}.sidebar-section{margin-bottom:8px}.sidebar-label{padding:8px 16px 4px;font-size:11px;font-weight:600;text-transform:uppercase;color:var(--text-muted);letter-spacing:.5px}.sidebar-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 16px;text-align:left;font-size:13px;color:var(--text-secondary);border-radius:0}.sidebar-item:hover{background:var(--bg-hover);color:var(--text)}.sidebar-item.active{background:var(--bg-selected);color:var(--accent);font-weight:500}.sidebar-item.drop-target{background:var(--bg-selected);color:var(--accent);outline:2px dashed var(--accent);outline-offset:-2px}.cat-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}.sidebar-stats{padding:12px 16px;font-size:12px;color:var(--text-muted);border-top:1px solid var(--border);margin-top:8px}.main-content{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0}.batch-toolbar{display:flex;align-items:center;gap:8px;padding:6px 16px 6px 19px;background:var(--bg-secondary);border-bottom:1px solid var(--border);flex-shrink:0;flex-wrap:wrap;min-height:36px}.batch-toolbar select:disabled,.batch-toolbar .btn:disabled{opacity:.4;cursor:default;pointer-events:none}.batch-toolbar select{padding:4px 8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:12px}.batch-select-all{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}.batch-star-btn{font-size:16px;color:var(--text-muted);padding:2px 6px;border-radius:var(--radius);line-height:1}.batch-star-btn:hover:not(:disabled){color:var(--star);background:var(--bg-hover)}.batch-star-btn.active{color:var(--star)}.batch-star-btn.mixed{color:var(--star)}.batch-star-btn:disabled{opacity:.4;cursor:default;pointer-events:none}.star-mixed-wrap{position:relative;display:inline-block}.star-mixed-fill{position:absolute;left:0;top:0;overflow:hidden;width:50%}.batch-delete-btn.btn{display:inline-flex;align-items:center;justify-content:center;padding:4px 6px;border:none;background:none}.batch-count{font-size:12px;color:var(--text-muted);margin-left:auto;white-space:nowrap}.btn{padding:4px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:12px;cursor:pointer}.btn:hover{background:var(--bg-hover)}.btn-sm{padding:3px 8px;font-size:11px}.btn-danger{color:var(--danger)}.btn-danger:hover:not(:disabled){background:#fef2f2}.ticket-list{flex:1;overflow-y:auto;padding:4px 0}.ticket-list-empty,.ticket-list-loading{padding:40px 20px;text-align:center;color:var(--text-muted);font-size:14px}.ticket-row{display:flex;align-items:center;gap:8px;padding:4px 16px;border-bottom:1px solid rgba(0,0,0,0);border-left:3px solid rgba(0,0,0,0);min-height:36px}.ticket-row:hover{background:var(--bg-hover)}.ticket-row.selected{background:var(--bg-selected)}.ticket-row.completed .ticket-title-input{text-decoration:line-through;color:var(--text-muted)}.ticket-row.up-next{border-left:3px solid var(--star)}.ticket-checkbox{flex-shrink:0;width:14px;height:14px;cursor:pointer;accent-color:var(--accent)}.ticket-status-btn{flex-shrink:0;width:20px;height:20px;font-size:14px;display:flex;align-items:center;justify-content:center;border-radius:50%;color:var(--text-secondary)}.ticket-status-btn:hover{background:var(--bg-hover)}.ticket-status-btn.verified{color:#22c55e}.ticket-category-badge{flex-shrink:0;width:4em;padding:1px 0;border-radius:3px;font-size:10px;font-weight:600;color:#fff;text-transform:uppercase;text-align:center;cursor:pointer;letter-spacing:.3px}.ticket-category-badge:hover{opacity:.85}.ticket-number{flex-shrink:0;font-size:11px;color:var(--text-muted);font-family:"SF Mono",Monaco,"Cascadia Code",monospace;min-width:5em}.ticket-title-input{flex:1;border:none;background:rgba(0,0,0,0);padding:2px 0;outline:none;min-width:0}.ticket-title-input:focus{border-bottom:1px solid var(--accent)}.ticket-title-input::placeholder{color:var(--text-muted)}.ticket-priority-indicator{flex-shrink:0;font-size:12px;cursor:pointer;padding:2px 4px;border-radius:3px;min-width:24px;text-align:center}.ticket-priority-indicator:hover{background:var(--bg-hover)}.ticket-star{flex-shrink:0;font-size:16px;color:var(--text-muted);padding:0}.ticket-star.active{color:var(--star)}.ticket-star:hover{color:var(--star)}.trash-row .trash-title{flex:1;color:var(--text-muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trash-row .btn{flex-shrink:0}.draft-row{border-bottom:1px dashed var(--border) !important;background:var(--bg-secondary)}.draft-row:hover{background:var(--bg-secondary)}.draft-row .draft-placeholder{opacity:.35;pointer-events:none}.draft-row .draft-badge{opacity:.35}.draft-row .draft-input::placeholder{color:var(--text-muted);font-style:italic}.ticket-checkbox-spacer{width:14px;flex-shrink:0}.detail-resize-handle{flex-shrink:0;background:rgba(0,0,0,0);position:relative;z-index:10}.detail-resize-handle:hover,.detail-resize-handle:active{background:var(--accent);opacity:.3}.detail-side .detail-resize-handle{width:4px;cursor:col-resize}.detail-bottom .detail-resize-handle{height:4px;cursor:row-resize}.detail-panel{border-left:1px solid var(--border);background:var(--bg);flex-shrink:0;display:flex;flex-direction:column;overflow:hidden}.detail-side .detail-panel{width:360px;border-left:1px solid var(--border);border-top:none}.detail-bottom .detail-panel{height:300px;width:auto;border-left:none;border-top:1px solid var(--border)}.detail-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);font-weight:600}.detail-ticket-number{font-family:"SF Mono",Monaco,"Cascadia Code",monospace;font-size:13px;color:var(--accent)}.detail-close{font-size:20px;color:var(--text-muted);padding:0 4px}.detail-close:hover{color:var(--text)}.detail-body{flex:1;overflow-y:auto;padding:16px}.detail-fields-row{display:contents}.detail-bottom .detail-body{display:flex;flex-wrap:wrap;gap:0 16px;align-content:flex-start}.detail-bottom .detail-body .detail-fields-row{display:flex;gap:16px;width:100%}.detail-bottom .detail-body .detail-fields-row .detail-field{flex:1;min-width:0}.detail-bottom .detail-body .detail-field-full{width:100%;flex-basis:100%}.detail-field{margin-bottom:16px}.detail-field label{display:block;font-size:12px;font-weight:500;color:var(--text-secondary);margin-bottom:4px}.detail-field input[type=text],.detail-field textarea,.detail-field select{width:100%;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);outline:none}.detail-field input[type=text]:focus,.detail-field textarea:focus,.detail-field select:focus{border-color:var(--accent)}.detail-field textarea{resize:vertical;min-height:80px}.detail-upnext-label{display:flex !important;align-items:center;gap:8px;cursor:pointer;font-size:14px !important;font-weight:400 !important;color:var(--text) !important}.detail-upnext-label input[type=checkbox]{width:auto;accent-color:var(--star)}.detail-attachments{margin-bottom:8px}.attachment-item{display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:var(--bg-secondary);border-radius:var(--radius);margin-bottom:4px;font-size:12px}.attachment-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-reveal{color:var(--text-muted);padding:0 4px;cursor:pointer;border:none;background:none;display:flex;align-items:center}.attachment-reveal:hover{color:var(--accent)}.attachment-delete{color:var(--text-muted);font-size:16px;padding:0 4px;cursor:pointer;border:none;background:none}.attachment-delete:hover{color:var(--danger)}.upload-btn{cursor:pointer;display:inline-flex;align-items:center;gap:4px;margin-top:4px}.detail-meta{padding-top:12px;border-top:1px solid var(--border);font-size:11px;color:var(--text-muted)}.detail-meta div{margin-bottom:2px}.dropdown-menu{position:fixed;z-index:1000;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:4px 0;min-width:140px}.dropdown-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 12px;text-align:left;font-size:13px;text-transform:capitalize}.dropdown-item:hover{background:var(--bg-hover)}.dropdown-item.active{color:var(--accent);font-weight:500}.dropdown-label{flex:1}.dropdown-kbd{font-size:11px;color:var(--text-muted);padding:1px 5px;border:1px solid var(--border);border-radius:3px;background:var(--bg-secondary);font-family:inherit;flex-shrink:0}.dropdown-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}.settings-overlay{position:fixed;inset:0;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;z-index:2000}.settings-dialog{background:var(--bg);border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,.15);width:480px;max-width:90vw;max-height:85vh;overflow-y:auto}.settings-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}.settings-header h2{font-size:16px;font-weight:600}.settings-body{padding:20px}.settings-field{margin-bottom:16px}.settings-field:last-child{margin-bottom:0}.settings-field label{display:block;font-size:13px;font-weight:500;color:var(--text-secondary);margin-bottom:6px}.settings-field select,.settings-field input[type=number],.settings-field input[type=text]{width:100%;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);outline:none}.settings-field select:focus,.settings-field input[type=number]:focus,.settings-field input[type=text]:focus{border-color:var(--accent)}.settings-hint{display:block;font-size:11px;color:var(--text-secondary);margin-top:4px}.skills-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;background:#dbeafe;border-bottom:2px solid #3b82f6;font-size:13px;color:#1e3a5f;flex-shrink:0}@media(prefers-color-scheme: dark){.skills-banner{background:#1e293b;border-bottom-color:#3b82f6;color:#93c5fd}}.update-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 20px;background:#dcfce7;border-bottom:2px solid #22c55e;font-size:13px;color:#166534;flex-shrink:0}@media(prefers-color-scheme: dark){.update-banner{background:#14532d;border-bottom-color:#22c55e;color:#86efac}}.update-banner-actions{display:flex;gap:8px;flex-shrink:0}.btn-accent{color:#fff;background:#22c55e;border-color:#22c55e}.btn-accent:hover:not(:disabled){background:#16a34a}.btn-accent:disabled{opacity:.7;cursor:default}.backup-preview-banner{display:flex;align-items:center;justify-content:space-between;padding:8px 20px;background:#fef3c7;border-bottom:2px solid #f59e0b;font-size:13px;font-weight:500;color:#92400e;flex-shrink:0}@media(prefers-color-scheme: dark){.backup-preview-banner{background:#451a03;border-bottom-color:#d97706;color:#fbbf24}}.backup-preview-actions{display:flex;gap:8px;flex-shrink:0}.settings-section{margin-top:20px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{font-size:14px;font-weight:600;margin-bottom:12px}.settings-section-header{display:flex;align-items:center;justify-content:space-between}.settings-section-header h3{margin-bottom:0}.settings-section-header{margin-bottom:12px}.backup-list{max-height:300px;overflow-y:auto;font-size:13px;color:var(--text-muted)}.backup-tier-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;padding:8px 0 4px;border-bottom:1px solid var(--border);margin-bottom:2px}.backup-tier-label:first-child{padding-top:0}.backup-row{display:flex;align-items:center;justify-content:space-between;padding:5px 8px;border-radius:var(--radius);cursor:pointer}.backup-row:hover{background:var(--bg-hover)}.backup-row-time{color:var(--text);font-weight:500}.backup-row-meta{font-size:11px;color:var(--text-muted)}.app-footer{display:flex;align-items:center;justify-content:space-between;padding:6px 20px;border-top:1px solid var(--border);background:var(--bg-secondary);font-size:12px;color:var(--text-muted);flex-shrink:0}.keyboard-hints{display:flex;gap:16px}.keyboard-hints kbd{display:inline-block;padding:1px 5px;border:1px solid var(--border);border-radius:3px;background:var(--bg);font-family:inherit;font-size:11px}.status-bar{font-size:12px}.ticket-list-columns{display:flex;flex-direction:column;overflow:hidden}.ticket-list-columns .draft-row{flex-shrink:0}.columns-container{display:flex;flex:1;gap:1px;background:var(--border);overflow-x:auto;min-height:0}.column{flex:1;min-width:180px;display:flex;flex-direction:column;background:var(--bg-secondary);overflow:hidden}.column.column-drop-target{background:var(--bg-selected)}.column.column-drop-target .column-body{outline:2px dashed var(--accent);outline-offset:-2px}.column-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:12px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.3px;border-bottom:1px solid var(--border);background:var(--bg);flex-shrink:0}.column-count{font-size:11px;font-weight:500;color:var(--text-muted);background:var(--bg-secondary);padding:1px 6px;border-radius:10px}.column-body{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:6px}.column-card{padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);cursor:grab;box-shadow:var(--shadow)}.column-card:hover{border-color:var(--accent)}.column-card.selected{border-color:var(--accent);background:var(--bg-selected)}.column-card.up-next{border-left:3px solid var(--star)}.column-card:active{cursor:grabbing}.column-card-header{display:flex;align-items:center;gap:6px;margin-bottom:4px}.column-card-title{font-size:13px;line-height:1.4;word-break:break-word}@media(max-width: 768px){.sidebar{width:140px}.detail-side .detail-panel{width:280px}.keyboard-hints{display:none}}@media(max-width: 600px){.sidebar{display:none}}.error-popup{position:fixed;inset:0;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;z-index:3000}.error-popup-content{background:var(--bg);border:1px solid var(--danger);border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,.15);padding:24px;max-width:360px;text-align:center}.error-popup-content strong{display:block;font-size:16px;margin-bottom:8px;color:var(--danger)}.error-popup-content p{font-size:14px;color:var(--text-secondary);margin-bottom:16px}.error-popup-content button{padding:6px 16px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);font-size:13px;cursor:pointer}.error-popup-content button:hover{background:var(--bg-hover)}.detail-notes{display:flex;flex-direction:column;gap:8px}.note-entry{padding:8px 10px;background:var(--bg-secondary);border-radius:var(--radius);border-left:3px solid var(--accent)}.note-timestamp{font-size:11px;color:var(--text-muted);margin-bottom:2px}.note-text{font-size:13px;color:var(--text);white-space:pre-wrap}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotsheet",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "A lightweight local project management tool. Create, categorize, and prioritize tickets with a fast bullet-list interface, then export an Up Next worklist for AI tools.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,11 +33,11 @@
33
33
  "build:client": "mkdir -p dist/client && npx esbuild src/client/app.ts --bundle --format=iife --outfile=dist/client/app.global.js --target=es2020 --jsx=automatic --jsx-import-source=#jsx --alias:#jsx/jsx-runtime=./src/jsx-runtime.ts && npx sass src/client/styles.scss dist/client/styles.css --style compressed --no-source-map",
34
34
  "lint": "eslint src/",
35
35
  "clean": "rm -rf dist node_modules/.cache",
36
- "tauri:clean": "rm -rf src-tauri/target",
37
36
  "release": "bash scripts/release.sh",
38
37
  "prepublishOnly": "npm run build",
39
38
  "dev:server": "npm run build:client && tsx --tsconfig tsconfig.json src/cli.ts --no-open --strict-port",
40
39
  "tauri": "tauri",
40
+ "tauri:clean": "rm -rf src-tauri/target",
41
41
  "tauri:dev": "bash scripts/ensure-sidecar-stub.sh && tauri dev",
42
42
  "tauri:build": "bash scripts/build-sidecar.sh && tauri build"
43
43
  },