@dmrlzz/davecode 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +5 -4
  2. package/bin/davecode.js +0 -0
  3. package/dist/{ChatApp-FO5SABXB.js → ChatApp-BO7QMBWD.js} +289 -137
  4. package/dist/ChatApp-BO7QMBWD.js.map +1 -0
  5. package/dist/{RunnerView-DLVR7C22.js → RunnerView-A7JSPUW5.js} +5 -5
  6. package/dist/account-UGNLJPQ4.js +23 -0
  7. package/dist/accounts-NM7IWP53.js +37 -0
  8. package/dist/{budget-RBHCEDPP.js → budget-INAW6FXD.js} +6 -6
  9. package/dist/chat-U4QJQ7M6.js +359 -0
  10. package/dist/chat-U4QJQ7M6.js.map +1 -0
  11. package/dist/{chunk-C7FDRA3U.js → chunk-3Q2KCXLN.js} +660 -139
  12. package/dist/chunk-3Q2KCXLN.js.map +1 -0
  13. package/dist/{chunk-BOLFK3BH.js → chunk-5LKOJBUL.js} +2 -2
  14. package/dist/{accounts-MTMGYKEP.js → chunk-CWBVNS3L.js} +24 -17
  15. package/dist/chunk-CWBVNS3L.js.map +1 -0
  16. package/dist/{chunk-PIIJ3RSI.js → chunk-DZ2FDABF.js} +1269 -1265
  17. package/dist/chunk-DZ2FDABF.js.map +1 -0
  18. package/dist/{chunk-OYEYNDOO.js → chunk-GE22VBCY.js} +3 -3
  19. package/dist/chunk-GHDOUII5.js +144 -0
  20. package/dist/chunk-GHDOUII5.js.map +1 -0
  21. package/dist/{chunk-MSLLH5XP.js → chunk-GZJ6JSO7.js} +4 -4
  22. package/dist/{chunk-VVCXGQMY.js → chunk-MC7RIPL7.js} +17 -8
  23. package/dist/chunk-MC7RIPL7.js.map +1 -0
  24. package/dist/{chunk-23KTE7IK.js → chunk-MOK5D3XJ.js} +2 -2
  25. package/dist/{chunk-OXRMGR72.js → chunk-PGPXE6LF.js} +2 -2
  26. package/dist/chunk-QA3O6RA2.js +81 -0
  27. package/dist/chunk-QA3O6RA2.js.map +1 -0
  28. package/dist/chunk-ROIUTNQV.js +20 -0
  29. package/dist/chunk-ROIUTNQV.js.map +1 -0
  30. package/dist/{chunk-IVZHKUCD.js → chunk-Z6NQDJEN.js} +3 -3
  31. package/dist/{config-FRMY5OHG.js → config-YEAPBMBX.js} +5 -5
  32. package/dist/dashboard/assets/Accounts-CeVyX4a3.js +1 -0
  33. package/dist/dashboard/assets/Badge-CGY6DgGx.js +55 -0
  34. package/dist/dashboard/assets/{Callout-B9g_wPDi.js → Callout-DauCk_cW.js} +1 -1
  35. package/dist/dashboard/assets/{Field-BfabPEcY.js → Field-OXMnT9Tb.js} +1 -1
  36. package/dist/dashboard/assets/{Goals-BsV-6m94.js → Goals-DH-KDh8M.js} +1 -1
  37. package/dist/dashboard/assets/{Library-CEA9P1m-.js → Library-C15szLjZ.js} +1 -1
  38. package/dist/dashboard/assets/{Markdown-ClRsddnB.js → Markdown-Xhao3sgL.js} +7 -7
  39. package/dist/dashboard/assets/Panel-Du40pM7n.js +1 -0
  40. package/dist/dashboard/assets/{RoutesPage-Dh-BJ3ir.js → RoutesPage-Cj1OelGO.js} +1 -1
  41. package/dist/dashboard/assets/{Runner-C_e9l5l2.js → Runner-BK1-ZF7h.js} +1 -1
  42. package/dist/dashboard/assets/{Settings-C6Yc1Gjg.js → Settings-C1nzQQhe.js} +1 -1
  43. package/dist/dashboard/assets/{Switch-CUpOJjUT.js → Switch-bwtIJ00H.js} +1 -1
  44. package/dist/dashboard/assets/Tasks-x4s8IiPG.js +2 -0
  45. package/dist/dashboard/assets/{Traffic-CE6wZSMr.js → Traffic-CV7TaTid.js} +1 -1
  46. package/dist/dashboard/assets/{Workspace-CxFxvkA6.js → Workspace-DAL-MBc0.js} +1 -1
  47. package/dist/dashboard/assets/arrow-up-goM9r-I9.js +1 -0
  48. package/dist/dashboard/assets/{forms-D6UIYgC5.js → forms-DtpfI65-.js} +1 -1
  49. package/dist/dashboard/assets/index-BCi-Vuvh.js +104 -0
  50. package/dist/dashboard/assets/{index-1iH716Xy.css → index-CcJFhc98.css} +1 -1
  51. package/dist/dashboard/assets/{task-errors-CE4oEr8H.js → task-errors-B2pgjUGN.js} +1 -1
  52. package/dist/dashboard/assets/{trash-CWqeZ7eg.js → trash-BVojETtF.js} +1 -1
  53. package/dist/dashboard/favicon.svg +1 -7
  54. package/dist/dashboard/index.html +4 -4
  55. package/dist/{dist-ZPXEVBEC.js → dist-RRQGUBL3.js} +24 -2
  56. package/dist/dist-RRQGUBL3.js.map +1 -0
  57. package/dist/{doctor-7RUD4D3A.js → doctor-MQYK44S2.js} +5 -5
  58. package/dist/{goal-JFRNPBSD.js → goal-6NUX4AIT.js} +5 -5
  59. package/dist/index.js +48 -30
  60. package/dist/index.js.map +1 -1
  61. package/dist/{init-NFYNO3A3.js → init-AXYIWAB3.js} +6 -6
  62. package/dist/{prompts-L37J72YW.js → prompts-TZ7UC42M.js} +9 -5
  63. package/dist/prompts-TZ7UC42M.js.map +1 -0
  64. package/dist/{run-ARUPXFFB.js → run-QRTLHFB3.js} +10 -10
  65. package/dist/runtime.js +18 -0
  66. package/dist/runtime.js.map +1 -0
  67. package/dist/{start-CFPOVIAR.js → start-O5I5TSO2.js} +5 -5
  68. package/dist/{status-E4EACVE2.js → status-LEA3RVUX.js} +6 -6
  69. package/dist/status-LEA3RVUX.js.map +1 -0
  70. package/dist/{tasks-ZIK6BVEX.js → tasks-XOTVICVZ.js} +6 -6
  71. package/package.json +21 -15
  72. package/dist/ChatApp-FO5SABXB.js.map +0 -1
  73. package/dist/accounts-MTMGYKEP.js.map +0 -1
  74. package/dist/chat-ZDXX3N6X.js +0 -95
  75. package/dist/chat-ZDXX3N6X.js.map +0 -1
  76. package/dist/chunk-C7FDRA3U.js.map +0 -1
  77. package/dist/chunk-DYQ56FBT.js +0 -47
  78. package/dist/chunk-DYQ56FBT.js.map +0 -1
  79. package/dist/chunk-PIIJ3RSI.js.map +0 -1
  80. package/dist/chunk-VVCXGQMY.js.map +0 -1
  81. package/dist/dashboard/assets/Accounts-BR3ZfVk4.js +0 -1
  82. package/dist/dashboard/assets/Badge-B-qzNRrZ.js +0 -55
  83. package/dist/dashboard/assets/Panel-B9tSgX6l.js +0 -1
  84. package/dist/dashboard/assets/Tasks-CTku0rR3.js +0 -2
  85. package/dist/dashboard/assets/arrow-up-DL3CuFOO.js +0 -1
  86. package/dist/dashboard/assets/index-BMWr9EKo.js +0 -104
  87. package/dist/prompts-L37J72YW.js.map +0 -1
  88. /package/dist/{RunnerView-DLVR7C22.js.map → RunnerView-A7JSPUW5.js.map} +0 -0
  89. /package/dist/{dist-ZPXEVBEC.js.map → account-UGNLJPQ4.js.map} +0 -0
  90. /package/dist/{status-E4EACVE2.js.map → accounts-NM7IWP53.js.map} +0 -0
  91. /package/dist/{budget-RBHCEDPP.js.map → budget-INAW6FXD.js.map} +0 -0
  92. /package/dist/{chunk-BOLFK3BH.js.map → chunk-5LKOJBUL.js.map} +0 -0
  93. /package/dist/{chunk-OYEYNDOO.js.map → chunk-GE22VBCY.js.map} +0 -0
  94. /package/dist/{chunk-MSLLH5XP.js.map → chunk-GZJ6JSO7.js.map} +0 -0
  95. /package/dist/{chunk-23KTE7IK.js.map → chunk-MOK5D3XJ.js.map} +0 -0
  96. /package/dist/{chunk-OXRMGR72.js.map → chunk-PGPXE6LF.js.map} +0 -0
  97. /package/dist/{chunk-IVZHKUCD.js.map → chunk-Z6NQDJEN.js.map} +0 -0
  98. /package/dist/{config-FRMY5OHG.js.map → config-YEAPBMBX.js.map} +0 -0
  99. /package/dist/{doctor-7RUD4D3A.js.map → doctor-MQYK44S2.js.map} +0 -0
  100. /package/dist/{goal-JFRNPBSD.js.map → goal-6NUX4AIT.js.map} +0 -0
  101. /package/dist/{init-NFYNO3A3.js.map → init-AXYIWAB3.js.map} +0 -0
  102. /package/dist/{run-ARUPXFFB.js.map → run-QRTLHFB3.js.map} +0 -0
  103. /package/dist/{start-CFPOVIAR.js.map → start-O5I5TSO2.js.map} +0 -0
  104. /package/dist/{tasks-ZIK6BVEX.js.map → tasks-XOTVICVZ.js.map} +0 -0
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-B9tSgX6l.js";import{C as l,M as u,T as d,V as f,d as p,ft as m,g as h,i as g,pt as _,r as v,t as y,w as b}from"./Badge-B-qzNRrZ.js";import{n as x,t as S}from"./Switch-CUpOJjUT.js";import{n as C,t as w}from"./Markdown-ClRsddnB.js";import{t as T}from"./Callout-B9g_wPDi.js";import{D as E,P as D,h as O,i as k,k as A,l as j,o as M,s as N,u as P,y as F}from"./index-BMWr9EKo.js";import{i as I,n as L,t as R}from"./Field-BfabPEcY.js";var z={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};z.node;var B=i(z),V={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};V.node;var H=i(V),U=c(t(),1),W=o(),G={planning:`info`,running:`info`,reviewing:`info`,planned:`accent`,succeeded:`ok`,failed:`err`,cancelled:`neutral`,budget_exhausted:`warn`},K={planning:`planning`,running:`running`,reviewing:`reviewing`,planned:`planned (dry run)`,succeeded:`succeeded`,failed:`failed`,cancelled:`cancelled`,budget_exhausted:`out of budget`},q=new Set([`planning`,`running`,`reviewing`]);function J(e){return q.has(e.status)}function Y(e){let t=Number(e);return e.trim()&&Number.isInteger(t)&&t>0?t:void 0}function X(){let t=d(),[n,i]=(0,U.useState)(),o=_(t.error)&&t.error.status===501,c=t.data??[],l=c.find(e=>e.id===n)??c[0],u=c.find(J);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(s,{title:`Goals`,description:`Give the agent team an objective: a planner splits it into tasks, role agents execute them, a reviewer re-plans until it is done or the budget runs out.`}),o?(0,W.jsxs)(T,{tone:`warn`,title:`Goal mode unavailable`,children:[(0,W.jsxs)(`p`,{children:[`This gateway answered `,(0,W.jsx)(`code`,{className:`font-mono text-fg`,children:`501 goals_unavailable`}),`: it was started outside a project. Start it inside a repository with a project brain, or run a goal from the terminal:`]}),(0,W.jsx)(j,{command:`davecode goal "<objective>"`,className:`mt-2 max-w-sm`})]}):(0,W.jsx)(Z,{busy:u?.id,onStarted:e=>i(e.id)}),t.isError&&!o&&(0,W.jsx)(T,{tone:`err`,title:`Could not load goals`,children:m(t.error)}),!o&&(0,W.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,W.jsxs)(r,{"aria-labelledby":`goal-list-title`,className:`xl:self-start`,children:[(0,W.jsx)(a,{id:`goal-list-title`,title:`History`,meta:c.length?`${c.length} goal${c.length===1?``:`s`}`:void 0}),t.isPending?(0,W.jsx)(M,{rows:4,className:`p-3`}):c.length===0?(0,W.jsx)(k,{icon:E,title:`No goals yet`,description:`Describe an objective above, or try a dry run to see the plan first.`}):(0,W.jsx)(`ul`,{className:`flex flex-col p-1.5`,"aria-label":`Goals`,children:c.map(t=>{let n=t.tasks.filter(e=>e.status===`SUCCESS`).length,r=t.id===l?.id;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"aria-current":r?`true`:void 0,onClick:()=>i(t.id),className:e(`flex w-full flex-col gap-1 rounded-md px-2.5 py-2 text-left transition-colors duration-150`,r?`bg-hover`:`hover:bg-hover/60`),children:[(0,W.jsx)(`span`,{className:`line-clamp-2 text-[13px] leading-5 text-fg`,children:t.objective}),(0,W.jsxs)(`span`,{className:`flex items-center gap-2 text-2xs text-muted`,children:[(0,W.jsx)(y,{tone:G[t.status],dot:!0,pulse:J(t),children:K[t.status]}),(0,W.jsxs)(`span`,{className:`tnum`,children:[n,`/`,t.tasks.length,` tasks`]}),(0,W.jsx)(`span`,{className:`ml-auto`,children:p(Date.parse(t.createdAt))})]})]})},t.id)})})]}),l?(0,W.jsx)($,{goal:l}):null]})]})}function Z({busy:e,onStarted:t}){let i=u(),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(``),[d,f]=(0,U.useState)(``),[p,h]=(0,U.useState)(``),[g,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null);return(0,W.jsxs)(r,{"aria-labelledby":`new-goal-title`,children:[(0,W.jsx)(a,{id:`new-goal-title`,title:`New goal`,meta:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(H,{"aria-hidden":!0,className:`size-3.5 text-ok`,strokeWidth:1.75}),`Never emails, posts, pays or signs up: those become drafts`]})}),(0,W.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),!o.trim()){b(`Describe what the team should achieve.`);return}b(null);let n={objective:o.trim()},r=Y(c),a=Y(d),l=Y(p);r&&(n.maxRounds=r),a&&(n.maxTasks=a),l&&(n.maxTokens=l),g&&(n.dryRun=!0),i.mutate(n,{onSuccess:e=>{F({tone:`info`,title:g?`Planning (dry run)`:`Goal started`,description:e.objective}),s(``),t(e)},onError:e=>F({tone:`err`,title:`Could not start the goal`,description:_(e)&&e.code===`busy`?`${e.message}. Goals and the runner take turns on the working tree.`:m(e)})})},className:`flex flex-col gap-3 p-4`,children:[(0,W.jsx)(R,{label:`Objective`,required:!0,error:y,children:({id:e,describedBy:t,invalid:n})=>(0,W.jsx)(I,{id:e,"aria-describedby":t,"aria-invalid":n,rows:2,maxLength:4e3,placeholder:`e.g. Write positioning and landing-page copy for this project, then add a /pricing page`,value:o,onChange:e=>s(e.target.value)})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(R,{label:`Max rounds`,className:`w-28`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`4`,value:c,onChange:e=>l(e.target.value)})}),(0,W.jsx)(R,{label:`Max tasks`,className:`w-28`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`12`,value:d,onChange:e=>f(e.target.value)})}),(0,W.jsx)(R,{label:`Token budget`,className:`w-36`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`1000000`,value:p,onChange:e=>h(e.target.value)})}),(0,W.jsxs)(`span`,{className:`flex h-8 items-center gap-2 text-[12px] text-fg-2`,children:[(0,W.jsx)(S,{checked:g,onChange:v,label:`Dry run`}),`Dry run (plan only)`]}),(0,W.jsx)(n,{type:`submit`,variant:`primary`,icon:D,className:`ml-auto`,loading:i.isPending,disabled:i.isPending||!!e&&!g,title:e&&!g?`Goal ${e} is still running`:void 0,children:g?`Plan`:`Start goal`})]})]})]})}function Q({label:t,value:n,max:r,format:i=String}){let a=r>0?Math.min(100,n/r*100):0;return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-[12px]`,children:[(0,W.jsx)(`span`,{className:`text-muted`,children:t}),(0,W.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[i(n),(0,W.jsxs)(`span`,{className:`text-muted`,children:[` / `,i(r)]})]})]}),(0,W.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-track`,"aria-hidden":!0,children:(0,W.jsx)(`div`,{className:e(`h-full rounded-full transition-[width] duration-500 ease-snappy`,a>=90?`bg-warn`:`bg-accent`),style:{width:`${a}%`}})})]})}function $({goal:t}){let i=h(),o=l(),s=f(),[c,u]=(0,U.useState)(!1),[d,p]=(0,U.useState)(),_=J(t),b=t.tasks.filter(e=>e.status===`SUCCESS`).length,S=s.events.filter(e=>e.type===`goal.log`&&e.goalId===t.id),T=()=>i.mutate(t.id,{onSuccess:e=>F({tone:`info`,title:`Goal ${e.status}`,description:e.objective}),onError:e=>F({tone:`err`,title:`Could not cancel`,description:m(e)})});return(0,W.jsxs)(r,{"aria-labelledby":`goal-detail-title`,className:`min-w-0`,children:[(0,W.jsx)(a,{id:`goal-detail-title`,title:(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:t.id}),meta:(0,W.jsx)(y,{tone:G[t.status],dot:!0,pulse:_,children:K[t.status]}),actions:(0,W.jsxs)(W.Fragment,{children:[t.status===`planned`&&(0,W.jsx)(n,{size:`sm`,variant:`primary`,icon:D,loading:o.isPending,onClick:()=>o.mutate(t.id,{onSuccess:e=>F({tone:`info`,title:`Executing planned goal`,description:e.objective}),onError:e=>F({tone:`err`,title:`Could not execute plan`,description:m(e)})}),children:`Execute plan`}),_&&(0,W.jsx)(n,{size:`sm`,variant:`danger`,icon:A,loading:i.isPending,onClick:()=>u(!0),children:`Cancel`})]})}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,W.jsx)(`p`,{className:`text-[15px] leading-6 font-medium text-fg`,children:t.objective}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-3`,children:[(0,W.jsx)(Q,{label:`Rounds`,value:t.round,max:t.limits.maxRounds}),(0,W.jsx)(Q,{label:`Tasks done`,value:b,max:Math.max(t.tasks.length,1)}),(0,W.jsx)(Q,{label:`Tokens`,value:t.limits.tokensUsed,max:t.limits.maxTokens,format:g})]}),t.lastError&&(0,W.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:t.lastError}),(0,W.jsx)(`section`,{"aria-label":`Tasks`,className:`flex flex-col`,children:t.tasks.length===0?(0,W.jsx)(`p`,{className:`text-[12px] text-muted`,children:_?`The planner is drafting the task graph…`:`No tasks were planned.`}):(0,W.jsx)(`ol`,{className:`flex flex-col divide-y divide-line rounded-md border border-line`,children:t.tasks.map(n=>(0,W.jsxs)(`li`,{className:e(`flex flex-col gap-1.5 px-3 py-2.5`,n.id===t.activeTaskId&&`bg-accent-soft/40`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(O,{status:n.status}),(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:n.id}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] text-fg`,children:n.title}),(0,W.jsx)(y,{mono:!0,children:n.role}),(0,W.jsx)(y,{tone:n.kind===`code`?`accent`:`neutral`,mono:!0,children:n.kind}),n.round>1&&(0,W.jsxs)(y,{mono:!0,children:[`round `,n.round]})]}),n.dependsOn.length>0&&(0,W.jsxs)(`p`,{className:`text-2xs text-muted`,children:[`after `,n.dependsOn.join(`, `)]}),n.artifact&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-2xs text-fg-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>e===n.id?void 0:n.id),"aria-expanded":d===n.id,className:`inline-flex items-center gap-1 rounded px-1 py-0.5 text-fg-2 transition-colors hover:bg-hover hover:text-fg`,children:[d===n.id?(0,W.jsx)(B,{"aria-hidden":!0,className:`size-3.5 text-muted`}):(0,W.jsx)(x,{"aria-hidden":!0,className:`size-3.5 text-muted`}),(0,W.jsx)(C,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),(0,W.jsx)(`span`,{className:`truncate`,children:n.artifact})]}),(0,W.jsx)(P,{value:n.artifact,label:`Copy path`})]}),d===n.id&&(0,W.jsx)(ee,{goalId:t.id,taskId:n.id})]}),n.status===`FAILED`&&n.notes&&(0,W.jsx)(`p`,{className:`line-clamp-3 font-mono text-2xs text-err`,children:n.notes})]},n.id))})}),t.summary&&(0,W.jsx)(`section`,{"aria-label":`Summary`,className:`rounded-md border border-line bg-raised/40 p-3`,children:(0,W.jsx)(w,{source:t.summary,className:`text-[13px]`})}),(0,W.jsx)(`section`,{"aria-label":`Goal log`,className:`term max-h-64 overflow-auto rounded-md border border-line bg-term py-2 font-mono text-[12px] leading-[1.6]`,children:S.length===0?(0,W.jsx)(`p`,{className:`px-3 text-muted`,children:_?`Waiting for agent output…`:`No live log for this goal in this session.`}):S.map(t=>(0,W.jsxs)(`div`,{className:`flex gap-3 px-3`,children:[(0,W.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:v(t.ts)}),(0,W.jsx)(`span`,{className:`w-20 shrink-0 truncate text-info`,children:t.role??`goal`}),(0,W.jsx)(`span`,{className:e(`min-w-0 break-words`,t.level===`error`?`text-err`:t.level===`warn`?`text-warn`:`text-fg-2`),children:t.message})]},`${t.ts}-${t.message}`))})]}),(0,W.jsx)(N,{open:c,onClose:()=>u(!1),title:`Cancel this goal?`,description:`The agent in flight is stopped. Finished artifacts and merged code stay; an interrupted code task keeps its partial work on its branch.`,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(n,{variant:`ghost`,onClick:()=>u(!1),children:`Keep going`}),(0,W.jsx)(n,{variant:`danger`,icon:A,onClick:()=>{u(!1),T()},children:`Cancel goal`})]}),children:(0,W.jsx)(`p`,{className:`text-[12px] text-muted`,children:t.objective})})]})}function ee({goalId:e,taskId:t}){let n=b(e,t);return n.isPending?(0,W.jsx)(M,{rows:3,className:`p-2`}):n.isError?(0,W.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:m(n.error)}):(0,W.jsxs)(`div`,{className:`rounded-md border border-line bg-raised/50 p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2 border-b border-line pb-1.5`,children:[(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:n.data.path}),(0,W.jsx)(P,{value:n.data.content,label:`Copy markdown`})]}),(0,W.jsx)(w,{source:n.data.content,className:`text-[13px]`})]})}export{$ as GoalDetail,X as Goals,J as isActiveGoal,B as t};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{C as l,M as u,T as d,V as f,d as p,ft as m,g as h,i as g,pt as _,r as v,t as y,w as b}from"./Badge-CGY6DgGx.js";import{n as x,t as S}from"./Switch-bwtIJ00H.js";import{n as C,t as w}from"./Markdown-Xhao3sgL.js";import{t as T}from"./Callout-DauCk_cW.js";import{D as E,P as D,h as O,i as k,k as A,l as j,o as M,s as N,u as P,y as F}from"./index-BCi-Vuvh.js";import{i as I,n as L,t as R}from"./Field-OXMnT9Tb.js";var z={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};z.node;var B=i(z),V={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};V.node;var H=i(V),U=c(t(),1),W=o(),G={planning:`info`,running:`info`,reviewing:`info`,planned:`accent`,succeeded:`ok`,failed:`err`,cancelled:`neutral`,budget_exhausted:`warn`},K={planning:`planning`,running:`running`,reviewing:`reviewing`,planned:`planned (dry run)`,succeeded:`succeeded`,failed:`failed`,cancelled:`cancelled`,budget_exhausted:`out of budget`},q=new Set([`planning`,`running`,`reviewing`]);function J(e){return q.has(e.status)}function Y(e){let t=Number(e);return e.trim()&&Number.isInteger(t)&&t>0?t:void 0}function X(){let t=d(),[n,i]=(0,U.useState)(),o=_(t.error)&&t.error.status===501,c=t.data??[],l=c.find(e=>e.id===n)??c[0],u=c.find(J);return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsx)(s,{title:`Goals`,description:`Give the agent team an objective: a planner splits it into tasks, role agents execute them, a reviewer re-plans until it is done or the budget runs out.`}),o?(0,W.jsxs)(T,{tone:`warn`,title:`Goal mode unavailable`,children:[(0,W.jsxs)(`p`,{children:[`This gateway answered `,(0,W.jsx)(`code`,{className:`font-mono text-fg`,children:`501 goals_unavailable`}),`: it was started outside a project. Start it inside a repository with a project brain, or run a goal from the terminal:`]}),(0,W.jsx)(j,{command:`davecode goal "<objective>"`,className:`mt-2 max-w-sm`})]}):(0,W.jsx)(Z,{busy:u?.id,onStarted:e=>i(e.id)}),t.isError&&!o&&(0,W.jsx)(T,{tone:`err`,title:`Could not load goals`,children:m(t.error)}),!o&&(0,W.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,W.jsxs)(r,{"aria-labelledby":`goal-list-title`,className:`xl:self-start`,children:[(0,W.jsx)(a,{id:`goal-list-title`,title:`History`,meta:c.length?`${c.length} goal${c.length===1?``:`s`}`:void 0}),t.isPending?(0,W.jsx)(M,{rows:4,className:`p-3`}):c.length===0?(0,W.jsx)(k,{icon:E,title:`No goals yet`,description:`Describe an objective above, or try a dry run to see the plan first.`}):(0,W.jsx)(`ul`,{className:`flex flex-col p-1.5`,"aria-label":`Goals`,children:c.map(t=>{let n=t.tasks.filter(e=>e.status===`SUCCESS`).length,r=t.id===l?.id;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,"aria-current":r?`true`:void 0,onClick:()=>i(t.id),className:e(`flex w-full flex-col gap-1 rounded-md px-2.5 py-2 text-left transition-colors duration-150`,r?`bg-hover`:`hover:bg-hover/60`),children:[(0,W.jsx)(`span`,{className:`line-clamp-2 text-[13px] leading-5 text-fg`,children:t.objective}),(0,W.jsxs)(`span`,{className:`flex items-center gap-2 text-2xs text-muted`,children:[(0,W.jsx)(y,{tone:G[t.status],dot:!0,pulse:J(t),children:K[t.status]}),(0,W.jsxs)(`span`,{className:`tnum`,children:[n,`/`,t.tasks.length,` tasks`]}),(0,W.jsx)(`span`,{className:`ml-auto`,children:p(Date.parse(t.createdAt))})]})]})},t.id)})})]}),l?(0,W.jsx)($,{goal:l}):null]})]})}function Z({busy:e,onStarted:t}){let i=u(),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)(``),[d,f]=(0,U.useState)(``),[p,h]=(0,U.useState)(``),[g,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null);return(0,W.jsxs)(r,{"aria-labelledby":`new-goal-title`,children:[(0,W.jsx)(a,{id:`new-goal-title`,title:`New goal`,meta:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,W.jsx)(H,{"aria-hidden":!0,className:`size-3.5 text-ok`,strokeWidth:1.75}),`Never emails, posts, pays or signs up: those become drafts`]})}),(0,W.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),!o.trim()){b(`Describe what the team should achieve.`);return}b(null);let n={objective:o.trim()},r=Y(c),a=Y(d),l=Y(p);r&&(n.maxRounds=r),a&&(n.maxTasks=a),l&&(n.maxTokens=l),g&&(n.dryRun=!0),i.mutate(n,{onSuccess:e=>{F({tone:`info`,title:g?`Planning (dry run)`:`Goal started`,description:e.objective}),s(``),t(e)},onError:e=>F({tone:`err`,title:`Could not start the goal`,description:_(e)&&e.code===`busy`?`${e.message}. Goals and the runner take turns on the working tree.`:m(e)})})},className:`flex flex-col gap-3 p-4`,children:[(0,W.jsx)(R,{label:`Objective`,required:!0,error:y,children:({id:e,describedBy:t,invalid:n})=>(0,W.jsx)(I,{id:e,"aria-describedby":t,"aria-invalid":n,rows:2,maxLength:4e3,placeholder:`e.g. Write positioning and landing-page copy for this project, then add a /pricing page`,value:o,onChange:e=>s(e.target.value)})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(R,{label:`Max rounds`,className:`w-28`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`4`,value:c,onChange:e=>l(e.target.value)})}),(0,W.jsx)(R,{label:`Max tasks`,className:`w-28`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`12`,value:d,onChange:e=>f(e.target.value)})}),(0,W.jsx)(R,{label:`Token budget`,className:`w-36`,children:({id:e})=>(0,W.jsx)(L,{id:e,inputMode:`numeric`,placeholder:`1000000`,value:p,onChange:e=>h(e.target.value)})}),(0,W.jsxs)(`span`,{className:`flex h-8 items-center gap-2 text-[12px] text-fg-2`,children:[(0,W.jsx)(S,{checked:g,onChange:v,label:`Dry run`}),`Dry run (plan only)`]}),(0,W.jsx)(n,{type:`submit`,variant:`primary`,icon:D,className:`ml-auto`,loading:i.isPending,disabled:i.isPending||!!e&&!g,title:e&&!g?`Goal ${e} is still running`:void 0,children:g?`Plan`:`Start goal`})]})]})]})}function Q({label:t,value:n,max:r,format:i=String}){let a=r>0?Math.min(100,n/r*100):0;return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-[12px]`,children:[(0,W.jsx)(`span`,{className:`text-muted`,children:t}),(0,W.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[i(n),(0,W.jsxs)(`span`,{className:`text-muted`,children:[` / `,i(r)]})]})]}),(0,W.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-track`,"aria-hidden":!0,children:(0,W.jsx)(`div`,{className:e(`h-full rounded-full transition-[width] duration-500 ease-snappy`,a>=90?`bg-warn`:`bg-accent`),style:{width:`${a}%`}})})]})}function $({goal:t}){let i=h(),o=l(),s=f(),[c,u]=(0,U.useState)(!1),[d,p]=(0,U.useState)(),_=J(t),b=t.tasks.filter(e=>e.status===`SUCCESS`).length,S=s.events.filter(e=>e.type===`goal.log`&&e.goalId===t.id),T=()=>i.mutate(t.id,{onSuccess:e=>F({tone:`info`,title:`Goal ${e.status}`,description:e.objective}),onError:e=>F({tone:`err`,title:`Could not cancel`,description:m(e)})});return(0,W.jsxs)(r,{"aria-labelledby":`goal-detail-title`,className:`min-w-0`,children:[(0,W.jsx)(a,{id:`goal-detail-title`,title:(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:t.id}),meta:(0,W.jsx)(y,{tone:G[t.status],dot:!0,pulse:_,children:K[t.status]}),actions:(0,W.jsxs)(W.Fragment,{children:[t.status===`planned`&&(0,W.jsx)(n,{size:`sm`,variant:`primary`,icon:D,loading:o.isPending,onClick:()=>o.mutate(t.id,{onSuccess:e=>F({tone:`info`,title:`Executing planned goal`,description:e.objective}),onError:e=>F({tone:`err`,title:`Could not execute plan`,description:m(e)})}),children:`Execute plan`}),_&&(0,W.jsx)(n,{size:`sm`,variant:`danger`,icon:A,loading:i.isPending,onClick:()=>u(!0),children:`Cancel`})]})}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,W.jsx)(`p`,{className:`text-[15px] leading-6 font-medium text-fg`,children:t.objective}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-3`,children:[(0,W.jsx)(Q,{label:`Rounds`,value:t.round,max:t.limits.maxRounds}),(0,W.jsx)(Q,{label:`Tasks done`,value:b,max:Math.max(t.tasks.length,1)}),(0,W.jsx)(Q,{label:`Tokens`,value:t.limits.tokensUsed,max:t.limits.maxTokens,format:g})]}),t.lastError&&(0,W.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:t.lastError}),(0,W.jsx)(`section`,{"aria-label":`Tasks`,className:`flex flex-col`,children:t.tasks.length===0?(0,W.jsx)(`p`,{className:`text-[12px] text-muted`,children:_?`The planner is drafting the task graph…`:`No tasks were planned.`}):(0,W.jsx)(`ol`,{className:`flex flex-col divide-y divide-line rounded-md border border-line`,children:t.tasks.map(n=>(0,W.jsxs)(`li`,{className:e(`flex flex-col gap-1.5 px-3 py-2.5`,n.id===t.activeTaskId&&`bg-accent-soft/40`),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(O,{status:n.status}),(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:n.id}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 text-[13px] text-fg`,children:n.title}),(0,W.jsx)(y,{mono:!0,children:n.role}),(0,W.jsx)(y,{tone:n.kind===`code`?`accent`:`neutral`,mono:!0,children:n.kind}),n.round>1&&(0,W.jsxs)(y,{mono:!0,children:[`round `,n.round]})]}),n.dependsOn.length>0&&(0,W.jsxs)(`p`,{className:`text-2xs text-muted`,children:[`after `,n.dependsOn.join(`, `)]}),n.artifact&&(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-2xs text-fg-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>e===n.id?void 0:n.id),"aria-expanded":d===n.id,className:`inline-flex items-center gap-1 rounded px-1 py-0.5 text-fg-2 transition-colors hover:bg-hover hover:text-fg`,children:[d===n.id?(0,W.jsx)(B,{"aria-hidden":!0,className:`size-3.5 text-muted`}):(0,W.jsx)(x,{"aria-hidden":!0,className:`size-3.5 text-muted`}),(0,W.jsx)(C,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),(0,W.jsx)(`span`,{className:`truncate`,children:n.artifact})]}),(0,W.jsx)(P,{value:n.artifact,label:`Copy path`})]}),d===n.id&&(0,W.jsx)(ee,{goalId:t.id,taskId:n.id})]}),n.status===`FAILED`&&n.notes&&(0,W.jsx)(`p`,{className:`line-clamp-3 font-mono text-2xs text-err`,children:n.notes})]},n.id))})}),t.summary&&(0,W.jsx)(`section`,{"aria-label":`Summary`,className:`rounded-md border border-line bg-raised/40 p-3`,children:(0,W.jsx)(w,{source:t.summary,className:`text-[13px]`})}),(0,W.jsx)(`section`,{"aria-label":`Goal log`,className:`term max-h-64 overflow-auto rounded-md border border-line bg-term py-2 font-mono text-[12px] leading-[1.6]`,children:S.length===0?(0,W.jsx)(`p`,{className:`px-3 text-muted`,children:_?`Waiting for agent output…`:`No live log for this goal in this session.`}):S.map(t=>(0,W.jsxs)(`div`,{className:`flex gap-3 px-3`,children:[(0,W.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:v(t.ts)}),(0,W.jsx)(`span`,{className:`w-20 shrink-0 truncate text-info`,children:t.role??`goal`}),(0,W.jsx)(`span`,{className:e(`min-w-0 break-words`,t.level===`error`?`text-err`:t.level===`warn`?`text-warn`:`text-fg-2`),children:t.message})]},`${t.ts}-${t.message}`))})]}),(0,W.jsx)(N,{open:c,onClose:()=>u(!1),title:`Cancel this goal?`,description:`The agent in flight is stopped. Finished artifacts and merged code stay; an interrupted code task keeps its partial work on its branch.`,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(n,{variant:`ghost`,onClick:()=>u(!1),children:`Keep going`}),(0,W.jsx)(n,{variant:`danger`,icon:A,onClick:()=>{u(!1),T()},children:`Cancel goal`})]}),children:(0,W.jsx)(`p`,{className:`text-[12px] text-muted`,children:t.objective})})]})}function ee({goalId:e,taskId:t}){let n=b(e,t);return n.isPending?(0,W.jsx)(M,{rows:3,className:`p-2`}):n.isError?(0,W.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:m(n.error)}):(0,W.jsxs)(`div`,{className:`rounded-md border border-line bg-raised/50 p-3`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2 border-b border-line pb-1.5`,children:[(0,W.jsx)(`span`,{className:`font-mono text-2xs text-muted`,children:n.data.path}),(0,W.jsx)(P,{value:n.data.content,label:`Copy markdown`})]}),(0,W.jsx)(w,{source:n.data.content,className:`text-[13px]`})]})}export{$ as GoalDetail,X as Goals,J as isActiveGoal,B as t};
@@ -1 +1 @@
1
- import{c as e,i as t,s as n,t as r,u as i}from"./Panel-B9tSgX6l.js";import{A as a,U as o,W as s,x as c}from"./index-BMWr9EKo.js";import{n as l}from"./Field-BfabPEcY.js";var u=i(e(),1),d=[{id:`ponytail`,name:`Ponytail`,kind:`Guidance`,url:`https://github.com/DietrichGebert/ponytail`,description:`Reuse what exists and keep implementations small. Useful for avoiding unnecessary code; it does not supply an art direction.`,access:`Repository; review license before reuse`},{id:`anti-slop`,name:`Anti Slop`,kind:`Guidance`,url:`https://github.com/miqdadbadjuber/anti-slop`,description:`Review recurring generic patterns in interface design, copy and generated code.`,access:`Repository; review license before reuse`},{id:`impeccable`,name:`Impeccable`,kind:`Guidance`,url:`https://github.com/pbakaus/impeccable`,description:`Design guidance for defining a product direction and refining the finished interface.`,access:`Repository; review license before reuse`},{id:`anti-ui-slop`,name:`Anti UI Slop`,kind:`Guidance`,url:`https://github.com/tuanphung2005/anti-ui-slop`,description:`A separate UI-focused ruleset. Compare its constraints with your brief rather than combining conflicting rules.`,access:`Repository; review license before reuse`},{id:`shadcn`,name:`shadcn/ui`,kind:`Components`,url:`https://github.com/shadcn-ui/ui`,description:`Own and adapt the component source. Start from accessible building blocks and make them fit your identity.`,access:`MIT component library`},{id:`radix`,name:`Radix Primitives`,kind:`Components`,url:`https://github.com/radix-ui/primitives`,description:`Accessible interaction primitives for dialogs, menus and other complex interface behaviors.`,access:`MIT component library`},{id:`motion`,name:`Motion`,kind:`Components`,url:`https://github.com/motiondivision/motion`,description:`Animation for React and JavaScript. Use motion to explain a change, with a reduced-motion alternative.`,access:`MIT library; optional paid products are separate`},{id:`r3f`,name:`React Three Fiber`,kind:`Components`,url:`https://github.com/pmndrs/react-three-fiber`,description:`A React renderer for Three.js. Consider it when a real 3D experience serves the idea.`,access:`MIT library; assets have their own licenses`},{id:`awwwards`,name:`Awwwards`,kind:`Inspiration`,url:`https://www.awwwards.com/`,description:`Explore expressive websites and the studios behind them. Study composition and interaction, then create your own interpretation.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`siteinspire`,name:`Siteinspire`,kind:`Inspiration`,url:`https://www.siteinspire.com/`,description:`Find references by style, type and subject instead of starting from the same SaaS template.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`freight`,name:`Studio Freight`,kind:`Inspiration`,url:`https://studiofreight.com/`,description:`A studio reference for thoughtful digital identity and web experiences.`,access:`Studio portfolio; reference only`},{id:`hf`,name:`Hugging Face Spaces`,kind:`AI tools`,url:`https://huggingface.co/spaces`,description:`Discover interactive AI demos. Check each Space, model license and compute requirements before using it in your project.`,access:`Availability, model licenses and costs vary`}];function f(e){return`Help me create a distinctive interface for this project. Use ${e.name} (${e.url}) as a reference if you can access it. Its purpose: ${e.description}\n\nFirst identify the audience, intended outcome and existing design system. Propose a specific visual direction and a short design brief: typography, palette, composition, imagery, interaction and mobile behavior. Preserve the project stack, cover loading/empty/error states, and verify the rendered result. Use references as inspiration and respect their licenses. Do not claim to have read, installed or connected a resource without checking. Explain any external dependency before adding it.`}var p=n(),m=[`All`,`Guidance`,`Components`,`Inspiration`,`AI tools`];function h(){let[e,n]=(0,u.useState)(`All`),[i,h]=(0,u.useState)(``),g=d.filter(t=>(e===`All`||t.kind===e)&&`${t.name} ${t.description}`.toLowerCase().includes(i.toLowerCase()));return(0,p.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,p.jsx)(r,{title:`Creative library`,description:`Find a direction before you build. A curated starting point for people with ideas, with guidance, components and real design references.`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`fieldset`,{className:`flex flex-wrap gap-1`,"aria-label":`Resource category`,children:m.map(r=>(0,p.jsx)(t,{variant:r===e?`primary`:`ghost`,onClick:()=>n(r),"aria-pressed":r===e,children:r},r))}),(0,p.jsxs)(`label`,{htmlFor:`creative-search`,className:`relative ml-auto w-full max-w-xs`,children:[(0,p.jsx)(`span`,{className:`sr-only`,children:`Find a creative resource`}),(0,p.jsx)(a,{"aria-hidden":!0,className:`absolute top-2.5 left-2.5 size-3.5 text-muted`}),(0,p.jsx)(l,{id:`creative-search`,value:i,onChange:e=>h(e.target.value),placeholder:`Find a resource…`,className:`pl-8`})]})]}),(0,p.jsx)(`div`,{className:`grid gap-x-8 md:grid-cols-2 xl:grid-cols-3`,children:g.map(e=>(0,p.jsxs)(`article`,{className:`flex flex-col items-start border-t border-line py-6`,children:[(0,p.jsx)(`p`,{className:`text-[12px] text-accent-text`,children:e.kind}),(0,p.jsx)(`h2`,{className:`mt-3 text-[21px] font-medium tracking-tight text-fg`,children:e.name}),(0,p.jsx)(`p`,{className:`mt-3 max-w-sm flex-1 text-[13px] leading-6 text-muted`,children:e.description}),(0,p.jsx)(`p`,{className:`mt-4 text-[11px] leading-5 text-muted`,children:e.access}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-4`,children:[(0,p.jsx)(t,{size:`sm`,onClick:()=>c(`/?brief=${encodeURIComponent(f(e))}`),children:`Use in a goal`}),(0,p.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[12px] text-fg-2 hover:text-fg`,children:[`Visit source`,(0,p.jsx)(s,{"aria-hidden":!0,className:`size-3`})]})]})]},e.id))}),g.length===0&&(0,p.jsx)(`p`,{role:`status`,className:`py-8 text-[13px] text-muted`,children:`No resources match. Try another name or category.`}),(0,p.jsxs)(`div`,{className:`flex gap-3 border-t border-line pt-5 text-[12px] leading-6 text-muted`,children:[(0,p.jsx)(o,{"aria-hidden":!0,className:`mt-1 size-4 shrink-0`}),(0,p.jsx)(`p`,{children:`These are curated references, not installed plugins. “Use in a goal” prepares a brief for your agent; it does not run code, fetch a site or connect an account. DaveCode includes its own design-quality guidance by default. Third-party resources keep their own licenses and access requirements.`})]})]})}export{h as Library};
1
+ import{c as e,i as t,s as n,t as r,u as i}from"./Panel-Du40pM7n.js";import{A as a,U as o,W as s,x as c}from"./index-BCi-Vuvh.js";import{n as l}from"./Field-OXMnT9Tb.js";var u=i(e(),1),d=[{id:`ponytail`,name:`Ponytail`,kind:`Guidance`,url:`https://github.com/DietrichGebert/ponytail`,description:`Reuse what exists and keep implementations small. Useful for avoiding unnecessary code; it does not supply an art direction.`,access:`Repository; review license before reuse`},{id:`anti-slop`,name:`Anti Slop`,kind:`Guidance`,url:`https://github.com/miqdadbadjuber/anti-slop`,description:`Review recurring generic patterns in interface design, copy and generated code.`,access:`Repository; review license before reuse`},{id:`impeccable`,name:`Impeccable`,kind:`Guidance`,url:`https://github.com/pbakaus/impeccable`,description:`Design guidance for defining a product direction and refining the finished interface.`,access:`Repository; review license before reuse`},{id:`anti-ui-slop`,name:`Anti UI Slop`,kind:`Guidance`,url:`https://github.com/tuanphung2005/anti-ui-slop`,description:`A separate UI-focused ruleset. Compare its constraints with your brief rather than combining conflicting rules.`,access:`Repository; review license before reuse`},{id:`shadcn`,name:`shadcn/ui`,kind:`Components`,url:`https://github.com/shadcn-ui/ui`,description:`Own and adapt the component source. Start from accessible building blocks and make them fit your identity.`,access:`MIT component library`},{id:`radix`,name:`Radix Primitives`,kind:`Components`,url:`https://github.com/radix-ui/primitives`,description:`Accessible interaction primitives for dialogs, menus and other complex interface behaviors.`,access:`MIT component library`},{id:`motion`,name:`Motion`,kind:`Components`,url:`https://github.com/motiondivision/motion`,description:`Animation for React and JavaScript. Use motion to explain a change, with a reduced-motion alternative.`,access:`MIT library; optional paid products are separate`},{id:`r3f`,name:`React Three Fiber`,kind:`Components`,url:`https://github.com/pmndrs/react-three-fiber`,description:`A React renderer for Three.js. Consider it when a real 3D experience serves the idea.`,access:`MIT library; assets have their own licenses`},{id:`awwwards`,name:`Awwwards`,kind:`Inspiration`,url:`https://www.awwwards.com/`,description:`Explore expressive websites and the studios behind them. Study composition and interaction, then create your own interpretation.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`siteinspire`,name:`Siteinspire`,kind:`Inspiration`,url:`https://www.siteinspire.com/`,description:`Find references by style, type and subject instead of starting from the same SaaS template.`,access:`Reference gallery; artwork is not licensed for copying`},{id:`freight`,name:`Studio Freight`,kind:`Inspiration`,url:`https://studiofreight.com/`,description:`A studio reference for thoughtful digital identity and web experiences.`,access:`Studio portfolio; reference only`},{id:`hf`,name:`Hugging Face Spaces`,kind:`AI tools`,url:`https://huggingface.co/spaces`,description:`Discover interactive AI demos. Check each Space, model license and compute requirements before using it in your project.`,access:`Availability, model licenses and costs vary`}];function f(e){return`Help me create a distinctive interface for this project. Use ${e.name} (${e.url}) as a reference if you can access it. Its purpose: ${e.description}\n\nFirst identify the audience, intended outcome and existing design system. Propose a specific visual direction and a short design brief: typography, palette, composition, imagery, interaction and mobile behavior. Preserve the project stack, cover loading/empty/error states, and verify the rendered result. Use references as inspiration and respect their licenses. Do not claim to have read, installed or connected a resource without checking. Explain any external dependency before adding it.`}var p=n(),m=[`All`,`Guidance`,`Components`,`Inspiration`,`AI tools`];function h(){let[e,n]=(0,u.useState)(`All`),[i,h]=(0,u.useState)(``),g=d.filter(t=>(e===`All`||t.kind===e)&&`${t.name} ${t.description}`.toLowerCase().includes(i.toLowerCase()));return(0,p.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,p.jsx)(r,{title:`Creative library`,description:`Find a direction before you build. A curated starting point for people with ideas, with guidance, components and real design references.`}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,p.jsx)(`fieldset`,{className:`flex flex-wrap gap-1`,"aria-label":`Resource category`,children:m.map(r=>(0,p.jsx)(t,{variant:r===e?`primary`:`ghost`,onClick:()=>n(r),"aria-pressed":r===e,children:r},r))}),(0,p.jsxs)(`label`,{htmlFor:`creative-search`,className:`relative ml-auto w-full max-w-xs`,children:[(0,p.jsx)(`span`,{className:`sr-only`,children:`Find a creative resource`}),(0,p.jsx)(a,{"aria-hidden":!0,className:`absolute top-2.5 left-2.5 size-3.5 text-muted`}),(0,p.jsx)(l,{id:`creative-search`,value:i,onChange:e=>h(e.target.value),placeholder:`Find a resource…`,className:`pl-8`})]})]}),(0,p.jsx)(`div`,{className:`grid gap-x-8 md:grid-cols-2 xl:grid-cols-3`,children:g.map(e=>(0,p.jsxs)(`article`,{className:`flex flex-col items-start border-t border-line py-6`,children:[(0,p.jsx)(`p`,{className:`text-[12px] text-accent-text`,children:e.kind}),(0,p.jsx)(`h2`,{className:`mt-3 text-[21px] font-medium tracking-tight text-fg`,children:e.name}),(0,p.jsx)(`p`,{className:`mt-3 max-w-sm flex-1 text-[13px] leading-6 text-muted`,children:e.description}),(0,p.jsx)(`p`,{className:`mt-4 text-[11px] leading-5 text-muted`,children:e.access}),(0,p.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-4`,children:[(0,p.jsx)(t,{size:`sm`,onClick:()=>c(`/?brief=${encodeURIComponent(f(e))}`),children:`Use in a goal`}),(0,p.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[12px] text-fg-2 hover:text-fg`,children:[`Visit source`,(0,p.jsx)(s,{"aria-hidden":!0,className:`size-3`})]})]})]},e.id))}),g.length===0&&(0,p.jsx)(`p`,{role:`status`,className:`py-8 text-[13px] text-muted`,children:`No resources match. Try another name or category.`}),(0,p.jsxs)(`div`,{className:`flex gap-3 border-t border-line pt-5 text-[12px] leading-6 text-muted`,children:[(0,p.jsx)(o,{"aria-hidden":!0,className:`mt-1 size-4 shrink-0`}),(0,p.jsx)(`p`,{children:`These are curated references, not installed plugins. “Use in a goal” prepares a brief for your agent; it does not run code, fetch a site or connect an account. DaveCode includes its own design-quality guidance by default. Third-party resources keep their own licenses and access requirements.`})]})]})}export{h as Library};
@@ -1,5 +1,5 @@
1
- import{a as e,c as t,o as n,s as r,u as i}from"./Panel-B9tSgX6l.js";var a={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};a.node;var o=n(a);function s(e,t){this.v=e,this.k=t}function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(Array.isArray(e))return e}function u(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(e,t){return l(e)||u(e,t)||p(e,t)||d()}function p(e,t){if(e){if(typeof e==`string`)return c(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function m(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,c=o instanceof s;Promise.resolve(c?o.v:o).then(function(n){if(c){var s=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(s,n);n=e[s](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}m.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},m.prototype.next=function(e){return this._invoke(`next`,e)},m.prototype.throw=function(e){return this._invoke(`throw`,e)},m.prototype.return=function(e){return this._invoke(`return`,e)};var ee=Object.entries,te=Object.setPrototypeOf,ne=Object.isFrozen,re=Object.getPrototypeOf,ie=Object.getOwnPropertyDescriptor,h=Object.freeze,g=Object.seal,ae=Object.create,oe=typeof Reflect<`u`&&Reflect,_=oe.apply,se=oe.construct;h||=function(e){return e},g||=function(e){return e},_||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},se||=function(e){return new e(...[...arguments].slice(1))};var ce=C(Array.prototype.forEach);Array.prototype.indexOf;var le=C(Array.prototype.lastIndexOf),ue=C(Array.prototype.pop),de=C(Array.prototype.push);Array.prototype.slice;var fe=C(Array.prototype.splice),pe=Array.isArray,me=C(String.prototype.toLowerCase),he=C(String.prototype.toString),ge=C(String.prototype.match),_e=C(String.prototype.replace),ve=C(String.prototype.indexOf),ye=C(String.prototype.trim),be=C(Number.prototype.toString),xe=C(Boolean.prototype.toString),Se=typeof BigInt>`u`?null:C(BigInt.prototype.toString),v=typeof Symbol>`u`?null:C(Symbol.prototype.toString),y=C(Object.prototype.hasOwnProperty),b=C(Object.prototype.toString),x=C(RegExp.prototype.test),S=Ce(TypeError);function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return _(e,t,n)}}function Ce(e){return function(){return se(e,[...arguments])}}function w(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:me;if(te&&te(e,null),!pe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function we(e){for(let t=0;t<e.length;t++)y(e,t)||(e[t]=null);return e}function T(e){let t=ae(null);for(let r of ee(e)){var n=f(r,2);let i=n[0],a=n[1];y(e,i)&&(t[i]=pe(a)?we(a):a&&typeof a==`object`&&a.constructor===Object?T(a):a)}return t}function Te(e){switch(typeof e){case`string`:return e;case`number`:return be(e);case`boolean`:return xe(e);case`bigint`:return Se?Se(e):`0`;case`symbol`:return v?v(e):`Symbol()`;case`undefined`:return b(e);case`function`:case`object`:{if(e===null)return b(e);let t=e,n=E(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:b(e)}return b(e)}default:return b(e)}}function E(e,t){for(;e!==null;){let n=ie(e,t);if(n){if(n.get)return C(n.get);if(typeof n.value==`function`)return C(n.value)}e=re(e)}function n(){return null}return n}function Ee(e){try{return x(e,``),!0}catch{return!1}}var De=h(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Oe=h(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ke=h([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ae=h([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),je=h(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Me=h([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ne=h([`#text`]),Pe=h(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fe=h(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ie=h(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Le=h([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Re=g(/{{[\w\W]*|^[\w\W]*}}/g),ze=g(/<%[\w\W]*|^[\w\W]*%>/g),Be=g(/\${[\w\W]*/g),Ve=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),He=g(/^aria-[\-\w]+$/),Ue=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),We=g(/^(?:\w+script|data):/i),Ge=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ke=g(/^html$/i),qe=g(/^[a-z][.\w]*(-[.\w]+)+$/i),Je=g(/<[/\w!]/g),Ye=g(/<[/\w]/g),Xe=g(/<\/no(script|embed|frames)/i),Ze=g(/\/>/i),D={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qe=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],$e=h(w({},Qe)),et=function(){let e={};return ce(Qe,t=>{e[t]=g(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),h(e)}(),tt=function(){return typeof window>`u`?null:window},nt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},rt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},O=function(e,t,n,r){return y(e,t)&&pe(e[t])?w(r.base?T(r.base):{},e[t],r.transform):n},it=function(e,t,n){let r=y(e,t)?e[t]:void 0;return r&&typeof r==`object`?T(r):n()};function at(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt(),t=e=>at(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==D.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=E(d,`cloneNode`),p=E(d,`remove`),m=E(d,`removeAttributeNode`),te=E(d,`nextSibling`),ne=E(d,`childNodes`),re=E(d,`parentNode`),ie=E(d,`shadowRoot`),oe=E(d,`attributes`),_=o&&o.prototype?E(o.prototype,`nodeType`):null,se=o&&o.prototype?E(o.prototype,`nodeName`):null,be=o&&o.prototype?E(o.prototype,`ownerDocument`):null,xe=function(e){return _?_(e):e.nodeType},Se=function(e){return se?se(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,b=``,C,Ce=!1,we=0,Qe=function(){if(we>0)throw S(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ot=function(e){Qe(),we++;try{return v.createHTML(e)}finally{we--}},st=function(e){Qe(),we++;try{return v.createScriptURL(e)}finally{we--}},ct=function(){return Ce||=(C=nt(u,i),!0),C},lt=n,k=lt.implementation,A=lt.createNodeIterator,j=lt.createDocumentFragment,ut=lt.getElementsByTagName,M=r.importNode,N=rt();t.isSupported=typeof ee==`function`&&typeof re==`function`&&k&&k.createHTMLDocument!==void 0;let dt=Re,ft=ze,pt=Be,mt=Ve,ht=He,gt=We,_t=Ge,vt=qe,yt=Ue,P=null,bt=w({},[...De,...Oe,...ke,...je,...Ne]),F=null,xt=w({},[...Pe,...Fe,...Ie,...Le]),I=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,St=null,R=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ct=!0,wt=!0,Tt=!1,Et=!0,z=!1,Dt=!0,Ot=!1,kt=!1,At=null,jt=null,B=!1,V=!1,H=!1,Mt=!1,Nt=!0,Pt=!1,Ft=`user-content-`,It=!0,Lt=!1,U={},Rt=null,zt=w({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Bt=null,Vt=w({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ht=null,Ut=w({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Wt=`http://www.w3.org/1998/Math/MathML`,Gt=`http://www.w3.org/2000/svg`,W=`http://www.w3.org/1999/xhtml`,Kt=W,qt=!1,Jt=null,Yt=w({},[Wt,Gt,W],he),Xt=h([`mi`,`mo`,`mn`,`ms`,`mtext`]),Zt=w({},Xt),Qt=h([`annotation-xml`]),$t=w({},Qt),en=w({},[`title`,`style`,`font`,`a`,`script`]),tn=null,nn=[`application/xhtml+xml`,`text/html`],G=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;(!e||typeof e!=`object`)&&(e={}),e=T(e),tn=nn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,G=tn===`application/xhtml+xml`?he:me,P=O(e,`ALLOWED_TAGS`,bt,{transform:G}),F=O(e,`ALLOWED_ATTR`,xt,{transform:G}),Jt=O(e,`ALLOWED_NAMESPACES`,Yt,{transform:he}),Ht=O(e,`ADD_URI_SAFE_ATTR`,Ut,{transform:G,base:Ut}),Bt=O(e,`ADD_DATA_URI_TAGS`,Vt,{transform:G,base:Vt}),Rt=O(e,`FORBID_CONTENTS`,zt,{transform:G}),L=O(e,`FORBID_TAGS`,T({}),{transform:G}),St=O(e,`FORBID_ATTR`,T({}),{transform:G}),U=y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?T(e.USE_PROFILES):e.USE_PROFILES:!1,Ct=e.ALLOW_ARIA_ATTR!==!1,wt=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Et=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=e.SAFE_FOR_TEMPLATES||!1,Dt=e.SAFE_FOR_XML!==!1,Ot=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,H=e.RETURN_DOM_FRAGMENT||!1,Mt=e.RETURN_TRUSTED_TYPE||!1,B=e.FORCE_BODY||!1,Nt=e.SANITIZE_DOM!==!1,Pt=e.SANITIZE_NAMED_PROPS||!1,It=e.KEEP_CONTENT!==!1,Lt=e.IN_PLACE||!1,yt=Ee(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ue,Kt=typeof e.NAMESPACE==`string`?e.NAMESPACE:W,Zt=it(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>w({},Xt)),$t=it(e,`HTML_INTEGRATION_POINTS`,()=>w({},Qt));let t=it(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(I=ae(null),y(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),y(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),g(I),z&&(wt=!1),H&&(V=!0),U&&(P=w({},Ne),F=ae(null),U.html===!0&&(w(P,De),w(F,Pe)),U.svg===!0&&(w(P,Oe),w(F,Fe),w(F,Le)),U.svgFilters===!0&&(w(P,ke),w(F,Fe),w(F,Le)),U.mathMl===!0&&(w(P,je),w(F,Ie),w(F,Le))),R.tagCheck=null,R.attributeCheck=null,y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:pe(e.ADD_TAGS)&&(P===bt&&(P=T(P)),w(P,e.ADD_TAGS,G))),y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:pe(e.ADD_ATTR)&&(F===xt&&(F=T(F)),w(F,e.ADD_ATTR,G))),y(e,`ADD_FORBID_CONTENTS`)&&pe(e.ADD_FORBID_CONTENTS)&&(Rt===zt&&(Rt=T(Rt)),w(Rt,e.ADD_FORBID_CONTENTS,G)),It&&(P[`#text`]=!0),Ot&&w(P,[`html`,`head`,`body`]),P.table&&(w(P,[`tbody`]),delete L.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{b=ot(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,b=``):(v===void 0&&(v=ct()),v&&typeof b==`string`&&(b=ot(``)));h&&h(e),rn=e},cn=w({},[...Oe,...ke,...Ae]),ln=w({},[...je,...Me]),un=function(e,t,n){return t.namespaceURI===W?e===`svg`:t.namespaceURI===Wt?e===`svg`&&(n===`annotation-xml`||Zt[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===W?e===`math`:t.namespaceURI===Gt?e===`math`&&$t[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Gt&&!$t[n]||t.namespaceURI===Wt&&!Zt[n]?!1:!ln[e]&&(en[e]||!cn[e])},pn=function(e){let t=re(e);(!t||!t.tagName)&&(t={namespaceURI:Kt,tagName:`template`});let n=me(e.tagName),r=me(t.tagName);return Jt[e.namespaceURI]?e.namespaceURI===Gt?un(n,t,r):e.namespaceURI===Wt?dn(n,t,r):e.namespaceURI===W?fn(n,t,r):!!(tn===`application/xhtml+xml`&&Jt[e.namespaceURI]):!1},K=function(e){de(t.removed,{element:e});try{re(e).removeChild(e)}catch{if(p(e),!re(e))throw S(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},q=function(e){_n(e);let t=ne(e);if(t){let e=[];ce(t,t=>{de(e,t)}),ce(e,e=>{try{p(e)}catch{}})}let n=oe(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&mn(e,r,i)}},hn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(V||H)try{K(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gn=function(e){let t=oe(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||F[G(i)]||mn(e,r,i)}},_n=function(e){let t=[e];for(;t.length>0;){let e=t.pop();xe(e)===D.element&&gn(e);let n=ne(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},J=function(e,t){return Dt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},vn=function(e){if(!Dt)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=xe(e);if(n===D.processingInstruction||n===D.comment&&x(Ye,e.data)){try{p(e)}catch{}continue}if(n===D.element){let t=e,n=G(Se(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&J(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=ne(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},yn=function(e){let t=null,r=null;if(B)e=`<remove></remove>`+e;else{let t=ge(e,/^[\r\n\t ]+/);r=t&&t[0]}tn===`application/xhtml+xml`&&Kt===W&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?ot(e):e;if(Kt===W)try{t=new l().parseFromString(i,tn)}catch{}if(!t||!t.documentElement){t=k.createDocument(Kt,`template`,null);try{t.documentElement.innerHTML=qt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Kt===W?ut.call(t,Ot?`html`:`body`)[0]:Ot?t.documentElement:a},bn=function(e){let t=be?be(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},xn=function(e){return e=_e(e,dt,` `),e=_e(e,ft,` `),e=_e(e,pt,` `),e},Sn=function(e){e.normalize();let t=be?be(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=xn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ce(i,e=>{wn(e.content)&&Sn(e.content)})},Cn=function(e){let t=se?se(e):null;return typeof t!=`string`||G(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==oe(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==_(e)||e.childNodes!==ne(e)},wn=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return _(e)===D.documentFragment}catch{return!1}},Y=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return typeof _(e)==`number`}catch{return!1}};function X(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,rn)})}let Tn=function(e,t){return!!(Dt&&e.hasChildNodes()&&!Y(e.firstElementChild)&&x(Je,e.textContent)&&x(Je,e.innerHTML)||Dt&&e.namespaceURI===W&&$e[t]&&(Y(e.firstElementChild)||typeof e.textContent==`string`&&x(et[t],e.textContent))||e.nodeType===D.processingInstruction||Dt&&e.nodeType===D.comment&&x(Ye,e.data))},En=function(e,t){return e instanceof RegExp?x(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Z=function(e,t,n){if(!L[t]&&An(t)&&En(I.tagNameCheck,t))return!1;if(It&&!Rt[t]){let t=re(e),r=ne(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return K(e),!0},Dn=function(e,t,n,r){return e.length===0?t:t===n||t===r?T(t):t},Q=function(e,t){return e===t||re(e)!==null?!1:(Lt&&_n(e),!0)},$=function(e,n){if(X(N.beforeSanitizeElements,e,null),Q(e,n))return!0;if(Cn(e))return K(e),!0;let r=G(Se(e));if(P=Dn(N.uponSanitizeElement,P,bt,At),X(N.uponSanitizeElement,e,{tagName:r,allowedTags:P}),Q(e,n))return!0;if(Tn(e,r))return K(e),!0;if(L[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!P[r]){let t=Z(e,r,n);return t===!1&&(X(N.afterSanitizeElements,e,null),Q(e,n))?!0:t}if(xe(e)===D.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(Xe,e.innerHTML))return K(e),!0;if(z&&e.nodeType===D.text){let n=xn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return X(N.afterSanitizeElements,e,null),Q(e,n)},On=function(e,t,r){if(St[t]||J(t,e)||Nt&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=F[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);return wt&&x(mt,t)||Ct&&x(ht,t)?!0:i?Ht[t]||x(yt,_e(r,_t,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ve(r,`data:`)===0&&Bt[e]||Tt&&!x(gt,_e(r,_t,``))?!0:!r:An(e)&&En(I.tagNameCheck,e)&&En(I.attributeNameCheck,t,e)||t===`is`&&I.allowCustomizedBuiltInElements&&En(I.tagNameCheck,r)},kn=w({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[me(e)]&&x(vt,e)},jn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ot(r);case`TrustedScriptURL`:return st(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Cn(e)||(K(e),!1)}catch{return hn(t,e),!1}},Nn=function(e,n){if(X(N.beforeSanitizeAttributes,e,null),Q(e,n))return;let r=e.attributes;if(!r||Cn(e))return;F=Dn(N.uponSanitizeAttribute,F,xt,jt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},a=r.length,o=G(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=G(s),d=l,f=s===`value`?d:ye(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,X(N.uponSanitizeAttribute,e,i),f=i.attrValue,Pt&&(u===`id`||u===`name`)&&ve(f,Ft)!==0&&(hn(s,e,n),f=Ft+f,p=!0),Dt&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){hn(s,e,n);continue}if(u===`attributename`&&ge(f,`href`)){hn(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){hn(s,e,n);continue}if(!Et&&x(Ze,f)){hn(s,e,n);continue}if(z&&(f=xn(f)),!On(o,u,f)){hn(s,e,n);continue}f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&ue(t.removed)}}X(N.afterSanitizeAttributes,e,null),Q(e,n)},Pn=function(e){let t=null,n=bn(e);for(X(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(X(N.uponSanitizeShadowNode,t,null),$(t,e),Nn(t,e),wn(t.content)&&Pn(t.content),xe(t)===D.element){let e=ie(t);wn(e)&&(Fn(e),Pn(e))}X(N.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=xe(n)===D.element,i=ne(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=se?se(n):null;if(typeof e==`string`&&G(e)===`template`){let e=n.content;wn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ie(n);wn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(qt=!e,qt&&(e=`<!-->`),typeof e!=`string`&&!Y(e)&&(e=Te(e),typeof e!=`string`))throw S(`dirty is not a string, aborting`);if(!t.isSupported)return e;kt?(P=At,F=jt):sn(n),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(P=T(P)),N.uponSanitizeAttribute.length>0&&(F=T(F)),t.removed=[];let c=Lt&&typeof e!=`string`&&Y(e);if(c){vn(e);let t=Se(e);if(typeof t==`string`){let n=G(t);if(!P[n]||L[n])throw q(e),S(`root node is forbidden and cannot be sanitized in-place`)}if(Cn(e))throw q(e),S(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw q(e),t}}else if(Y(e))i=yn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===D.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!V&&!z&&!Ot&&e.indexOf(`<`)===-1)return v&&Mt?ot(e):e;if(i=yn(e),!i)return V?null:Mt?b:``}i&&B&&K(i.firstChild);let l=c?e:i;try{let e=bn(l);for(;o=e.nextNode();)$(o,l),Nn(o,l),wn(o.content)&&Pn(o.content)}catch(n){throw c&&(q(e),ce(t.removed,e=>{e.element&&_n(e.element)})),n}if(c){let n=!1;if(ce(t.removed,t=>{t.element&&(t.element===e&&(n=!0),_n(t.element))}),n)throw S(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return z&&Sn(e),e}if(V){if(z&&Sn(i),H)for(s=j.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(F.shadowroot||F.shadowrootmode)&&(s=M.call(r,s,!0)),s}let u=Ot?i.outerHTML:i.innerHTML;return Ot&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x(Ke,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
1
+ import{a as e,c as t,o as n,s as r,u as i}from"./Panel-Du40pM7n.js";var a={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};a.node;var o=n(a);function s(e,t){this.v=e,this.k=t}function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(Array.isArray(e))return e}function u(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function d(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(e,t){return l(e)||u(e,t)||p(e,t)||d()}function p(e,t){if(e){if(typeof e==`string`)return c(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function m(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,c=o instanceof s;Promise.resolve(c?o.v:o).then(function(n){if(c){var s=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(s,n);n=e[s](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}m.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},m.prototype.next=function(e){return this._invoke(`next`,e)},m.prototype.throw=function(e){return this._invoke(`throw`,e)},m.prototype.return=function(e){return this._invoke(`return`,e)};var ee=Object.entries,te=Object.setPrototypeOf,ne=Object.isFrozen,re=Object.getPrototypeOf,ie=Object.getOwnPropertyDescriptor,h=Object.freeze,g=Object.seal,ae=Object.create,oe=typeof Reflect<`u`&&Reflect,_=oe.apply,se=oe.construct;h||=function(e){return e},g||=function(e){return e},_||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},se||=function(e){return new e(...[...arguments].slice(1))};var ce=C(Array.prototype.forEach);Array.prototype.indexOf;var le=C(Array.prototype.lastIndexOf),ue=C(Array.prototype.pop),de=C(Array.prototype.push);Array.prototype.slice;var fe=C(Array.prototype.splice),pe=Array.isArray,me=C(String.prototype.toLowerCase),he=C(String.prototype.toString),ge=C(String.prototype.match),_e=C(String.prototype.replace),ve=C(String.prototype.indexOf),ye=C(String.prototype.trim),be=C(Number.prototype.toString),xe=C(Boolean.prototype.toString),Se=typeof BigInt>`u`?null:C(BigInt.prototype.toString),v=typeof Symbol>`u`?null:C(Symbol.prototype.toString),y=C(Object.prototype.hasOwnProperty),b=C(Object.prototype.toString),x=C(RegExp.prototype.test),S=Ce(TypeError);function C(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return _(e,t,n)}}function Ce(e){return function(){return se(e,[...arguments])}}function w(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:me;if(te&&te(e,null),!pe(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ne(t)||(t[r]=e),i=e)}e[i]=!0}return e}function we(e){for(let t=0;t<e.length;t++)y(e,t)||(e[t]=null);return e}function T(e){let t=ae(null);for(let r of ee(e)){var n=f(r,2);let i=n[0],a=n[1];y(e,i)&&(t[i]=pe(a)?we(a):a&&typeof a==`object`&&a.constructor===Object?T(a):a)}return t}function Te(e){switch(typeof e){case`string`:return e;case`number`:return be(e);case`boolean`:return xe(e);case`bigint`:return Se?Se(e):`0`;case`symbol`:return v?v(e):`Symbol()`;case`undefined`:return b(e);case`function`:case`object`:{if(e===null)return b(e);let t=e,n=E(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:b(e)}return b(e)}default:return b(e)}}function E(e,t){for(;e!==null;){let n=ie(e,t);if(n){if(n.get)return C(n.get);if(typeof n.value==`function`)return C(n.value)}e=re(e)}function n(){return null}return n}function Ee(e){try{return x(e,``),!0}catch{return!1}}var De=h(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Oe=h(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ke=h([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ae=h([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),je=h(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Me=h([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ne=h([`#text`]),Pe=h(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Fe=h(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ie=h(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Le=h([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Re=g(/{{[\w\W]*|^[\w\W]*}}/g),ze=g(/<%[\w\W]*|^[\w\W]*%>/g),Be=g(/\${[\w\W]*/g),Ve=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),He=g(/^aria-[\-\w]+$/),Ue=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),We=g(/^(?:\w+script|data):/i),Ge=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ke=g(/^html$/i),qe=g(/^[a-z][.\w]*(-[.\w]+)+$/i),Je=g(/<[/\w!]/g),Ye=g(/<[/\w]/g),Xe=g(/<\/no(script|embed|frames)/i),Ze=g(/\/>/i),D={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qe=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],$e=h(w({},Qe)),et=function(){let e={};return ce(Qe,t=>{e[t]=g(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),h(e)}(),tt=function(){return typeof window>`u`?null:window},nt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},rt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},O=function(e,t,n,r){return y(e,t)&&pe(e[t])?w(r.base?T(r.base):{},e[t],r.transform):n},it=function(e,t,n){let r=y(e,t)?e[t]:void 0;return r&&typeof r==`object`?T(r):n()};function at(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tt(),t=e=>at(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==D.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=E(d,`cloneNode`),p=E(d,`remove`),m=E(d,`removeAttributeNode`),te=E(d,`nextSibling`),ne=E(d,`childNodes`),re=E(d,`parentNode`),ie=E(d,`shadowRoot`),oe=E(d,`attributes`),_=o&&o.prototype?E(o.prototype,`nodeType`):null,se=o&&o.prototype?E(o.prototype,`nodeName`):null,be=o&&o.prototype?E(o.prototype,`ownerDocument`):null,xe=function(e){return _?_(e):e.nodeType},Se=function(e){return se?se(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,b=``,C,Ce=!1,we=0,Qe=function(){if(we>0)throw S(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ot=function(e){Qe(),we++;try{return v.createHTML(e)}finally{we--}},st=function(e){Qe(),we++;try{return v.createScriptURL(e)}finally{we--}},ct=function(){return Ce||=(C=nt(u,i),!0),C},lt=n,k=lt.implementation,A=lt.createNodeIterator,j=lt.createDocumentFragment,ut=lt.getElementsByTagName,M=r.importNode,N=rt();t.isSupported=typeof ee==`function`&&typeof re==`function`&&k&&k.createHTMLDocument!==void 0;let dt=Re,ft=ze,pt=Be,mt=Ve,ht=He,gt=We,_t=Ge,vt=qe,yt=Ue,P=null,bt=w({},[...De,...Oe,...ke,...je,...Ne]),F=null,xt=w({},[...Pe,...Fe,...Ie,...Le]),I=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),L=null,St=null,R=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ct=!0,wt=!0,Tt=!1,Et=!0,z=!1,Dt=!0,Ot=!1,kt=!1,At=null,jt=null,B=!1,V=!1,H=!1,Mt=!1,Nt=!0,Pt=!1,Ft=`user-content-`,It=!0,Lt=!1,U={},Rt=null,zt=w({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Bt=null,Vt=w({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ht=null,Ut=w({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Wt=`http://www.w3.org/1998/Math/MathML`,Gt=`http://www.w3.org/2000/svg`,W=`http://www.w3.org/1999/xhtml`,Kt=W,qt=!1,Jt=null,Yt=w({},[Wt,Gt,W],he),Xt=h([`mi`,`mo`,`mn`,`ms`,`mtext`]),Zt=w({},Xt),Qt=h([`annotation-xml`]),$t=w({},Qt),en=w({},[`title`,`style`,`font`,`a`,`script`]),tn=null,nn=[`application/xhtml+xml`,`text/html`],G=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;e&&typeof e==`object`||(e={}),e=T(e),tn=nn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,G=tn===`application/xhtml+xml`?he:me,P=O(e,`ALLOWED_TAGS`,bt,{transform:G}),F=O(e,`ALLOWED_ATTR`,xt,{transform:G}),Jt=O(e,`ALLOWED_NAMESPACES`,Yt,{transform:he}),Ht=O(e,`ADD_URI_SAFE_ATTR`,Ut,{transform:G,base:Ut}),Bt=O(e,`ADD_DATA_URI_TAGS`,Vt,{transform:G,base:Vt}),Rt=O(e,`FORBID_CONTENTS`,zt,{transform:G}),L=O(e,`FORBID_TAGS`,T({}),{transform:G}),St=O(e,`FORBID_ATTR`,T({}),{transform:G}),U=y(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?T(e.USE_PROFILES):e.USE_PROFILES:!1,Ct=e.ALLOW_ARIA_ATTR!==!1,wt=e.ALLOW_DATA_ATTR!==!1,Tt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Et=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=e.SAFE_FOR_TEMPLATES||!1,Dt=e.SAFE_FOR_XML!==!1,Ot=e.WHOLE_DOCUMENT||!1,V=e.RETURN_DOM||!1,H=e.RETURN_DOM_FRAGMENT||!1,Mt=e.RETURN_TRUSTED_TYPE||!1,B=e.FORCE_BODY||!1,Nt=e.SANITIZE_DOM!==!1,Pt=e.SANITIZE_NAMED_PROPS||!1,It=e.KEEP_CONTENT!==!1,Lt=e.IN_PLACE||!1,yt=Ee(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Ue,Kt=typeof e.NAMESPACE==`string`?e.NAMESPACE:W,Zt=it(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>w({},Xt)),$t=it(e,`HTML_INTEGRATION_POINTS`,()=>w({},Qt));let t=it(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(I=ae(null),y(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(I.tagNameCheck=t.tagNameCheck),y(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(I.attributeNameCheck=t.attributeNameCheck),y(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(I.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),g(I),z&&(wt=!1),H&&(V=!0),U&&(P=w({},Ne),F=ae(null),U.html===!0&&(w(P,De),w(F,Pe)),U.svg===!0&&(w(P,Oe),w(F,Fe),w(F,Le)),U.svgFilters===!0&&(w(P,ke),w(F,Fe),w(F,Le)),U.mathMl===!0&&(w(P,je),w(F,Ie),w(F,Le))),R.tagCheck=null,R.attributeCheck=null,y(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?R.tagCheck=e.ADD_TAGS:pe(e.ADD_TAGS)&&(P===bt&&(P=T(P)),w(P,e.ADD_TAGS,G))),y(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?R.attributeCheck=e.ADD_ATTR:pe(e.ADD_ATTR)&&(F===xt&&(F=T(F)),w(F,e.ADD_ATTR,G))),y(e,`ADD_FORBID_CONTENTS`)&&pe(e.ADD_FORBID_CONTENTS)&&(Rt===zt&&(Rt=T(Rt)),w(Rt,e.ADD_FORBID_CONTENTS,G)),It&&(P[`#text`]=!0),Ot&&w(P,[`html`,`head`,`body`]),P.table&&(w(P,[`tbody`]),delete L.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw S(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{b=ot(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,b=``):(v===void 0&&(v=ct()),v&&typeof b==`string`&&(b=ot(``)));h&&h(e),rn=e},cn=w({},[...Oe,...ke,...Ae]),ln=w({},[...je,...Me]),un=function(e,t,n){return t.namespaceURI===W?e===`svg`:t.namespaceURI===Wt?e===`svg`&&(n===`annotation-xml`||Zt[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===W?e===`math`:t.namespaceURI===Gt?e===`math`&&$t[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Gt&&!$t[n]||t.namespaceURI===Wt&&!Zt[n]?!1:!ln[e]&&(en[e]||!cn[e])},pn=function(e){let t=re(e);t&&t.tagName||(t={namespaceURI:Kt,tagName:`template`});let n=me(e.tagName),r=me(t.tagName);return Jt[e.namespaceURI]?e.namespaceURI===Gt?un(n,t,r):e.namespaceURI===Wt?dn(n,t,r):e.namespaceURI===W?fn(n,t,r):!!(tn===`application/xhtml+xml`&&Jt[e.namespaceURI]):!1},K=function(e){de(t.removed,{element:e});try{re(e).removeChild(e)}catch{if(p(e),!re(e))throw S(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},mn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},q=function(e){_n(e);let t=ne(e);if(t){let e=[];ce(t,t=>{de(e,t)}),ce(e,e=>{try{p(e)}catch{}})}let n=oe(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&mn(e,r,i)}},hn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(V||H)try{K(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},gn=function(e){let t=oe(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||F[G(i)]||mn(e,r,i)}},_n=function(e){let t=[e];for(;t.length>0;){let e=t.pop();xe(e)===D.element&&gn(e);let n=ne(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},J=function(e,t){return Dt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},vn=function(e){if(!Dt)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=xe(e);if(n===D.processingInstruction||n===D.comment&&x(Ye,e.data)){try{p(e)}catch{}continue}if(n===D.element){let t=e,n=G(Se(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&J(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=ne(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},yn=function(e){let t=null,r=null;if(B)e=`<remove></remove>`+e;else{let t=ge(e,/^[\r\n\t ]+/);r=t&&t[0]}tn===`application/xhtml+xml`&&Kt===W&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?ot(e):e;if(Kt===W)try{t=new l().parseFromString(i,tn)}catch{}if(!t||!t.documentElement){t=k.createDocument(Kt,`template`,null);try{t.documentElement.innerHTML=qt?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Kt===W?ut.call(t,Ot?`html`:`body`)[0]:Ot?t.documentElement:a},bn=function(e){let t=be?be(e):e.ownerDocument;return A.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},xn=function(e){return e=_e(e,dt,` `),e=_e(e,ft,` `),e=_e(e,pt,` `),e},Sn=function(e){e.normalize();let t=be?be(e):e.ownerDocument,n=A.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=xn(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&ce(i,e=>{wn(e.content)&&Sn(e.content)})},Cn=function(e){let t=se?se(e):null;return typeof t!=`string`||G(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==oe(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==_(e)||e.childNodes!==ne(e)},wn=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return _(e)===D.documentFragment}catch{return!1}},Y=function(e){if(!_||typeof e!=`object`||!e)return!1;try{return typeof _(e)==`number`}catch{return!1}};function X(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,rn)})}let Tn=function(e,t){return!!(Dt&&e.hasChildNodes()&&!Y(e.firstElementChild)&&x(Je,e.textContent)&&x(Je,e.innerHTML)||Dt&&e.namespaceURI===W&&$e[t]&&(Y(e.firstElementChild)||typeof e.textContent==`string`&&x(et[t],e.textContent))||e.nodeType===D.processingInstruction||Dt&&e.nodeType===D.comment&&x(Ye,e.data))},En=function(e,t){return e instanceof RegExp?x(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Z=function(e,t,n){if(!L[t]&&An(t)&&En(I.tagNameCheck,t))return!1;if(It&&!Rt[t]){let t=re(e),r=ne(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return K(e),!0},Dn=function(e,t,n,r){return e.length===0?t:t===n||t===r?T(t):t},Q=function(e,t){return e===t||re(e)!==null?!1:(Lt&&_n(e),!0)},$=function(e,n){if(X(N.beforeSanitizeElements,e,null),Q(e,n))return!0;if(Cn(e))return K(e),!0;let r=G(Se(e));if(P=Dn(N.uponSanitizeElement,P,bt,At),X(N.uponSanitizeElement,e,{tagName:r,allowedTags:P}),Q(e,n))return!0;if(Tn(e,r))return K(e),!0;if(L[r]||!(R.tagCheck instanceof Function&&R.tagCheck(r))&&!P[r]){let t=Z(e,r,n);return t===!1&&(X(N.afterSanitizeElements,e,null),Q(e,n))?!0:t}if(xe(e)===D.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&x(Xe,e.innerHTML))return K(e),!0;if(z&&e.nodeType===D.text){let n=xn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return X(N.afterSanitizeElements,e,null),Q(e,n)},On=function(e,t,r){if(St[t]||J(t,e)||Nt&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=F[t]||R.attributeCheck instanceof Function&&R.attributeCheck(t,e);return wt&&x(mt,t)||Ct&&x(ht,t)?!0:i?Ht[t]||x(yt,_e(r,_t,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ve(r,`data:`)===0&&Bt[e]||Tt&&!x(gt,_e(r,_t,``))?!0:!r:An(e)&&En(I.tagNameCheck,e)&&En(I.attributeNameCheck,t,e)||t===`is`&&I.allowCustomizedBuiltInElements&&En(I.tagNameCheck,r)},kn=w({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),An=function(e){return!kn[me(e)]&&x(vt,e)},jn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ot(r);case`TrustedScriptURL`:return st(r)}return r},Mn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Cn(e)||(K(e),!1)}catch{return hn(t,e),!1}},Nn=function(e,n){if(X(N.beforeSanitizeAttributes,e,null),Q(e,n))return;let r=e.attributes;if(!r||Cn(e))return;F=Dn(N.uponSanitizeAttribute,F,xt,jt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},a=r.length,o=G(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=G(s),d=l,f=s===`value`?d:ye(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,X(N.uponSanitizeAttribute,e,i),f=i.attrValue,Pt&&(u===`id`||u===`name`)&&ve(f,Ft)!==0&&(hn(s,e,n),f=Ft+f,p=!0),Dt&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&ge(f,`href`)?hn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Et&&x(Ze,f)?hn(s,e,n):(z&&(f=xn(f)),On(o,u,f)?(f=jn(o,u,c,f),f!==d&&Mn(e,s,c,f)&&p&&ue(t.removed)):hn(s,e,n)):hn(s,e,n))}X(N.afterSanitizeAttributes,e,null),Q(e,n)},Pn=function(e){let t=null,n=bn(e);for(X(N.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(X(N.uponSanitizeShadowNode,t,null),$(t,e),Nn(t,e),wn(t.content)&&Pn(t.content),xe(t)===D.element){let e=ie(t);wn(e)&&(Fn(e),Pn(e))}X(N.afterSanitizeShadowDOM,e,null)},Fn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Pn(e.shadow);continue}let n=e.node,r=xe(n)===D.element,i=ne(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=se?se(n):null;if(typeof e==`string`&&G(e)===`template`){let e=n.content;wn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ie(n);wn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(qt=!e,qt&&(e=`<!-->`),typeof e!=`string`&&!Y(e)&&(e=Te(e),typeof e!=`string`))throw S(`dirty is not a string, aborting`);if(!t.isSupported)return e;kt?(P=At,F=jt):sn(n),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(P=T(P)),N.uponSanitizeAttribute.length>0&&(F=T(F)),t.removed=[];let c=Lt&&typeof e!=`string`&&Y(e);if(c){vn(e);let t=Se(e);if(typeof t==`string`){let n=G(t);if(!P[n]||L[n])throw q(e),S(`root node is forbidden and cannot be sanitized in-place`)}if(Cn(e))throw q(e),S(`root node is clobbered and cannot be sanitized in-place`);try{Fn(e)}catch(t){throw q(e),t}}else if(Y(e))i=yn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===D.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Fn(i);else{if(!V&&!z&&!Ot&&e.indexOf(`<`)===-1)return v&&Mt?ot(e):e;if(i=yn(e),!i)return V?null:Mt?b:``}i&&B&&K(i.firstChild);let l=c?e:i;try{let e=bn(l);for(;o=e.nextNode();)$(o,l),Nn(o,l),wn(o.content)&&Pn(o.content)}catch(n){throw c&&(q(e),ce(t.removed,e=>{e.element&&_n(e.element)})),n}if(c){let n=!1;if(ce(t.removed,t=>{t.element&&(t.element===e&&(n=!0),_n(t.element))}),n)throw S(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return z&&Sn(e),e}if(V){if(z&&Sn(i),H)for(s=j.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(F.shadowroot||F.shadowrootmode)&&(s=M.call(r,s,!0)),s}let u=Ot?i.outerHTML:i.innerHTML;return Ot&&P[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&x(Ke,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
3
3
  `+u),z&&(u=xn(u)),v&&Mt?ot(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),kt=!0,At=P,jt=F},t.clearConfig=function(){rn=null,kt=!1,At=null,jt=null,v=C,b=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=G(e),i=G(t);return On(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&y(N,e)&&de(N[e],t)},t.removeHook=function(e,t){if(y(N,e)){if(t!==void 0){let n=le(N[e],t);return n===-1?void 0:fe(N[e],n,1)[0]}return ue(N[e])}},t.removeHooks=function(e){y(N,e)&&(N[e]=[])},t.removeAllHooks=function(){N=rt()},t}var ot=at();function st(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ct=st();function lt(e){ct=e}var k={exec:()=>null};function A(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function j(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(M.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ut=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),M={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:A(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:A(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:A(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:A(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:A(e=>RegExp(`^ {0,${e}}(?:</?(?:${I})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:A(e=>RegExp(`^ {0,${e}}>`))},N=/^(?:[ \t]*(?:\n|$))+/,dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ft=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ht=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_t=j(gt).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),vt=j(gt).replace(/bull/g,ht).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,P=/^[^\n]+/,bt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,F=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,bt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xt=j(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ht).getRegex(),I=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,L=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,St=j(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,L).replace(`tag`,I).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R=e=>j(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),Ct=R(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),wt=R(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Tt={blockquote:j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,wt).getRegex(),code:dt,def:F,fences:ft,heading:mt,hr:pt,html:St,lheading:_t,list:xt,newline:N,paragraph:Ct,table:k,text:P},Et=j(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex(),z={...Tt,lheading:vt,table:Et,paragraph:j(yt).replace(`hr`,pt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Et).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,I).getRegex()},Dt={...Tt,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,L).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(yt).replace(`hr`,pt).replace(`heading`,` *#{1,6} *[^
4
4
  ]`).replace(`lheading`,_t).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ot=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,At=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,jt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,V=/[\s\p{P}\p{S}]/u,H=/[^\s\p{P}\p{S}]/u,Mt=j(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V).getRegex(),Nt=/[\p{Pi}\p{Ps}"']/u,Pt=/(?!~)[\p{P}\p{S}]/u,Ft=/(?!~)[\s\p{P}\p{S}]/u,It=/(?:[^\s\p{P}\p{S}]|~)/u,Lt=j(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ut?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),U=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Rt=j(U,`u`).replace(/punct/g,B).getRegex(),zt=j(U,`u`).replace(/punct/g,Pt).getRegex(),Bt=j(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Nt).replace(/punct/g,B).getRegex(),Vt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Ht=j(Vt,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Ut=j(Vt,`gu`).replace(/notPunctSpace/g,It).replace(/punctSpace/g,Ft).replace(/punct/g,Pt).getRegex(),Wt=j(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Gt=j(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),W=j(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Kt=j(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B).getRegex(),qt=j(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,H).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),Jt=j(/\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),Yt=j(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xt=j(L).replace(`(?:-->|$)`,`-->`).getRegex(),Zt=j(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Xt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qt=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,$t=j(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Qt).getRegex(),en=j(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,$t).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tn=j(/^!?\[(label)\]\[(ref)\]/).replace(`label`,$t).replace(`ref`,bt).getRegex(),nn=j(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,bt).getRegex(),G=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,rn=j(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Qt).getRegex(),an=j(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,j(/^!?\[(label)\]\[(ref)\]/).replace(`label`,rn).replace(`ref`,G).getRegex()).replace(`nolink`,j(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,G).getRegex()).getRegex(),on=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sn=j(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),cn={_backpedal:k,anyPunctuation:Jt,autolink:Yt,blockSkip:Lt,br:At,code:kt,del:k,delLDelim:k,delRDelim:k,emStrongLDelim:Rt,emStrongRDelimAst:Ht,emStrongRDelimUnd:Gt,escape:Ot,link:en,nolink:nn,punctuation:Mt,reflink:tn,reflinkSearch:an,tag:Zt,text:jt,url:k},ln={...cn,emStrongLDelim:Bt,emStrongRDelimAst:Wt,emStrongRDelimUnd:W,link:j(/^!?\[(label)\]\((.*?)\)/).replace(`label`,$t).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,$t).getRegex()},un={...cn,emStrongRDelimAst:Ut,emStrongLDelim:zt,delLDelim:Kt,delRDelim:qt,url:j(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,sn).replace(`protocol`,on).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:j(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,on).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},dn={...un,br:j(At).replace(`{2,}`,`*`).getRegex(),text:j(un.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},fn={normal:Tt,gfm:z,pedantic:Dt},pn={normal:cn,gfm:un,breaks:dn,pedantic:ln},K={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},mn=e=>K[e];function q(e,t){if(t){if(M.escapeTest.test(e))return e.replace(M.escapeReplace,mn)}else if(M.escapeTestNoEncode.test(e))return e.replace(M.escapeReplaceNoEncode,mn);return e}function hn(e){return e.replace(M.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function gn(e){try{e=encodeURI(e).replace(M.percentDecode,`%`)}catch{return null}return e}function _n(e,t){let n=e.replace(M.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(M.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(M.slashPipe,`|`);return n}function J(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function vn(e){let t=e.split(`
5
5
  `),n=t.length-1;for(;n>=0&&M.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
@@ -21,7 +21,7 @@ ${d.join(`
21
21
  `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
22
22
  `+e.join(`
23
23
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
24
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
24
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
25
25
  `,1)[0],l=t[1].length,u=this.options.pedantic?xn(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>xn(e,l)),d=e.split(`
26
26
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
27
27
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
@@ -38,16 +38,16 @@ ${d.join(`
38
38
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
39
39
  `)?``:`
40
40
  `)+i.raw,n.text+=`
41
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
41
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
42
42
  `)?``:`
43
43
  `)+i.raw,n.text+=`
44
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
44
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
45
45
  `)?``:`
46
46
  `)+i.raw,r.text+=`
47
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
47
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
48
48
  `)?``:`
49
49
  `)+i.raw,n.text+=`
50
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,yn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,yn(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Tn=class{options;parser;constructor(e){this.options=e||ct}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(M.notSpaceStart)?.[0],i=e?e.replace(M.endingNewline,``)+`
50
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,yn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,yn(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Tn=class{options;parser;constructor(e){this.options=e||ct}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(M.notSpaceStart)?.[0],i=e?e.replace(M.endingNewline,``)+`
51
51
  `:``;return r?`<pre><code class="language-`+q(r)+`">`+(n?i:q(i,!0))+`</code></pre>
52
52
  `:`<pre><code>`+(n?i:q(i,!0))+`</code></pre>
53
53
  `}blockquote({tokens:e}){return`<blockquote>
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function te(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ne(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else te(ne.bind(null,e))}var re={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ne,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),f=o(((e,t)=>{t.exports=d()})),p=c(u(),1),m=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function h(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:m(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var g=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},_=e=>{let t=g(e);return t.charAt(0).toUpperCase()+t.slice(1)},v=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),y={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function b(e){return e!=null}function x(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??y.width,a=e.size??e.height??y.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?v(...c):v(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??y[`stroke-width`])*Number(e.size??e.width??y.width)/Number(t.size??t.width??y.width):t.strokeWidth??y[`stroke-width`];return[`svg`,{...Object.entries(y).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&b(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&b(t.width)&&{[r(`width`)]:t.width},...`height`in t&&b(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function S(e,t={}){return x(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var C=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},w=(0,p.createContext)({}),T=()=>(0,p.useContext)(w),E=(0,p.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:y=`currentColor`,className:b=``}=T()??{},x=!!c||C(d),[w,E,D=[]]=S(u,{color:e??y,width:n??t??m,height:r??t??m,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:v(b,s),hasA11yProp:x,attributes:d});return(0,p.createElement)(w,{ref:f,...E},[...D.map(([e,t])=>(0,p.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function D(e,t=[],n=[]){let r=typeof e==`string`?h(e,t,n):e,i=(0,p.forwardRef)(({className:e,...t},n)=>(0,p.createElement)(E,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=_(r.name)),i}function O(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=O(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function k(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=O(e))&&(r&&(r+=` `),r+=t);return r}var ee=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},A=(e,t)=>({classGroupId:e,validator:t}),j=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),M=`-`,N=[],P=`arbitrary..`,F=e=>{let t=ne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return te(e);let n=e.split(M);return I(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ee(i,t):t:i||N}return n[e]||N}}},I=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=I(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(M):e.slice(t).join(M),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},te=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?P+r:void 0})(),ne=e=>{let{theme:t,classGroups:n}=e;return re(n,t)},re=(e,t)=>{let n=j();for(let r in e){let i=e[r];L(i,n,r,t)}return n},L=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];R(i,t,n,r)}},R=(e,t,n,r)=>{typeof e==`string`?ie(e,t,n):typeof e==`function`?ae(e,t,n,r):z(e,t,n,r)},ie=(e,t,n)=>{let r=e===``?t:oe(t,e);r.classGroupId=n},ae=(e,t,n,r)=>{se(e)?L(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(A(n,e)))},z=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];L(o,oe(t,a),n,r)}},oe=(e,t)=>{let n=e,r=t.split(M),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=j(),n.nextPart.set(t,i)),n=i}return n},se=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ce=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},B=`!`,V=`:`,le=[],ue=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),de=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===V){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(B)?(c=s.slice(0,-1),l=!0):s.startsWith(B)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ue(t,l,c,u)};if(t){let e=t+V,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ue(le,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},fe=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},pe=e=>({cache:ce(e.cacheSize),parseClassName:de(e),sortModifiers:fe(e),postfixLookupClassGroupIds:me(e),...F(e)}),me=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},he=/\s+/,ge=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(he),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+B:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},_e=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ve(n))&&(i&&(i+=` `),i+=r);return i},ve=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ve(e[r]))&&(n&&(n+=` `),n+=t);return n},ye=(e,...t)=>{let n,r,i,a,o=o=>(n=pe(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ge(e,n);return i(e,a),a};return a=o,(...e)=>a(_e(...e))},be=[],H=e=>{let t=t=>t[e]||be;return t.isThemeGetter=!0,t.themeKey=e,t},xe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Se=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ce=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,we=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Te=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,De=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,U=e=>Ce.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),G=e=>!!e&&Number.isInteger(Number(e)),ke=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),K=e=>we.test(e),Ae=()=>!0,je=e=>Te.test(e)&&!Ee.test(e),Me=()=>!1,Ne=e=>De.test(e),Pe=e=>Oe.test(e),Fe=e=>!q(e)&&!Y(e),Ie=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Le=e=>X(e,$e,Me),q=e=>xe.test(e),J=e=>X(e,et,je),Re=e=>X(e,tt,W),ze=e=>X(e,rt,Ae),Be=e=>X(e,nt,Me),Ve=e=>X(e,Ze,Me),He=e=>X(e,Qe,Pe),Ue=e=>X(e,it,Ne),Y=e=>Se.test(e),We=e=>Z(e,et),Ge=e=>Z(e,nt),Ke=e=>Z(e,Ze),qe=e=>Z(e,$e),Je=e=>Z(e,Qe),Ye=e=>Z(e,it,!0),Xe=e=>Z(e,rt,!0),X=(e,t,n)=>{let r=xe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Z=(e,t,n=!1)=>{let r=Se.exec(e);return r?r[1]?t(r[1]):n:!1},Ze=e=>e===`position`||e===`percentage`,Qe=e=>e===`image`||e===`url`,$e=e=>e===`length`||e===`size`||e===`bg-size`,et=e=>e===`length`,tt=e=>e===`number`,nt=e=>e===`family-name`,rt=e=>e===`number`||e===`weight`,it=e=>e===`shadow`,at=()=>{let e=H(`color`),t=H(`font`),n=H(`text`),r=H(`font-weight`),i=H(`tracking`),a=H(`leading`),o=H(`breakpoint`),s=H(`container`),c=H(`spacing`),l=H(`radius`),u=H(`shadow`),d=H(`inset-shadow`),f=H(`text-shadow`),p=H(`drop-shadow`),m=H(`blur`),h=H(`perspective`),g=H(`aspect`),_=H(`ease`),v=H(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,q,c],T=()=>[U,`full`,`auto`,...w()],E=()=>[G,`none`,`subgrid`,Y,q],D=()=>[`auto`,{span:[`full`,G,Y,q]},G,Y,q],O=()=>[G,`auto`,Y,q],k=()=>[`auto`,`min`,`max`,`fr`,Y,q],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[U,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[s,U,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[U,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,Y,q],I=()=>[...b(),Ke,Ve,{position:[Y,q]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,qe,Le,{size:[Y,q]}],re=()=>[ke,We,J],L=()=>[``,`none`,`full`,l,Y,q],R=()=>[``,W,We,J],ie=()=>[`solid`,`dashed`,`dotted`,`double`],ae=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],z=()=>[W,ke,Ke,Ve],oe=()=>[``,`none`,m,Y,q],se=()=>[`none`,W,Y,q],ce=()=>[`none`,W,Y,q],B=()=>[W,Y,q],V=()=>[U,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[K],breakpoint:[K],color:[Ae],container:[K],"drop-shadow":[K],ease:[`in`,`out`,`in-out`],font:[Fe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[K],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[K],shadow:[K],spacing:[`px`,W],text:[K],"text-shadow":[K],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,U,q,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,q]}],"container-named":[Ie],columns:[{columns:[W,`auto`,q,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[G,`auto`,Y,q]}],basis:[{basis:[U,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,U,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,W,Y,q]}],shrink:[{shrink:[``,W,Y,q]}],order:[{order:[G,`first`,`last`,`none`,Y,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...N()]}],"min-inline-size":[{"min-inline":[`auto`,...N()]}],"max-inline-size":[{"max-inline":[`none`,...N()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,We,J]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xe,ze]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ke,q]}],"font-family":[{font:[Ge,Be,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,q]}],"line-clamp":[{"line-clamp":[W,`none`,Y,Re]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ie(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,Y,J]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[W,`auto`,Y,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[G,Y,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},G,Y,q],radial:[``,Y,q],conic:[``,G,Y,q]},Je,He]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:R()}],"border-w-x":[{"border-x":R()}],"border-w-y":[{"border-y":R()}],"border-w-s":[{"border-s":R()}],"border-w-e":[{"border-e":R()}],"border-w-bs":[{"border-bs":R()}],"border-w-be":[{"border-be":R()}],"border-w-t":[{"border-t":R()}],"border-w-r":[{"border-r":R()}],"border-w-b":[{"border-b":R()}],"border-w-l":[{"border-l":R()}],"divide-x":[{"divide-x":R()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":R()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ie(),`hidden`,`none`]}],"divide-style":[{divide:[...ie(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ie(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,Y,q]}],"outline-w":[{outline:[``,W,We,J]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`inner`,`none`,u,Ye,Ue]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ye,Ue]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:R()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[W,J]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":R()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,Ye,Ue]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[W,Y,q]}],"mix-blend":[{"mix-blend":[...ae(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Y,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,q]}],filter:[{filter:[``,`none`,Y,q]}],blur:[{blur:oe()}],brightness:[{brightness:[W,Y,q]}],contrast:[{contrast:[W,Y,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ye,Ue]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,W,Y,q]}],"hue-rotate":[{"hue-rotate":[W,Y,q]}],invert:[{invert:[``,W,Y,q]}],saturate:[{saturate:[W,Y,q]}],sepia:[{sepia:[``,W,Y,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,q]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[W,Y,q]}],"backdrop-contrast":[{"backdrop-contrast":[W,Y,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,Y,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,Y,q]}],"backdrop-invert":[{"backdrop-invert":[``,W,Y,q]}],"backdrop-opacity":[{"backdrop-opacity":[W,Y,q]}],"backdrop-saturate":[{"backdrop-saturate":[W,Y,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,Y,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,Y,q]}],ease:[{ease:[`linear`,`initial`,_,Y,q]}],delay:[{delay:[W,Y,q]}],animate:[{animate:[`none`,v,Y,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[Y,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":[`translate-none`],zoom:[{zoom:[G,Y,q]}],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,q]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[W,We,J,Re]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},ot=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(Q(e,`cacheSize`,t),Q(e,`prefix`,n),Q(e,`experimentalParseClassName`,r),st(e.theme,a.theme),st(e.classGroups,a.classGroups),st(e.conflictingClassGroups,a.conflictingClassGroups),st(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Q(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),Q(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),ct(e.theme,i.theme),ct(e.classGroups,i.classGroups),ct(e.conflictingClassGroups,i.conflictingClassGroups),ct(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),lt(e,i,`postfixLookupClassGroups`),lt(e,i,`orderSensitiveModifiers`),e),Q=(e,t,n)=>{n!==void 0&&(e[t]=n)},st=(e,t)=>{if(t)for(let n in t)Q(e,n,t[n])},ct=(e,t)=>{if(t)for(let n in t)lt(e,t,n)},lt=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ut=((e,...t)=>typeof e==`function`?ye(at,e,...t):ye(()=>ot(at(),e),...t))({extend:{classGroups:{"font-size":[{text:[`2xs`]}]}}});function dt(...e){return ut(k(e))}var $=f(),ft={primary:`bg-accent text-accent-fg hover:brightness-110 active:brightness-95 border border-transparent font-medium`,secondary:`bg-raised text-fg border border-line-strong hover:bg-hover hover:border-faint/60`,ghost:`text-fg-2 border border-transparent hover:bg-hover hover:text-fg`,danger:`bg-err-soft text-err border border-err/30 hover:bg-err/20`},pt={sm:`h-7 gap-1.5 px-2.5 text-[12px]`,md:`h-8 gap-2 px-3 text-[13px]`},mt=(0,p.forwardRef)(function({variant:e=`secondary`,size:t=`md`,icon:n,iconOnly:r,loading:i,className:a,children:o,disabled:s,type:c=`button`,...l},u){return(0,$.jsxs)(`button`,{ref:u,type:c,disabled:s||i,"aria-busy":i||void 0,className:dt(`inline-flex shrink-0 items-center justify-center rounded-md whitespace-nowrap select-none`,`transition-[background-color,border-color,color,filter,transform] duration-150 ease-snappy`,`active:scale-[0.98] disabled:pointer-events-none disabled:opacity-45`,ft[e],pt[t],r&&(t===`sm`?`w-7 px-0`:`w-8 px-0`),a),...l,children:[i?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 animate-spin rounded-full border-[1.5px] border-current border-r-transparent`}):n?(0,$.jsx)(n,{"aria-hidden":!0,className:`size-3.5 shrink-0`,strokeWidth:1.75}):null,!r&&o]})});function ht({className:e,...t}){return(0,$.jsx)(`section`,{className:dt(`flex min-w-0 flex-col rounded-lg border border-line bg-panel`,e),...t})}function gt({title:e,id:t,meta:n,actions:r,className:i}){return(0,$.jsxs)(`header`,{className:dt(`flex min-h-10 flex-wrap items-center gap-x-3 gap-y-1 border-b border-line px-3.5 py-2`,i),children:[(0,$.jsx)(`h2`,{id:t,className:`text-[13px] font-medium text-fg`,children:e}),n&&(0,$.jsx)(`div`,{className:`text-[12px] text-muted`,children:n}),r&&(0,$.jsx)(`div`,{className:`ml-auto flex items-center gap-1.5`,children:r})]})}function _t({title:e,description:t,actions:n}){return(0,$.jsxs)(`div`,{className:`flex flex-wrap items-end gap-x-6 gap-y-3 pb-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`h1`,{className:`text-[17px] font-semibold tracking-tight text-fg`,children:e}),t&&(0,$.jsx)(`p`,{className:`mt-0.5 text-[13px] text-muted`,children:t})]}),n&&(0,$.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:n})]})}export{dt as a,u as c,mt as i,o as l,ht as n,D as o,gt as r,f as s,_t as t,c as u};
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-B9tSgX6l.js";import{$ as l,D as u,I as d,O as f,Q as p,at as m,et as h,ft as g,it as _,n as v,nt as y,ot as b,p as x,rt as S,st as C,t as w,tt as T,yt as E}from"./Badge-B-qzNRrZ.js";import{t as D}from"./arrow-up-DL3CuFOO.js";import{t as O}from"./Callout-B9g_wPDi.js";import{n as k,t as A}from"./task-errors-CE4oEr8H.js";import{t as j}from"./trash-CWqeZ7eg.js";import{C as M,N,S as P,b as F,c as I,d as L,i as R,j as z,o as B,p as V,u as H,w as U,y as W}from"./index-BMWr9EKo.js";import{n as G,r as K,t as q}from"./Field-BfabPEcY.js";var J={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};J.node;var Y=i(J),X=c(t(),1),Z=o();function Q({open:e,onClose:t,routes:n,defaultRoute:r}){return(0,Z.jsx)(I,{open:e,onClose:t,title:`Edit routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Saved to the global `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`~/.davecode/config.json`}),` and applied to the router immediately.`]}),width:`w-[min(680px,100vw)]`,children:e&&(0,Z.jsx)($,{routes:n,defaultRoute:r,onDone:t})})}function $({routes:t,defaultRoute:r,onDone:i}){let a=x(),o=u(),s=d(),c=a.data??[],[f,g]=(0,X.useState)(()=>S(t,r)),[v,b]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),E=(0,X.useMemo)(()=>m(f,c),[f,c]),D=p(f,t,r),k=(0,X.useMemo)(()=>{let e=new Map;for(let t of o.data??[]){if(t.owned_by===`davecode`)continue;let n=t.owned_by,r=`${n}/`,i=e.get(n)??[];i.push(t.id.startsWith(r)?t.id.slice(r.length):t.id),e.set(n,i)}return e},[o.data]),M=(e,t)=>g(n=>({...n,routes:n.routes.map(n=>n.key===e?t(n):n)})),P=(e,t,n)=>M(e,e=>({...e,targets:e.targets.map(e=>e.key===t?{...e,...n}:e)})),F=()=>g(e=>{let t=h(y(e.routes));return{routes:[...e.routes,t],defaultKey:e.defaultKey??t.key}}),I=e=>g(t=>{let n=t.routes.filter(t=>t.key!==e);return{routes:n,defaultKey:t.defaultKey===e?n[0]?.key??null:t.defaultKey}});return(0,Z.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),b(!0),w(null),E.valid)try{let e=await s.mutateAsync(_(f));W({tone:`ok`,title:`Routes saved`,description:`${e.routes.length} route${e.routes.length===1?``:`s`}, default davecode/${e.defaultRoute}`}),e.shadowedByProject&&W({tone:`info`,title:`This project overrides routes`,description:`The project .davecode/config.json also sets routing and wins after a restart.`}),i()}catch(e){w(A(e))}},noValidate:!0,className:`flex flex-col gap-4`,children:[f.routes.length===0&&(0,Z.jsxs)(`p`,{className:`rounded-md border border-dashed border-line-strong px-3 py-6 text-center text-[12px] text-muted`,children:[`No routes. Clients can still call `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`provider/model`}),` ids directly. Add a route to expose `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`davecode/<name>`}),`.`]}),f.routes.map(t=>{let r=E.byRoute[t.key],i=f.defaultKey===t.key,a=v;return(0,Z.jsxs)(`section`,{"aria-label":`Route ${t.name||`unnamed`}`,className:e(`flex flex-col gap-3 rounded-lg border bg-raised p-3`,i?`border-accent/50`:`border-line`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(q,{label:`Name`,error:a?r?.name:null,className:`min-w-0 flex-1`,children:({id:e,describedBy:n,invalid:r})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-muted`,children:`davecode/`}),(0,Z.jsx)(G,{id:e,value:t.name,onChange:e=>M(t.key,t=>({...t,name:e.target.value})),"aria-describedby":n,"aria-invalid":r||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})]})}),(0,Z.jsxs)(`label`,{className:`mt-6 flex shrink-0 cursor-pointer items-center gap-1.5 text-[12px] text-fg-2`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:`default-route`,checked:i,onChange:()=>g(e=>({...e,defaultKey:t.key})),className:`size-3.5 accent-accent`}),`Default`]}),(0,Z.jsx)(n,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:j,"aria-label":`Remove route ${t.name||`unnamed`}`,onClick:()=>I(t.key),className:`mt-6 text-err hover:bg-err-soft hover:text-err`})]}),(0,Z.jsx)(q,{label:`Description`,children:({id:e,describedBy:n})=>(0,Z.jsx)(G,{id:e,value:t.description,onChange:e=>M(t.key,t=>({...t,description:e.target.value})),"aria-describedby":n,placeholder:`When to use this route`})}),(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`legend`,{className:`mb-1 text-[12px] font-medium text-fg-2`,children:[`Targets`,` `,(0,Z.jsx)(`span`,{className:`font-normal text-muted`,children:`tried in order, then fail over`})]}),a&&r?.targets&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:r.targets}),(0,Z.jsx)(`ol`,{className:`flex flex-col gap-2`,children:t.targets.map((e,n)=>(0,Z.jsx)(ee,{index:n,count:t.targets.length,target:e,accounts:c,models:k.get(e.provider)??[],error:a?r?.target[e.key]:void 0,onChange:n=>P(t.key,e.key,n),onMove:e=>M(t.key,t=>({...t,targets:l(t.targets,n,e)})),onRemove:()=>M(t.key,t=>({...t,targets:t.targets.filter(t=>t.key!==e.key)}))},e.key))}),(0,Z.jsx)(n,{size:`sm`,variant:`secondary`,icon:N,className:`self-start`,onClick:()=>M(t.key,e=>({...e,targets:[...e.targets,T(e.targets.at(-1)?.provider)]})),children:`Add target`})]})]},t.key)}),v&&E.defaultRoute&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:E.defaultRoute}),(0,Z.jsx)(n,{variant:`secondary`,icon:N,className:`self-start`,onClick:F,children:`Add route`}),C&&(0,Z.jsx)(O,{tone:`err`,title:`Could not save the routes`,children:C}),(0,Z.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[!D&&(0,Z.jsx)(`span`,{className:`mr-auto text-[12px] text-muted`,children:`No changes`}),(0,Z.jsx)(n,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,loading:s.isPending,disabled:!D,children:`Save routes`})]})]})}function ee({index:e,count:t,target:r,accounts:i,models:a,error:o,onChange:s,onMove:c,onRemove:l}){let u=`models-${r.key}`,d=i.filter(e=>e.provider===r.provider),f=r.accountId&&!i.some(e=>e.id===r.accountId);return(0,Z.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel p-2`,children:[(0,Z.jsx)(`span`,{className:`mt-1.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:e+1}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-2`,children:[(0,Z.jsx)(q,{label:`Provider`,children:({id:e})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(V,{provider:r.provider,size:`sm`}),(0,Z.jsx)(K,{id:e,value:r.provider,onChange:e=>{let t=e.target.value;s({provider:t,...i.find(e=>e.id===r.accountId)?.provider===t?{}:{accountId:``}})},children:b.map(e=>(0,Z.jsx)(`option`,{value:e,children:C(e).label},e))})]})}),(0,Z.jsx)(q,{label:`Model`,error:o?.model,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G,{id:e,list:u,value:r.model,onChange:e=>s({model:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,spellCheck:!1,autoCapitalize:`off`,placeholder:`claude-sonnet-5-5`,className:`font-mono`}),(0,Z.jsx)(`datalist`,{id:u,children:a.map(e=>(0,Z.jsx)(`option`,{value:e},e))})]})}),(0,Z.jsx)(q,{label:`Account`,error:o?.accountId,className:`sm:col-span-2`,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(K,{id:e,value:r.accountId,onChange:e=>s({accountId:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,children:[(0,Z.jsx)(`option`,{value:``,children:`Balanced across matching accounts`}),f&&(0,Z.jsxs)(`option`,{value:r.accountId,children:[r.accountId,` (missing)`]}),d.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[`Pinned to `,e.label,` (`,e.id,`)`]},e.id))]})})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex shrink-0 flex-col gap-0.5`,children:[(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:D,"aria-label":`Move target ${e+1} up`,disabled:e===0,onClick:()=>c(e-1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:Y,"aria-label":`Move target ${e+1} down`,disabled:e===t-1,onClick:()=>c(e+1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:U,"aria-label":`Remove target ${e+1}`,onClick:l})]})]})}function te(e,t){return t.filter(t=>{if(e.accountId)return t.id===e.accountId;if(t.provider!==e.provider)return!1;let n=t.config.models;return!Array.isArray(n)||n.length===0||n.includes(e.model)})}function ne(){let e=f(),{params:t}=M(),i=t.get(`edit`)===`1`,o=x(),c=u(),l=E(),d=o.data??[],p=`${l.gatewayUrl||`http://127.0.0.1:4040`}/v1`,m=e.data?.defaultRoute??`auto`,h=(0,X.useMemo)(()=>{let e=c.data??[];return{total:e.length,routes:e.filter(e=>e.owned_by===`davecode`).length}},[c.data]),_=`curl ${p}/chat/completions \\
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{$ as l,D as u,I as d,O as f,Q as p,at as m,et as h,ft as g,it as _,n as v,nt as y,ot as b,p as x,rt as S,st as C,t as w,tt as T,yt as E}from"./Badge-CGY6DgGx.js";import{t as D}from"./arrow-up-goM9r-I9.js";import{t as O}from"./Callout-DauCk_cW.js";import{n as k,t as A}from"./task-errors-B2pgjUGN.js";import{t as j}from"./trash-BVojETtF.js";import{C as M,N,S as P,b as F,c as I,d as L,i as R,j as z,o as B,p as V,u as H,w as U,y as W}from"./index-BCi-Vuvh.js";import{n as G,r as K,t as q}from"./Field-OXMnT9Tb.js";var J={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};J.node;var Y=i(J),X=c(t(),1),Z=o();function Q({open:e,onClose:t,routes:n,defaultRoute:r}){return(0,Z.jsx)(I,{open:e,onClose:t,title:`Edit routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Saved to the global `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`~/.davecode/config.json`}),` and applied to the router immediately.`]}),width:`w-[min(680px,100vw)]`,children:e&&(0,Z.jsx)($,{routes:n,defaultRoute:r,onDone:t})})}function $({routes:t,defaultRoute:r,onDone:i}){let a=x(),o=u(),s=d(),c=a.data??[],[f,g]=(0,X.useState)(()=>S(t,r)),[v,b]=(0,X.useState)(!1),[C,w]=(0,X.useState)(null),E=(0,X.useMemo)(()=>m(f,c),[f,c]),D=p(f,t,r),k=(0,X.useMemo)(()=>{let e=new Map;for(let t of o.data??[]){if(t.owned_by===`davecode`)continue;let n=t.owned_by,r=`${n}/`,i=e.get(n)??[];i.push(t.id.startsWith(r)?t.id.slice(r.length):t.id),e.set(n,i)}return e},[o.data]),M=(e,t)=>g(n=>({...n,routes:n.routes.map(n=>n.key===e?t(n):n)})),P=(e,t,n)=>M(e,e=>({...e,targets:e.targets.map(e=>e.key===t?{...e,...n}:e)})),F=()=>g(e=>{let t=h(y(e.routes));return{routes:[...e.routes,t],defaultKey:e.defaultKey??t.key}}),I=e=>g(t=>{let n=t.routes.filter(t=>t.key!==e);return{routes:n,defaultKey:t.defaultKey===e?n[0]?.key??null:t.defaultKey}});return(0,Z.jsxs)(`form`,{onSubmit:async e=>{if(e.preventDefault(),b(!0),w(null),E.valid)try{let e=await s.mutateAsync(_(f));W({tone:`ok`,title:`Routes saved`,description:`${e.routes.length} route${e.routes.length===1?``:`s`}, default davecode/${e.defaultRoute}`}),e.shadowedByProject&&W({tone:`info`,title:`This project overrides routes`,description:`The project .davecode/config.json also sets routing and wins after a restart.`}),i()}catch(e){w(A(e))}},noValidate:!0,className:`flex flex-col gap-4`,children:[f.routes.length===0&&(0,Z.jsxs)(`p`,{className:`rounded-md border border-dashed border-line-strong px-3 py-6 text-center text-[12px] text-muted`,children:[`No routes. Clients can still call `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`provider/model`}),` ids directly. Add a route to expose `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`davecode/<name>`}),`.`]}),f.routes.map(t=>{let r=E.byRoute[t.key],i=f.defaultKey===t.key,a=v;return(0,Z.jsxs)(`section`,{"aria-label":`Route ${t.name||`unnamed`}`,className:e(`flex flex-col gap-3 rounded-lg border bg-raised p-3`,i?`border-accent/50`:`border-line`),children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(q,{label:`Name`,error:a?r?.name:null,className:`min-w-0 flex-1`,children:({id:e,describedBy:n,invalid:r})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-muted`,children:`davecode/`}),(0,Z.jsx)(G,{id:e,value:t.name,onChange:e=>M(t.key,t=>({...t,name:e.target.value})),"aria-describedby":n,"aria-invalid":r||void 0,spellCheck:!1,autoCapitalize:`off`,className:`font-mono`})]})}),(0,Z.jsxs)(`label`,{className:`mt-6 flex shrink-0 cursor-pointer items-center gap-1.5 text-[12px] text-fg-2`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:`default-route`,checked:i,onChange:()=>g(e=>({...e,defaultKey:t.key})),className:`size-3.5 accent-accent`}),`Default`]}),(0,Z.jsx)(n,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:j,"aria-label":`Remove route ${t.name||`unnamed`}`,onClick:()=>I(t.key),className:`mt-6 text-err hover:bg-err-soft hover:text-err`})]}),(0,Z.jsx)(q,{label:`Description`,children:({id:e,describedBy:n})=>(0,Z.jsx)(G,{id:e,value:t.description,onChange:e=>M(t.key,t=>({...t,description:e.target.value})),"aria-describedby":n,placeholder:`When to use this route`})}),(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`legend`,{className:`mb-1 text-[12px] font-medium text-fg-2`,children:[`Targets`,` `,(0,Z.jsx)(`span`,{className:`font-normal text-muted`,children:`tried in order, then fail over`})]}),a&&r?.targets&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:r.targets}),(0,Z.jsx)(`ol`,{className:`flex flex-col gap-2`,children:t.targets.map((e,n)=>(0,Z.jsx)(ee,{index:n,count:t.targets.length,target:e,accounts:c,models:k.get(e.provider)??[],error:a?r?.target[e.key]:void 0,onChange:n=>P(t.key,e.key,n),onMove:e=>M(t.key,t=>({...t,targets:l(t.targets,n,e)})),onRemove:()=>M(t.key,t=>({...t,targets:t.targets.filter(t=>t.key!==e.key)}))},e.key))}),(0,Z.jsx)(n,{size:`sm`,variant:`secondary`,icon:N,className:`self-start`,onClick:()=>M(t.key,e=>({...e,targets:[...e.targets,T(e.targets.at(-1)?.provider)]})),children:`Add target`})]})]},t.key)}),v&&E.defaultRoute&&(0,Z.jsx)(`p`,{role:`alert`,className:`text-[12px] text-err`,children:E.defaultRoute}),(0,Z.jsx)(n,{variant:`secondary`,icon:N,className:`self-start`,onClick:F,children:`Add route`}),C&&(0,Z.jsx)(O,{tone:`err`,title:`Could not save the routes`,children:C}),(0,Z.jsxs)(`div`,{className:`sticky -bottom-4 -mx-5 -mb-4 flex items-center justify-end gap-2 border-t border-line bg-panel px-5 py-3`,children:[!D&&(0,Z.jsx)(`span`,{className:`mr-auto text-[12px] text-muted`,children:`No changes`}),(0,Z.jsx)(n,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,Z.jsx)(n,{type:`submit`,variant:`primary`,loading:s.isPending,disabled:!D,children:`Save routes`})]})]})}function ee({index:e,count:t,target:r,accounts:i,models:a,error:o,onChange:s,onMove:c,onRemove:l}){let u=`models-${r.key}`,d=i.filter(e=>e.provider===r.provider),f=r.accountId&&!i.some(e=>e.id===r.accountId);return(0,Z.jsxs)(`li`,{className:`flex items-start gap-2 rounded-md border border-line bg-panel p-2`,children:[(0,Z.jsx)(`span`,{className:`mt-1.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:e+1}),(0,Z.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-2`,children:[(0,Z.jsx)(q,{label:`Provider`,children:({id:e})=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(V,{provider:r.provider,size:`sm`}),(0,Z.jsx)(K,{id:e,value:r.provider,onChange:e=>{let t=e.target.value;s({provider:t,...i.find(e=>e.id===r.accountId)?.provider===t?{}:{accountId:``}})},children:b.map(e=>(0,Z.jsx)(`option`,{value:e,children:C(e).label},e))})]})}),(0,Z.jsx)(q,{label:`Model`,error:o?.model,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(G,{id:e,list:u,value:r.model,onChange:e=>s({model:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,spellCheck:!1,autoCapitalize:`off`,placeholder:`claude-sonnet-5-5`,className:`font-mono`}),(0,Z.jsx)(`datalist`,{id:u,children:a.map(e=>(0,Z.jsx)(`option`,{value:e},e))})]})}),(0,Z.jsx)(q,{label:`Account`,error:o?.accountId,className:`sm:col-span-2`,children:({id:e,describedBy:t,invalid:n})=>(0,Z.jsxs)(K,{id:e,value:r.accountId,onChange:e=>s({accountId:e.target.value}),"aria-describedby":t,"aria-invalid":n||void 0,children:[(0,Z.jsx)(`option`,{value:``,children:`Balanced across matching accounts`}),f&&(0,Z.jsxs)(`option`,{value:r.accountId,children:[r.accountId,` (missing)`]}),d.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[`Pinned to `,e.label,` (`,e.id,`)`]},e.id))]})})]}),(0,Z.jsxs)(`div`,{className:`mt-1 flex shrink-0 flex-col gap-0.5`,children:[(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:D,"aria-label":`Move target ${e+1} up`,disabled:e===0,onClick:()=>c(e-1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:Y,"aria-label":`Move target ${e+1} down`,disabled:e===t-1,onClick:()=>c(e+1)}),(0,Z.jsx)(n,{size:`sm`,variant:`ghost`,iconOnly:!0,icon:U,"aria-label":`Remove target ${e+1}`,onClick:l})]})]})}function te(e,t){return t.filter(t=>{if(e.accountId)return t.id===e.accountId;if(t.provider!==e.provider)return!1;let n=t.config.models;return!Array.isArray(n)||n.length===0||n.includes(e.model)})}function ne(){let e=f(),{params:t}=M(),i=t.get(`edit`)===`1`,o=x(),c=u(),l=E(),d=o.data??[],p=`${l.gatewayUrl||`http://127.0.0.1:4040`}/v1`,m=e.data?.defaultRoute??`auto`,h=(0,X.useMemo)(()=>{let e=c.data??[];return{total:e.length,routes:e.filter(e=>e.owned_by===`davecode`).length}},[c.data]),_=`curl ${p}/chat/completions \\
2
2
  -H "Content-Type: application/json" \\
3
3
  -H "Authorization: Bearer $DAVECODE_TOKEN" \\
4
4
  -d '{"model": "davecode/${m}", "messages": [{"role": "user", "content": "Hello"}]}'`;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(s,{title:`Routes`,description:(0,Z.jsxs)(Z.Fragment,{children:[`Exposed to clients as`,` `,(0,Z.jsx)(`code`,{className:`font-mono text-fg-2`,children:`davecode/<route>`}),`. Targets are tried in order; the router fails over down the list before the first byte.`]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[c.data&&(0,Z.jsxs)(w,{mono:!0,children:[h.total,` models · `,h.routes,` routes on /v1/models`]}),(0,Z.jsx)(n,{variant:`primary`,icon:k,disabled:!e.data,onClick:()=>P(`edit`,`1`),children:`Edit routes`})]})}),e.isError&&(0,Z.jsx)(O,{tone:`err`,title:`Could not load routes`,children:g(e.error)}),e.isPending?(0,Z.jsx)(r,{children:(0,Z.jsx)(B,{rows:6})}):(e.data?.routes.length??0)===0?(0,Z.jsx)(r,{children:(0,Z.jsx)(R,{icon:z,title:`No routes configured`,description:`Until you add one, clients can call provider/model ids directly. Routes are saved to ~/.davecode/config.json.`,action:(0,Z.jsx)(n,{variant:`primary`,icon:N,onClick:()=>P(`edit`,`1`),children:`Add a route`})})}):(0,Z.jsx)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:e.data?.routes.map(e=>(0,Z.jsxs)(r,{"aria-labelledby":`route-${e.name}`,children:[(0,Z.jsx)(a,{id:`route-${e.name}`,title:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-mono`,children:[`davecode/`,e.name,(0,Z.jsx)(H,{value:`davecode/${e.name}`,label:`Copy davecode/${e.name}`})]}),actions:e.name===m?(0,Z.jsx)(w,{tone:`accent`,children:`default`}):void 0}),e.description&&(0,Z.jsx)(`p`,{className:`px-3.5 pt-3 text-[12px] text-muted`,children:e.description}),(0,Z.jsx)(`ol`,{className:`flex flex-col p-3.5`,children:e.targets.map((t,n)=>{let r=te(t,d),i=r.filter(e=>e.enabled&&e.status!==`disabled`);return(0,Z.jsxs)(`li`,{className:`relative flex gap-3 pb-3 last:pb-0`,children:[n<e.targets.length-1&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-7 bottom-0 left-[11px] w-px bg-line-strong`}),(0,Z.jsx)(`span`,{className:`z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-line-strong bg-raised font-mono text-[11px] text-fg-2`,children:n+1}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-md border border-line bg-raised px-2.5 py-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(V,{provider:t.provider,size:`sm`}),(0,Z.jsxs)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:[t.provider,`/`,t.model]}),i.length===0&&(0,Z.jsx)(w,{tone:`err`,className:`ml-auto`,children:`no usable account`})]}),(0,Z.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-muted`,children:[(0,Z.jsx)(`span`,{children:t.accountId?`pinned to`:`balanced · ${C(t.provider).label}`}),r.length===0&&(0,Z.jsx)(`span`,{className:`text-faint`,children:`no matching account`}),r.map(e=>(0,Z.jsxs)(F,{to:`/accounts?account=${encodeURIComponent(e.id)}`,className:`inline-flex items-center gap-1.5 text-fg-2 hover:text-fg`,children:[(0,Z.jsx)(v,{tone:L[e.status]}),e.label,(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`(`,e.status,`)`]})]},e.id))]})]})]},`${t.provider}/${t.model}/${t.accountId??``}`)})})]},e.name))}),(0,Z.jsx)(Q,{open:i&&!!e.data,onClose:()=>P(`edit`,null),routes:e.data?.routes??[],defaultRoute:m}),(0,Z.jsxs)(r,{"aria-labelledby":`usage-title`,children:[(0,Z.jsx)(a,{id:`usage-title`,title:`Use a route`,meta:`any OpenAI-compatible client`,actions:(0,Z.jsx)(H,{value:_,label:`Copy snippet`})}),(0,Z.jsx)(`pre`,{className:`overflow-x-auto p-3.5 font-mono text-[12px] leading-5 text-fg-2`,children:_})]})]})}export{ne as RoutesPage};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-B9tSgX6l.js";import{A as l,B as u,N as d,V as f,ft as p,j as m,o as h,pt as g,r as _,t as v}from"./Badge-B-qzNRrZ.js";import{t as y}from"./Callout-B9g_wPDi.js";import{A as b,F as x,H as S,P as C,V as w,_ as T,a as E,b as D,h as O,k,l as A,s as ee,y as j,z as M}from"./index-BMWr9EKo.js";var N={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};N.node;var P=i(N),F={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};F.node;var I=i(F),L={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};L.node;var R=i(L),z={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};z.node;var B=i(z),V=c(t(),1),H=o(),U=[`debug`,`info`,`warn`,`error`],W={debug:`text-muted`,info:`text-info`,warn:`text-warn`,error:`text-err`};function G(e){return e.level===`error`?`text-err`:e.level===`warn`?`text-warn`:e.message.startsWith(`$ `)?`text-fg`:e.message.startsWith(`✓`)?`text-ok`:e.message.startsWith(`→`)?`text-info`:e.level===`debug`?`text-muted`:`text-fg-2`}function K({lines:t,onClear:n,className:r}){let[i,a]=(0,V.useState)(()=>new Set([`info`,`warn`,`error`])),[o,s]=(0,V.useState)(`runner`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(!0),[f,p]=(0,V.useState)(!0),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>{let e={debug:0,info:0,warn:0,error:0};for(let n of t)(o===`all`||n.source===`runner`)&&(e[n.level]+=1);return e},[t,o]),g=c.trim().toLowerCase(),v=(0,V.useMemo)(()=>t.filter(e=>i.has(e.level)&&(o===`all`||e.source===`runner`)&&(!g||e.message.toLowerCase().includes(g)||(e.taskId??e.scope??``).includes(g))),[t,i,o,g]);(0,V.useLayoutEffect)(()=>{let e=m.current;e&&f&&(e.scrollTop=e.scrollHeight)},[v,f]),(0,V.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;p(t)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]);let y=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,H.jsxs)(`section`,{"aria-label":`Runner log`,className:e(`term flex min-h-0 flex-col overflow-hidden rounded-lg border border-line bg-term`,r),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line px-3 py-2`,children:[(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log levels`}),U.map(t=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":i.has(t),onClick:()=>y(t),className:e(`inline-flex h-6 items-center gap-1.5 rounded border px-2 font-mono text-2xs uppercase transition-colors duration-150`,i.has(t)?`border-line-strong bg-hover text-fg`:`border-transparent text-faint hover:text-muted`),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`size-1.5 rounded-full bg-current`,i.has(t)&&W[t])}),t,(0,H.jsx)(`span`,{className:`tnum text-muted`,children:h[t]})]},t))]}),(0,H.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px bg-line-strong`}),(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log source`}),[`runner`,`all`].map(t=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":o===t,onClick:()=>s(t),className:e(`h-6 rounded px-2 text-[12px] transition-colors duration-150`,o===t?`bg-hover text-fg`:`text-muted hover:text-fg-2`),children:t===`runner`?`Runner`:`All logs`},t))]}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(b,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,H.jsx)(`input`,{type:`search`,"aria-label":`Filter log lines`,placeholder:`Filter`,value:c,onChange:e=>l(e.target.value),className:`h-6 w-32 rounded border border-line-strong bg-transparent pr-2 pl-6 font-mono text-[11px] text-fg placeholder:text-faint focus-visible:border-accent focus-visible:outline-none`,"data-filter-input":!0})]}),(0,H.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(e=>!e),"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:e(`inline-flex size-6 items-center justify-center rounded`,u?`bg-hover text-fg`:`text-muted hover:text-fg`),children:(0,H.jsx)(B,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})}),(0,H.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Clear console`,title:`Clear console`,className:`inline-flex size-6 items-center justify-center rounded text-muted hover:bg-hover hover:text-fg`,children:(0,H.jsx)(I,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})})]})]}),(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:m,role:`log`,"aria-live":`off`,"aria-label":`Log lines`,tabIndex:0,className:`absolute inset-0 overflow-auto py-2 font-mono text-[12px] leading-[1.6]`,children:v.length===0?(0,H.jsx)(`p`,{className:`px-3 text-muted`,children:t.length===0?`Waiting for runner output…`:`No lines match the filters.`}):v.map(t=>(0,H.jsxs)(`div`,{className:e(`flex gap-3 px-3 hover:bg-hover/60`,u?`whitespace-pre-wrap break-words`:`whitespace-pre`,t.level===`error`&&`bg-err/[0.06]`),children:[(0,H.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:_(t.ts,!0)}),(0,H.jsx)(`span`,{className:e(`w-10 shrink-0 uppercase select-none`,W[t.level]),children:t.level}),o===`all`&&(0,H.jsx)(`span`,{className:`w-16 shrink-0 truncate text-muted`,children:t.source===`runner`?`runner`:t.scope}),(0,H.jsx)(`span`,{className:e(`min-w-0`,G(t)),children:t.message})]},t.key))}),!f&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let e=m.current;e&&(e.scrollTop=e.scrollHeight),p(!0)},className:`absolute right-4 bottom-3 inline-flex animate-pop-in items-center gap-1.5 rounded-md border border-line-strong bg-raised px-2.5 py-1 text-[12px] text-fg shadow-overlay`,children:[(0,H.jsx)(P,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),`Jump to latest`]})]}),(0,H.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:f?``:`Autoscroll paused.`})]})}var q=[`idle`,`selecting`,`preparing`,`implementing`,`validating`,`repairing`,`merging`],J={idle:`Waiting for work`,selecting:`Picking the next unblocked task`,preparing:`Creating the task branch and loading the brain`,implementing:`Writing code through the gateway`,validating:`Running lint, typecheck and tests`,repairing:`Feeding failures back for another attempt`,merging:`Merging the task branch`,paused:`Paused; resumes at the same step`,stopped:`Stopped`,error:`Stopped on an error`},Y={idle:`neutral`,selecting:`info`,preparing:`info`,implementing:`info`,validating:`info`,repairing:`warn`,merging:`ok`,paused:`warn`,stopped:`neutral`,error:`err`},X=3;function Z(){let t=l(),i=d(),o=f(),{live:c}=u(),_=m(),b=T(1e3),[N,P]=(0,V.useState)(!1),F=g(t.error)&&t.error.status===501,I=F?void 0:t.data,L=I?.state,z=i.data?.graph.tasks.find(e=>e.id===I?.taskId),B=(0,V.useMemo)(()=>{if(!F){if(L&&q.includes(L))return L;for(let e=o.events.length-1;e>=0;e--){let t=o.events[e];if(t?.type===`runner.status`&&q.includes(t.status.state))return t.status.state}}},[F,L,o.events]),U=async e=>{try{let t=await _.mutateAsync(e);j({tone:`info`,title:`Runner ${t.state}`,description:J[t.state]})}catch(t){j({tone:`err`,title:`Could not ${e} the runner`,description:g(t)&&t.code===`runner_unavailable`?`This gateway was started without the autonomous runner.`:p(t)})}},W=L!==void 0&&![`idle`,`paused`,`stopped`,`error`].includes(L),G=!F&&(L===`idle`||L===`paused`||L===`stopped`||L===`error`),Z=I?.startedAt?(b-Date.parse(I.startedAt))/1e3:void 0,Q=I?.repairCycle??0,te=i.data?.graph.tasks.filter(e=>e.status===`SUCCESS`).length??0,$=i.data?.graph.tasks.length??0;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(s,{title:`Runner`,description:`The autonomous engineer: one task at a time, on its own branch, merged only when checks pass.`,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`primary`,icon:C,disabled:!G||_.isPending,loading:_.isPending&&_.variables===`start`,onClick:()=>U(`start`),children:L===`paused`?`Resume`:`Start`}),(0,H.jsx)(n,{icon:x,disabled:F||!W||_.isPending,loading:_.isPending&&_.variables===`pause`,onClick:()=>U(`pause`),children:`Pause`}),(0,H.jsx)(n,{variant:`danger`,icon:k,disabled:F||L===`stopped`||L===`idle`||L===void 0||_.isPending,onClick:()=>P(!0),children:`Stop`})]})}),F&&(0,H.jsxs)(y,{tone:`warn`,title:`Runner unavailable`,children:[(0,H.jsxs)(`p`,{children:[`This gateway answered `,(0,H.jsx)(`code`,{className:`font-mono text-fg`,children:`501 runner_unavailable`}),`: it is running without the autonomous engine. Routing and the dashboard keep working; start the runner from a project directory to drive the task graph:`]}),(0,H.jsx)(A,{command:`davecode run`,className:`mt-2 max-w-sm`})]}),t.isError&&!F&&(0,H.jsx)(y,{tone:`err`,title:`Could not read the runner status`,children:p(t.error)}),(0,H.jsxs)(r,{"aria-labelledby":`machine-title`,children:[(0,H.jsx)(a,{id:`machine-title`,title:`State machine`,meta:L?J[L]:void 0,actions:L&&(0,H.jsx)(v,{tone:Y[L],dot:!0,pulse:W,children:L})}),(0,H.jsxs)(`div`,{className:`p-4`,children:[t.isPending?(0,H.jsx)(E,{className:`h-16 w-full`}):(0,H.jsx)(`ol`,{className:`flex flex-wrap items-center gap-y-3`,"aria-label":`Runner pipeline`,children:q.map((t,n)=>{let r=t===B,i=r&&W,a=B?q.indexOf(B):-1,o=a>0&&n>0&&n<a&&(t!==`repairing`||Q!==0);return(0,H.jsxs)(`li`,{className:`flex items-center`,"aria-current":r?`step`:void 0,children:[n>0&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`mx-1.5 h-px w-4 sm:w-6`,o||r?`bg-fg-2/50`:`bg-line-strong`)}),(0,H.jsxs)(`span`,{className:e(`inline-flex h-7 items-center gap-1.5 rounded-full border px-3 font-mono text-[12px] transition-colors duration-200`,r?L===`paused`||L===`stopped`||t===`repairing`?`border-warn/50 bg-warn-soft text-warn`:`border-accent/60 bg-accent-soft text-accent-text shadow-[0_0_0_3px_var(--dc-accent-soft)]`:o?`border-line-strong text-fg-2`:`border-line text-faint`),children:[o&&(0,H.jsx)(w,{"aria-hidden":!0,className:`size-3`,strokeWidth:2.25}),t===`repairing`&&!o&&(0,H.jsx)(R,{"aria-hidden":!0,className:`size-3`,strokeWidth:2}),i&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse-dot rounded-full bg-current`}),t,r&&(0,H.jsxs)(`span`,{className:`sr-only`,children:[` (current`,L===t?``:`, ${L}`,`)`]})]})]},t)})}),(0,H.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[(0,H.jsx)(R,{"aria-hidden":!0,className:`mr-1 inline size-3 align-[-2px]`,strokeWidth:2}),`Failed validation loops `,(0,H.jsx)(`span`,{className:`font-mono`,children:`repairing → implementing`}),` up to `,X,` times; then the task is marked FAILED and the runner moves on.`]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,H.jsxs)(r,{"aria-labelledby":`current-title`,className:`xl:order-2 xl:self-start`,children:[(0,H.jsx)(a,{id:`current-title`,title:`Current task`,meta:$?`${te}/${$} tasks done`:void 0}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[t.isPending?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{className:`h-4 w-40`}),(0,H.jsx)(E,{className:`h-4 w-56`})]}):z?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(D,{to:`/tasks?task=${encodeURIComponent(z.id)}`,className:`font-mono text-2xs text-muted hover:text-fg`,children:z.id}),(0,H.jsx)(`p`,{className:`text-[13px] leading-5 font-medium text-fg`,children:z.title})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(O,{status:z.status}),z.attempts!==void 0&&(0,H.jsxs)(v,{mono:!0,children:[`attempt `,z.attempts]})]}),(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,H.jsx)(M,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),z.branch??`davecode/task-${z.id}`]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Repair cycle`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:Array.from({length:X},(t,n)=>(0,H.jsx)(`span`,{className:e(`h-1.5 w-5 rounded-full`,n<Q?`bg-warn`:`bg-track`)},n))}),(0,H.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[Q,`/`,X]})]})]}),Z!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Running for`}),(0,H.jsx)(`span`,{className:`tnum font-mono text-fg`,children:h(Z)})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[12px] text-muted`,children:[(0,H.jsx)(S,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.5}),F?`No runner attached to this gateway.`:`No task in progress.`]}),I?.lastError&&(0,H.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:I.lastError})]})]}),(0,H.jsx)(K,{lines:o.logs,onClear:()=>c.clearLogs(),className:`h-[480px] xl:order-1`})]}),(0,H.jsx)(ee,{open:N,onClose:()=>P(!1),title:`Stop the runner?`,description:`The current step is abandoned. Work done so far stays on the task branch.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`ghost`,onClick:()=>P(!1),children:`Keep running`}),(0,H.jsx)(n,{variant:`danger`,icon:k,onClick:()=>{P(!1),U(`stop`)},children:`Stop runner`})]}),children:z&&(0,H.jsx)(`p`,{className:`font-mono text-[12px] text-muted`,children:z.id})})]})}export{Z as Runner};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s,u as c}from"./Panel-Du40pM7n.js";import{A as l,B as u,N as d,V as f,ft as p,j as m,o as h,pt as g,r as _,t as v}from"./Badge-CGY6DgGx.js";import{t as y}from"./Callout-DauCk_cW.js";import{A as b,F as x,H as S,P as C,V as w,_ as T,a as E,b as D,h as O,k,l as A,s as ee,y as j,z as M}from"./index-BCi-Vuvh.js";var N={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};N.node;var P=i(N),F={name:`eraser`,size:24,node:[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]};F.node;var I=i(F),L={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};L.node;var R=i(L),z={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};z.node;var B=i(z),V=c(t(),1),H=o(),U=[`debug`,`info`,`warn`,`error`],W={debug:`text-muted`,info:`text-info`,warn:`text-warn`,error:`text-err`};function G(e){return e.level===`error`?`text-err`:e.level===`warn`?`text-warn`:e.message.startsWith(`$ `)?`text-fg`:e.message.startsWith(`✓`)?`text-ok`:e.message.startsWith(`→`)?`text-info`:e.level===`debug`?`text-muted`:`text-fg-2`}function K({lines:t,onClear:n,className:r}){let[i,a]=(0,V.useState)(()=>new Set([`info`,`warn`,`error`])),[o,s]=(0,V.useState)(`runner`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(!0),[f,p]=(0,V.useState)(!0),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>{let e={debug:0,info:0,warn:0,error:0};for(let n of t)(o===`all`||n.source===`runner`)&&(e[n.level]+=1);return e},[t,o]),g=c.trim().toLowerCase(),v=(0,V.useMemo)(()=>t.filter(e=>i.has(e.level)&&(o===`all`||e.source===`runner`)&&(!g||e.message.toLowerCase().includes(g)||(e.taskId??e.scope??``).includes(g))),[t,i,o,g]);(0,V.useLayoutEffect)(()=>{let e=m.current;e&&f&&(e.scrollTop=e.scrollHeight)},[v,f]),(0,V.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;p(t)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]);let y=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,H.jsxs)(`section`,{"aria-label":`Runner log`,className:e(`term flex min-h-0 flex-col overflow-hidden rounded-lg border border-line bg-term`,r),children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line px-3 py-2`,children:[(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log levels`}),U.map(t=>(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":i.has(t),onClick:()=>y(t),className:e(`inline-flex h-6 items-center gap-1.5 rounded border px-2 font-mono text-2xs uppercase transition-colors duration-150`,i.has(t)?`border-line-strong bg-hover text-fg`:`border-transparent text-faint hover:text-muted`),children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`size-1.5 rounded-full bg-current`,i.has(t)&&W[t])}),t,(0,H.jsx)(`span`,{className:`tnum text-muted`,children:h[t]})]},t))]}),(0,H.jsx)(`span`,{"aria-hidden":!0,className:`h-4 w-px bg-line-strong`}),(0,H.jsxs)(`fieldset`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`legend`,{className:`sr-only`,children:`Log source`}),[`runner`,`all`].map(t=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":o===t,onClick:()=>s(t),className:e(`h-6 rounded px-2 text-[12px] transition-colors duration-150`,o===t?`bg-hover text-fg`:`text-muted hover:text-fg-2`),children:t===`runner`?`Runner`:`All logs`},t))]}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(b,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2 size-3 -translate-y-1/2 text-muted`,strokeWidth:1.75}),(0,H.jsx)(`input`,{type:`search`,"aria-label":`Filter log lines`,placeholder:`Filter`,value:c,onChange:e=>l(e.target.value),className:`h-6 w-32 rounded border border-line-strong bg-transparent pr-2 pl-6 font-mono text-[11px] text-fg placeholder:text-faint focus-visible:border-accent focus-visible:outline-none`,"data-filter-input":!0})]}),(0,H.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>d(e=>!e),"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:e(`inline-flex size-6 items-center justify-center rounded`,u?`bg-hover text-fg`:`text-muted hover:text-fg`),children:(0,H.jsx)(B,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})}),(0,H.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Clear console`,title:`Clear console`,className:`inline-flex size-6 items-center justify-center rounded text-muted hover:bg-hover hover:text-fg`,children:(0,H.jsx)(I,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75})})]})]}),(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:m,role:`log`,"aria-live":`off`,"aria-label":`Log lines`,tabIndex:0,className:`absolute inset-0 overflow-auto py-2 font-mono text-[12px] leading-[1.6]`,children:v.length===0?(0,H.jsx)(`p`,{className:`px-3 text-muted`,children:t.length===0?`Waiting for runner output…`:`No lines match the filters.`}):v.map(t=>(0,H.jsxs)(`div`,{className:e(`flex gap-3 px-3 hover:bg-hover/60`,u?`whitespace-pre-wrap break-words`:`whitespace-pre`,t.level===`error`&&`bg-err/[0.06]`),children:[(0,H.jsx)(`span`,{className:`tnum shrink-0 text-faint select-none`,children:_(t.ts,!0)}),(0,H.jsx)(`span`,{className:e(`w-10 shrink-0 uppercase select-none`,W[t.level]),children:t.level}),o===`all`&&(0,H.jsx)(`span`,{className:`w-16 shrink-0 truncate text-muted`,children:t.source===`runner`?`runner`:t.scope}),(0,H.jsx)(`span`,{className:e(`min-w-0`,G(t)),children:t.message})]},t.key))}),!f&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{let e=m.current;e&&(e.scrollTop=e.scrollHeight),p(!0)},className:`absolute right-4 bottom-3 inline-flex animate-pop-in items-center gap-1.5 rounded-md border border-line-strong bg-raised px-2.5 py-1 text-[12px] text-fg shadow-overlay`,children:[(0,H.jsx)(P,{"aria-hidden":!0,className:`size-3.5`,strokeWidth:1.75}),`Jump to latest`]})]}),(0,H.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:f?``:`Autoscroll paused.`})]})}var q=[`idle`,`selecting`,`preparing`,`implementing`,`validating`,`repairing`,`merging`],J={idle:`Waiting for work`,selecting:`Picking the next unblocked task`,preparing:`Creating the task branch and loading the brain`,implementing:`Writing code through the gateway`,validating:`Running lint, typecheck and tests`,repairing:`Feeding failures back for another attempt`,merging:`Merging the task branch`,paused:`Paused; resumes at the same step`,stopped:`Stopped`,error:`Stopped on an error`},Y={idle:`neutral`,selecting:`info`,preparing:`info`,implementing:`info`,validating:`info`,repairing:`warn`,merging:`ok`,paused:`warn`,stopped:`neutral`,error:`err`},X=3;function Z(){let t=l(),i=d(),o=f(),{live:c}=u(),_=m(),b=T(1e3),[N,P]=(0,V.useState)(!1),F=g(t.error)&&t.error.status===501,I=F?void 0:t.data,L=I?.state,z=i.data?.graph.tasks.find(e=>e.id===I?.taskId),B=(0,V.useMemo)(()=>{if(!F){if(L&&q.includes(L))return L;for(let e=o.events.length-1;e>=0;e--){let t=o.events[e];if(t?.type===`runner.status`&&q.includes(t.status.state))return t.status.state}}},[F,L,o.events]),U=async e=>{try{let t=await _.mutateAsync(e);j({tone:`info`,title:`Runner ${t.state}`,description:J[t.state]})}catch(t){j({tone:`err`,title:`Could not ${e} the runner`,description:g(t)&&t.code===`runner_unavailable`?`This gateway was started without the autonomous runner.`:p(t)})}},W=L!==void 0&&![`idle`,`paused`,`stopped`,`error`].includes(L),G=!F&&(L===`idle`||L===`paused`||L===`stopped`||L===`error`),Z=I?.startedAt?(b-Date.parse(I.startedAt))/1e3:void 0,Q=I?.repairCycle??0,te=i.data?.graph.tasks.filter(e=>e.status===`SUCCESS`).length??0,$=i.data?.graph.tasks.length??0;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(s,{title:`Runner`,description:`The autonomous engineer: one task at a time, on its own branch, merged only when checks pass.`,actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`primary`,icon:C,disabled:!G||_.isPending,loading:_.isPending&&_.variables===`start`,onClick:()=>U(`start`),children:L===`paused`?`Resume`:`Start`}),(0,H.jsx)(n,{icon:x,disabled:F||!W||_.isPending,loading:_.isPending&&_.variables===`pause`,onClick:()=>U(`pause`),children:`Pause`}),(0,H.jsx)(n,{variant:`danger`,icon:k,disabled:F||L===`stopped`||L===`idle`||L===void 0||_.isPending,onClick:()=>P(!0),children:`Stop`})]})}),F&&(0,H.jsxs)(y,{tone:`warn`,title:`Runner unavailable`,children:[(0,H.jsxs)(`p`,{children:[`This gateway answered `,(0,H.jsx)(`code`,{className:`font-mono text-fg`,children:`501 runner_unavailable`}),`: it is running without the autonomous engine. Routing and the dashboard keep working; start the runner from a project directory to drive the task graph:`]}),(0,H.jsx)(A,{command:`davecode run`,className:`mt-2 max-w-sm`})]}),t.isError&&!F&&(0,H.jsx)(y,{tone:`err`,title:`Could not read the runner status`,children:p(t.error)}),(0,H.jsxs)(r,{"aria-labelledby":`machine-title`,children:[(0,H.jsx)(a,{id:`machine-title`,title:`State machine`,meta:L?J[L]:void 0,actions:L&&(0,H.jsx)(v,{tone:Y[L],dot:!0,pulse:W,children:L})}),(0,H.jsxs)(`div`,{className:`p-4`,children:[t.isPending?(0,H.jsx)(E,{className:`h-16 w-full`}):(0,H.jsx)(`ol`,{className:`flex flex-wrap items-center gap-y-3`,"aria-label":`Runner pipeline`,children:q.map((t,n)=>{let r=t===B,i=r&&W,a=B?q.indexOf(B):-1,o=a>0&&n>0&&n<a&&(t!==`repairing`||Q!==0);return(0,H.jsxs)(`li`,{className:`flex items-center`,"aria-current":r?`step`:void 0,children:[n>0&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:e(`mx-1.5 h-px w-4 sm:w-6`,o||r?`bg-fg-2/50`:`bg-line-strong`)}),(0,H.jsxs)(`span`,{className:e(`inline-flex h-7 items-center gap-1.5 rounded-full border px-3 font-mono text-[12px] transition-colors duration-200`,r?L===`paused`||L===`stopped`||t===`repairing`?`border-warn/50 bg-warn-soft text-warn`:`border-accent/60 bg-accent-soft text-accent-text shadow-[0_0_0_3px_var(--dc-accent-soft)]`:o?`border-line-strong text-fg-2`:`border-line text-faint`),children:[o&&(0,H.jsx)(w,{"aria-hidden":!0,className:`size-3`,strokeWidth:2.25}),t===`repairing`&&!o&&(0,H.jsx)(R,{"aria-hidden":!0,className:`size-3`,strokeWidth:2}),i&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 animate-pulse-dot rounded-full bg-current`}),t,r&&(0,H.jsxs)(`span`,{className:`sr-only`,children:[` (current`,L===t?``:`, ${L}`,`)`]})]})]},t)})}),(0,H.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[(0,H.jsx)(R,{"aria-hidden":!0,className:`mr-1 inline size-3 align-[-2px]`,strokeWidth:2}),`Failed validation loops `,(0,H.jsx)(`span`,{className:`font-mono`,children:`repairing → implementing`}),` up to `,X,` times; then the task is marked FAILED and the runner moves on.`]})]})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_340px]`,children:[(0,H.jsxs)(r,{"aria-labelledby":`current-title`,className:`xl:order-2 xl:self-start`,children:[(0,H.jsx)(a,{id:`current-title`,title:`Current task`,meta:$?`${te}/${$} tasks done`:void 0}),(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[t.isPending?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{className:`h-4 w-40`}),(0,H.jsx)(E,{className:`h-4 w-56`})]}):z?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(D,{to:`/tasks?task=${encodeURIComponent(z.id)}`,className:`font-mono text-2xs text-muted hover:text-fg`,children:z.id}),(0,H.jsx)(`p`,{className:`text-[13px] leading-5 font-medium text-fg`,children:z.title})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,H.jsx)(O,{status:z.status}),z.attempts!==void 0&&(0,H.jsxs)(v,{mono:!0,children:[`attempt `,z.attempts]})]}),(0,H.jsxs)(`p`,{className:`flex items-center gap-1.5 font-mono text-[12px] text-fg-2`,children:[(0,H.jsx)(M,{"aria-hidden":!0,className:`size-3.5 text-muted`,strokeWidth:1.75}),z.branch??`davecode/task-${z.id}`]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Repair cycle`}),(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:Array.from({length:X},(t,n)=>(0,H.jsx)(`span`,{className:e(`h-1.5 w-5 rounded-full`,n<Q?`bg-warn`:`bg-track`)},n))}),(0,H.jsxs)(`span`,{className:`tnum font-mono text-fg`,children:[Q,`/`,X]})]})]}),Z!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between text-[12px]`,children:[(0,H.jsx)(`span`,{className:`text-muted`,children:`Running for`}),(0,H.jsx)(`span`,{className:`tnum font-mono text-fg`,children:h(Z)})]})]}):(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[12px] text-muted`,children:[(0,H.jsx)(S,{"aria-hidden":!0,className:`size-4`,strokeWidth:1.5}),F?`No runner attached to this gateway.`:`No task in progress.`]}),I?.lastError&&(0,H.jsx)(`p`,{className:`rounded-md border border-err/30 bg-err-soft p-2 font-mono text-2xs text-err`,children:I.lastError})]})]}),(0,H.jsx)(K,{lines:o.logs,onClear:()=>c.clearLogs(),className:`h-[480px] xl:order-1`})]}),(0,H.jsx)(ee,{open:N,onClose:()=>P(!1),title:`Stop the runner?`,description:`The current step is abandoned. Work done so far stays on the task branch.`,footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(n,{variant:`ghost`,onClick:()=>P(!1),children:`Keep running`}),(0,H.jsx)(n,{variant:`danger`,icon:k,onClick:()=>{P(!1),U(`stop`)},children:`Stop runner`})]}),children:z&&(0,H.jsx)(`p`,{className:`font-mono text-[12px] text-muted`,children:z.id})})]})}export{Z as Runner};