@alook/app 0.0.123 → 0.0.124

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 (96) hide show
  1. package/bundled/web/.open-next/.build/durable-objects/queue.js +5 -5
  2. package/bundled/web/.open-next/assets/BUILD_ID +1 -1
  3. package/bundled/web/.open-next/assets/_next/static/chunks/0b0bf61oxocmd.js +1 -0
  4. package/bundled/web/.open-next/assets/_next/static/chunks/0hy07ql5hqe_e.js +1 -0
  5. package/bundled/web/.open-next/assets/_next/static/chunks/0ix7g0wppe7ap.js +1 -0
  6. package/bundled/web/.open-next/assets/_next/static/chunks/{1mx37r05ln6g1.js → 1-jzxwxd2yppa.js} +2 -2
  7. package/bundled/web/.open-next/assets/_next/static/chunks/{2h5i0w9yjtehx.js → 17ewotvd7-nyl.js} +25 -25
  8. package/bundled/web/.open-next/assets/_next/static/chunks/1ftpvvqesj-9s.js +3 -0
  9. package/bundled/web/.open-next/assets/_next/static/chunks/24uei2njvsgf4.js +1 -0
  10. package/bundled/web/.open-next/assets/_next/static/chunks/{18gk2x7nnxbqe.js → 2bsr3n9nxv0sc.js} +3 -3
  11. package/bundled/web/.open-next/assets/_next/static/chunks/{1f1919o6u7ie4.js → 2fgjbyei3irh0.js} +2 -2
  12. package/bundled/web/.open-next/assets/_next/static/chunks/2v94k7fybopcq.css +1 -0
  13. package/bundled/web/.open-next/assets/_next/static/chunks/40cggm_5dua8j.js +3 -0
  14. package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/_global-error.cache +1 -1
  15. package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/_not-found.cache +1 -1
  16. package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/device.cache +1 -1
  17. package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/privacy.cache +1 -1
  18. package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/sitemap.xml.cache +1 -1
  19. package/bundled/web/.open-next/cloudflare/cache-assets-manifest.sql +1 -1
  20. package/bundled/web/.open-next/cloudflare/init.js +1 -1
  21. package/bundled/web/.open-next/dynamodb-provider/dynamodb-cache.json +1 -1
  22. package/bundled/web/.open-next/middleware/handler.mjs +3 -3
  23. package/bundled/web/.open-next/server-functions/default/src/web/.next/BUILD_ID +1 -1
  24. package/bundled/web/.open-next/server-functions/default/src/web/.next/build-manifest.json +3 -3
  25. package/bundled/web/.open-next/server-functions/default/src/web/.next/prerender-manifest.json +3 -3
  26. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/invite/[token]/page_client-reference-manifest.js +1 -1
  27. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/studio/new/page_client-reference-manifest.js +1 -1
  28. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/activity/page_client-reference-manifest.js +1 -1
  29. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/[convId]/page_client-reference-manifest.js +1 -1
  30. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
  31. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/email/page_client-reference-manifest.js +1 -1
  32. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/files/page_client-reference-manifest.js +1 -1
  33. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/meetings/page_client-reference-manifest.js +1 -1
  34. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/[id]/page_client-reference-manifest.js +1 -1
  35. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/new/page_client-reference-manifest.js +1 -1
  36. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/agents/page_client-reference-manifest.js +1 -1
  37. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/calendar/page_client-reference-manifest.js +1 -1
  38. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/flags/page_client-reference-manifest.js +1 -1
  39. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/help/email-setup/page_client-reference-manifest.js +1 -1
  40. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/home/page_client-reference-manifest.js +1 -1
  41. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/issues/page_client-reference-manifest.js +1 -1
  42. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/page_client-reference-manifest.js +1 -1
  43. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/runtimes/page_client-reference-manifest.js +1 -1
  44. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/settings/page_client-reference-manifest.js +1 -1
  45. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/[traceId]/page_client-reference-manifest.js +1 -1
  46. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/threads/page_client-reference-manifest.js +1 -1
  47. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/w/[slug]/unread/page_client-reference-manifest.js +1 -1
  48. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(app)/workspaces/page_client-reference-manifest.js +1 -1
  49. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/(auth)/sign-in/page_client-reference-manifest.js +1 -1
  50. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  51. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/device/page_client-reference-manifest.js +1 -1
  52. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/page_client-reference-manifest.js +1 -1
  53. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/privacy/page_client-reference-manifest.js +1 -1
  54. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/[id]/page_client-reference-manifest.js +1 -1
  55. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/app/templates/page_client-reference-manifest.js +1 -1
  56. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/[turbopack]_runtime.js +12 -12
  57. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{[root-of-the-server]__0am_4wb._.js → [root-of-the-server]__0h57d-t._.js} +2 -2
  58. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{[root-of-the-server]__1-8w6mo._.js → [root-of-the-server]__0h_is3c._.js} +2 -2
  59. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__1efy1ql._.js +3 -0
  60. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[turbopack]_runtime.js +12 -12
  61. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0ank6h0._.js +3 -0
  62. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0h4t18a._.js +3 -0
  63. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_0pnr14d._.js +65 -0
  64. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_15s-tjk._.js +3 -0
  65. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0cw18c9._.js → _17uno5p._.js} +2 -2
  66. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{src_web_src_components_avatar_0hmu31-._.js → _1_l18p2._.js} +2 -2
  67. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/{_0wtkjzl._.js → _1xq5127._.js} +2 -2
  68. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_1jq1kez._.js +3 -0
  69. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1gzvmep._.js +3 -0
  70. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_1sy648u._.js +1 -1
  71. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/src_web_src_components_home_home-page_tsx_1e1vr_i._.js +1 -1
  72. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-build-manifest.js +3 -3
  73. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/middleware-manifest.json +5 -5
  74. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.js +1 -1
  75. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/server-reference-manifest.json +1 -1
  76. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs +43 -43
  77. package/bundled/web/.open-next/server-functions/default/src/web/handler.mjs.meta.json +161 -161
  78. package/bundled/web/.open-next/server-functions/default/src/web/index.mjs +3 -3
  79. package/package.json +1 -1
  80. package/bundled/web/.open-next/assets/_next/static/chunks/08_59eymmivc3.css +0 -1
  81. package/bundled/web/.open-next/assets/_next/static/chunks/0q121fbd7g_tm.js +0 -1
  82. package/bundled/web/.open-next/assets/_next/static/chunks/1hysx7io25oee.js +0 -3
  83. package/bundled/web/.open-next/assets/_next/static/chunks/20ufhzii8j1s-.js +0 -3
  84. package/bundled/web/.open-next/assets/_next/static/chunks/31l_dqaqpowsj.js +0 -1
  85. package/bundled/web/.open-next/assets/_next/static/chunks/3c8i7pzls-plb.js +0 -1
  86. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/[root-of-the-server]__015bdc7._.js +0 -3
  87. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_08f25id._.js +0 -3
  88. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1fplcoj._.js +0 -65
  89. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1q2gs7z._.js +0 -3
  90. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/_1rpi0ih._.js +0 -3
  91. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_0b17d5w._.js +0 -3
  92. package/bundled/web/.open-next/server-functions/default/src/web/.next/server/chunks/ssr/node_modules__pnpm_1xmk7_g._.js +0 -3
  93. /package/bundled/web/.open-next/assets/_next/static/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/_buildManifest.js +0 -0
  94. /package/bundled/web/.open-next/assets/_next/static/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/_clientMiddlewareManifest.js +0 -0
  95. /package/bundled/web/.open-next/assets/_next/static/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/_ssgManifest.js +0 -0
  96. /package/bundled/web/.open-next/cache/{p7dPVZmAMrsESYaje5GVD → LNMccyS5SZzzNBkt0dM4K}/robots.txt.cache +0 -0
@@ -1,29 +1,29 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,275351,e=>{"use strict";let t,r,n,a,i=(e,t)=>t.some(t=>e instanceof t),s=new WeakMap,l=new WeakMap,o=new WeakMap,c={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return u(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function u(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",i)},a=()=>{t(u(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",i)}),o.set(t,e),t}if(l.has(e))return l.get(e);let t=function(e){if("function"==typeof e)return(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(d(this),t),u(this.request)}:function(...t){return u(e.apply(d(this),t))};return(e instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",i),e.removeEventListener("abort",i)},a=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(e),i(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,c):e}(e);return t!==e&&(l.set(e,t),o.set(t,e)),t}let d=e=>o.get(e),p=["get","getKey","getAll","getAllKeys","count"],h=["put","add","delete","clear"],g=new Map;function f(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(g.get(t))return g.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,a=h.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(a||p.includes(r)))return;let i=async function(e,...t){let i=this.transaction(e,a?"readwrite":"readonly"),s=i.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),a&&i.done]))[0]};return g.set(t,i),i}c={...t=c,get:(e,r,n)=>f(e,r)||t.get(e,r,n),has:(e,r)=>!!f(e,r)||t.has(e,r)};let m=["continue","continuePrimaryKey","advance"],k={},b=new WeakMap,x=new WeakMap,y={get(e,t){if(!m.includes(t))return e[t];let r=k[t];return r||(r=k[t]=function(...e){b.set(this,x.get(this)[t](...e))}),r}};async function*w(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let r=new Proxy(t,y);for(x.set(r,t),o.set(r,d(t));t;)yield r,t=await (b.get(r)||t.continue()),b.delete(r)}function v(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}c={...r=c,get:(e,t,n)=>v(e,t)?w:r.get(e,t,n),has:(e,t)=>v(e,t)||r.has(e,t)};let $=null,S=null;function T(e){return"u"<typeof indexedDB?null:$&&S===e?$:(S=e,$=function(e,{blocked:t,upgrade:r,blocking:n,terminated:a}={}){let i=indexedDB.open(e,4),s=u(i);return r&&i.addEventListener("upgradeneeded",e=>{r(u(i.result),e.oldVersion,e.newVersion,u(i.transaction),e)}),t&&i.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener("close",()=>a()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(`alook-chat-cache-${e}`,{upgrade(e,t){if(t<1){let t=e.createObjectStore("messages",{keyPath:["conversation_id","id"]});t.createIndex("by-conversation","conversation_id",{unique:!1}),t.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),e.createObjectStore("cache_meta",{keyPath:"conversation_id"})}t<3&&e.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),t<4&&e.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function E(e){return e?T(e):$}async function _(e,t){let r=E(t);if(!r)return null;try{let t=await r,n=await t.getAllFromIndex("messages","by-conversation",e);if(0===n.length)return null;let a=n.filter(e=>!e.id.startsWith("temp-"));a.sort((e,t)=>{let r=e.created_at.localeCompare(t.created_at);return 0!==r?r:e.id.localeCompare(t.id)});let i=await t.get("cache_meta",e);return i&&await t.put("cache_meta",{...i,lastAccessedAt:Date.now()}),a}catch{return null}}async function A(e,t,r,n,a){let i=E(a);if(!i)return null;try{let a=await i,s=await a.get("cache_meta",e);if(!s)return null;let l=IDBKeyRange.bound([e,""],[e,t],!1,!1),o=(await a.getAllFromIndex("messages","by-created",l)).filter(e=>!e.id.startsWith("temp-")&&(e.created_at!==t||!(e.id>=r)));o.sort((e,t)=>{let r=t.created_at.localeCompare(e.created_at);return 0!==r?r:t.id.localeCompare(e.id)});let c=o.slice(0,n);if(c.length<n&&s.hasMore)return null;return await a.put("cache_meta",{...s,lastAccessedAt:Date.now()}),{messages:c.reverse(),hasMore:o.length>n||s.hasMore}}catch{return null}}async function C(e,t,r,n,a){let i=E(n);if(i)try{let n=await i,s=t.filter(e=>!e.id.startsWith("temp-"));if(0===s.length)return;let l=n.transaction(["messages","cache_meta"],"readwrite"),o=l.objectStore("messages"),c=l.objectStore("cache_meta");for(let e of s)await o.put(e);let u=await o.index("by-conversation").getAllKeys(e),d=Date.now(),p=s.reduce((e,t)=>e.created_at>t.created_at?e:t),h=await c.get(e),g=r??h?.hasMore??!0,f=h?.newestMessageId&&h.newestMessageId!==p.id?await (async()=>{let t=await o.get([e,h.newestMessageId]);return t&&t.created_at>p.created_at?t.id:p.id})():p.id,m={conversation_id:e,lastFetchedAt:d,lastAccessedAt:d,messageCount:u.length,newestMessageId:f,hasMore:g,serverMessageCount:a??h?.serverMessageCount??0};await c.put(m),await l.done,M().catch(()=>{})}catch{}}async function I(e,t,r){let n=E(r);if(n&&!t.id.startsWith("temp-"))try{let r=await n,a=await r.get("cache_meta",e);if(!a)return;let i=await r.get("messages",[e,t.id]);await r.put("messages",t),await r.put("cache_meta",{...a,lastAccessedAt:Date.now(),messageCount:i?a.messageCount:a.messageCount+1,newestMessageId:t.id})}catch{}}async function R(e,t){let r=E(t);if(!r)return null;try{let t=await r;return await t.get("cache_meta",e)??null}catch{return null}}function P(e,t){return`${e}::${null==t?"":t}`}async function z(e,t,r){let n=E(r);if(!n)return null;try{let r=await n;return await r.get("last_open",P(e,t))??null}catch{return null}}async function D(e,t,r,n){let a=E(n);if(a)try{let n=await a;await n.put("last_open",{key:P(e,t),conversation_id:r.conversation_id,newestMessageId:r.newestMessageId,serverMessageCount:r.serverMessageCount,updatedAt:Date.now()})}catch{}}async function L(e,t){let r=E(t);if(!r)return null;try{let t=await r;return await t.get("conv_extras",e)??null}catch{return null}}async function O(e,t,r){let n=E(r);if(n)try{let r=await n;await r.put("conv_extras",{conversation_id:e,...t,updatedAt:Date.now()})}catch{}}async function M(e=50){let t=E();if(t)try{let r=await t,n=await r.getAll("cache_meta");if(n.length<=e)return;n.sort((e,t)=>e.lastAccessedAt-t.lastAccessedAt);let a=n.slice(0,n.length-e),i=r.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),s=i.objectStore("messages"),l=i.objectStore("cache_meta"),o=i.objectStore("last_open"),c=i.objectStore("conv_extras");for(let e of a){for(let t of(await s.index("by-conversation").getAllKeys(e.conversation_id)))await s.delete(t);for(let t of(await l.delete(e.conversation_id),await o.index("by-conversation").getAllKeys(e.conversation_id)))await o.delete(t);await c.delete(e.conversation_id)}await i.done}catch{}}async function N(){if("u">typeof indexedDB)try{$&&((await $).close(),$=null),S&&(await j(`alook-chat-cache-${S}`),S=null)}catch{}}async function j(e){return new Promise((t,r)=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>r(n.error),n.onblocked=()=>t()})}e.s(["appendCachedMessage",0,I,"clearAllCache",0,N,"getCacheMeta",0,R,"getCachedMessages",0,_,"getCachedMessagesBefore",0,A,"getConvExtras",0,L,"getLastOpenConversation",0,z,"mergeCachedMessages",0,C,"openCacheDB",0,T,"setConvExtras",0,O,"setLastOpenConversation",0,D],275351)},481282,731316,657587,385745,e=>{"use strict";var t=e.i(127677),r=(0,e.i(995292).default)(Object.keys,Object),n=Object.prototype.hasOwnProperty;let a=function(e){if(!(0,t.default)(e))return r(e);var a=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&a.push(i);return a};e.s(["default",0,a],731316);var i=e.i(130636),s=e.i(659173),l=(0,i.default)(s.default,"DataView"),o=e.i(121200),c=(0,i.default)(s.default,"Promise"),u=(0,i.default)(s.default,"Set");e.s(["default",0,u],657587);var d=(0,i.default)(s.default,"WeakMap"),p=e.i(706462),h=e.i(882148),g="[object Map]",f="[object Promise]",m="[object Set]",k="[object WeakMap]",b="[object DataView]",x=(0,h.default)(l),y=(0,h.default)(o.default),w=(0,h.default)(c),v=(0,h.default)(u),$=(0,h.default)(d),S=p.default;(l&&S(new l(new ArrayBuffer(1)))!=b||o.default&&S(new o.default)!=g||c&&S(c.resolve())!=f||u&&S(new u)!=m||d&&S(new d)!=k)&&(S=function(e){var t=(0,p.default)(e),r="[object Object]"==t?e.constructor:void 0,n=r?(0,h.default)(r):"";if(n)switch(n){case x:return b;case y:return g;case w:return f;case v:return m;case $:return k}return t});let T=S;e.s(["default",0,T],385745);var E=e.i(530194),_=e.i(764843),A=e.i(750244),C=e.i(330772),I=e.i(400745),R=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,A.default)(e)&&((0,_.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,C.default)(e)||(0,I.default)(e)||(0,E.default)(e)))return!e.length;var r=T(e);if("[object Map]"==r||"[object Set]"==r)return!e.size;if((0,t.default)(e))return!a(e).length;for(var n in e)if(R.call(e,n))return!1;return!0}],481282)},505494,e=>{"use strict";var t=e.i(752872),r=e.i(351359);e.i(991577);var n=e.i(692423),a=(0,r.__name)(e=>{let{securityLevel:r}=(0,t.getConfig2)(),a=(0,n.select)("body");if("sandbox"===r){let t=(0,n.select)(`#i${e}`),r=t.node()?.contentDocument??document;a=(0,n.select)(r.body)}return a.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,a])},489368,e=>{"use strict";var t=e.i(102198),r=e.i(103274),n=e.i(595995),a=e.i(752872),i=e.i(351359),s={common:a.common_default,getConfig:a.getConfig,insertCluster:r.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:r.insertNode,interpolateToCurve:n.interpolateToCurve,labelHelper:r.labelHelper,log:i.log,positionEdgeLabel:t.positionEdgeLabel},l={},o=(0,i.__name)(e=>{for(let t of e)l[t.name]=t},"registerLayoutLoaders");(0,i.__name)(()=>{o([{name:"dagre",loader:(0,i.__name)(async()=>await e.A(274989),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await e.A(619639),"loader")}])},"registerDefaultLayoutLoaders")();var c=(0,i.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in l))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let r=t.domId||t.id;t.domId=`${e.diagramId}-${r}`}let r=l[e.layoutAlgorithm],n=await r.loader(),{theme:a,themeVariables:i}=e.config,{useGradient:o,gradientStart:c,gradientStop:u}=i,d=t.attr("id");if(t.append("defs").append("filter").attr("id",`${d}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${d}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),o){let e=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("svg:stop").attr("offset","0%").attr("stop-color",c).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return n.render(e,t,s,{algorithm:r.algorithm})},"render"),u=(0,i.__name)((e="",{fallback:t="dagre"}={})=>{if(e in l)return e;if(t in l)return i.log.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm");e.s(["getRegisteredLayoutAlgorithm",0,u,"registerLayoutLoaders",0,o,"render",0,c])},288329,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(613349);e.s(["SheetResizeHandle",0,function({onPointerDown:e,onPointerMove:r,onPointerUp:a,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:r,onPointerUp:a,onLostPointerCapture:a,className:(0,n.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:n=.8}={}){let[a,i]=(0,r.useState)(e),s=(0,r.useRef)(!1),l=(0,r.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),s.current=!0},[]);return{width:a,onPointerDown:l,onPointerMove:(0,r.useCallback)(e=>{s.current&&i(Math.min(window.innerWidth*n,Math.max(t,window.innerWidth-e.clientX)))},[t,n]),onPointerUp:(0,r.useCallback)(e=>{s.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}])},998771,e=>{"use strict";let t=(0,e.i(419412).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],998771)},811156,e=>{"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=t(),n={exec:()=>null};function a(e,t=""){let r="string"==typeof e?e:e.source,n={replace:(e,t)=>{let a="string"==typeof t?t:t.source;return a=a.replace(s.caret,"$1"),r=r.replace(e,a),n},getRegex:()=>new RegExp(r,t)};return n}var i=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch{return!1}})(),s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,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:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},l=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,o=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,c=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,u=a(c).replace(/bull/g,o).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),d=a(c).replace(/bull/g,o).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,g=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f=a(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,o).getRegex(),m="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",k=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",k).replace("tag",m).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=a(p).replace("hr",l).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),y={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",x).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:g,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:l,html:b,lheading:u,list:f,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:x,table:n,text:/^[^\n]+/},w=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",l).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),v={...y,lheading:d,table:w,paragraph:a(p).replace("hr",l).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",w).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex()},$={...y,html:a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",k).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:n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(p).replace("hr",l).replace("heading",` *#{1,6} *[^
2
- ]`).replace("lheading",u).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,T=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,_=/[^\s\p{P}\p{S}]/u,A=a(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,E).getRegex(),C=/(?!~)[\p{P}\p{S}]/u,I=a(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",i?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),R=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,P=a(R,"u").replace(/punct/g,T).getRegex(),z=a(R,"u").replace(/punct/g,C).getRegex(),D="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",L=a(D,"gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),O=a(D,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,C).getRegex(),M=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),N=a(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),j=a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,_).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),B=a(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),q=a(/^<(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(),H=a(k).replace("(?:-->|$)","-->").getRegex(),F=a("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",H).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),U=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,W=a(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",U).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),J=a(/^!?\[(label)\]\[(ref)\]/).replace("label",U).replace("ref",h).getRegex(),Z=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),V=a("reflink|nolink(?!\\()","g").replace("reflink",J).replace("nolink",Z).getRegex(),K=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Q={_backpedal:n,anyPunctuation:B,autolink:q,blockSkip:I,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:n,delLDelim:n,delRDelim:n,emStrongLDelim:P,emStrongRDelimAst:L,emStrongRDelimUnd:M,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:W,nolink:Z,punctuation:A,reflink:J,reflinkSearch:V,tag:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:n},X={...Q,link:a(/^!?\[(label)\]\((.*?)\)/).replace("label",U).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U).getRegex()},G={...Q,emStrongRDelimAst:O,emStrongLDelim:z,delLDelim:N,delRDelim:j,url:a(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",K).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",K).getRegex()},Y={...G,br:a(S).replace("{2,}","*").getRegex(),text:a(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:y,gfm:v,pedantic:$},et={normal:Q,gfm:G,breaks:Y,pedantic:X},er={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},en=e=>er[e];function ea(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,en)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,en);return e}function ei(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch{return null}return e}function es(e,t){let r=e.replace(s.findPipe,(e,t,r)=>{let n=!1,a=t;for(;--a>=0&&"\\"===r[a];)n=!n;return n?"|":" |"}).split(s.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(s.slashPipe,"|");return r}function el(e,t,r){let n=e.length;if(0===n)return"";let a=0;for(;a<n;){let i=e.charAt(n-a-1);if(i!==t||r)if(i!==t&&r)a++;else break;else a++}return e.slice(0,n-a)}function eo(e,t,r,n,a){let i=t.href,s=t.title||null,l=e[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:i,title:s,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,o}var ec=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:el(e,`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,275351,e=>{"use strict";let t,r,n,a,i=(e,t)=>t.some(t=>e instanceof t),s=new WeakMap,o=new WeakMap,l=new WeakMap,c={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return s.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return d(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function d(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",i)},a=()=>{t(d(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",i)}),l.set(t,e),t}if(o.has(e))return o.get(e);let t=function(e){if("function"==typeof e)return(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(u(this),t),d(this.request)}:function(...t){return d(e.apply(u(this),t))};return(e instanceof IDBTransaction&&function(e){if(s.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",i),e.removeEventListener("abort",i)},a=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",i),e.addEventListener("abort",i)});s.set(e,t)}(e),i(e,n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,c):e}(e);return t!==e&&(o.set(e,t),l.set(t,e)),t}let u=e=>l.get(e),p=["get","getKey","getAll","getAllKeys","count"],h=["put","add","delete","clear"],g=new Map;function f(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(g.get(t))return g.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,a=h.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(a||p.includes(r)))return;let i=async function(e,...t){let i=this.transaction(e,a?"readwrite":"readonly"),s=i.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),a&&i.done]))[0]};return g.set(t,i),i}c={...t=c,get:(e,r,n)=>f(e,r)||t.get(e,r,n),has:(e,r)=>!!f(e,r)||t.has(e,r)};let m=["continue","continuePrimaryKey","advance"],k={},b=new WeakMap,x=new WeakMap,y={get(e,t){if(!m.includes(t))return e[t];let r=k[t];return r||(r=k[t]=function(...e){b.set(this,x.get(this)[t](...e))}),r}};async function*w(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let r=new Proxy(t,y);for(x.set(r,t),l.set(r,u(t));t;)yield r,t=await (b.get(r)||t.continue()),b.delete(r)}function v(e,t){return t===Symbol.asyncIterator&&i(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&i(e,[IDBIndex,IDBObjectStore])}c={...r=c,get:(e,t,n)=>v(e,t)?w:r.get(e,t,n),has:(e,t)=>v(e,t)||r.has(e,t)};let $=null,S=null;function T(e){return"u"<typeof indexedDB?null:$&&S===e?$:(S=e,$=function(e,{blocked:t,upgrade:r,blocking:n,terminated:a}={}){let i=indexedDB.open(e,4),s=d(i);return r&&i.addEventListener("upgradeneeded",e=>{r(d(i.result),e.oldVersion,e.newVersion,d(i.transaction),e)}),t&&i.addEventListener("blocked",e=>t(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener("close",()=>a()),n&&e.addEventListener("versionchange",e=>n(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(`alook-chat-cache-${e}`,{upgrade(e,t){if(t<1){let t=e.createObjectStore("messages",{keyPath:["conversation_id","id"]});t.createIndex("by-conversation","conversation_id",{unique:!1}),t.createIndex("by-created",["conversation_id","created_at"],{unique:!1}),e.createObjectStore("cache_meta",{keyPath:"conversation_id"})}t<3&&e.createObjectStore("last_open",{keyPath:"key"}).createIndex("by-conversation","conversation_id",{unique:!1}),t<4&&e.createObjectStore("conv_extras",{keyPath:"conversation_id"})}}))}function _(e){return e?T(e):$}async function E(e,t){let r=_(t);if(!r)return null;try{let t=await r,n=await t.getAllFromIndex("messages","by-conversation",e);if(0===n.length)return null;let a=n.filter(e=>!e.id.startsWith("temp-"));a.sort((e,t)=>{let r=e.created_at.localeCompare(t.created_at);return 0!==r?r:e.id.localeCompare(t.id)});let i=await t.get("cache_meta",e);return i&&await t.put("cache_meta",{...i,lastAccessedAt:Date.now()}),a}catch{return null}}async function A(e,t,r,n,a){let i=_(a);if(!i)return null;try{let a=await i,s=await a.get("cache_meta",e);if(!s)return null;let o=IDBKeyRange.bound([e,""],[e,t],!1,!1),l=(await a.getAllFromIndex("messages","by-created",o)).filter(e=>!e.id.startsWith("temp-")&&(e.created_at!==t||!(e.id>=r)));l.sort((e,t)=>{let r=t.created_at.localeCompare(e.created_at);return 0!==r?r:t.id.localeCompare(e.id)});let c=l.slice(0,n);if(c.length<n&&s.hasMore)return null;return await a.put("cache_meta",{...s,lastAccessedAt:Date.now()}),{messages:c.reverse(),hasMore:l.length>n||s.hasMore}}catch{return null}}async function C(e,t,r,n,a){let i=_(n);if(i)try{let n=await i,s=t.filter(e=>!e.id.startsWith("temp-"));if(0===s.length)return;let o=n.transaction(["messages","cache_meta"],"readwrite"),l=o.objectStore("messages"),c=o.objectStore("cache_meta");for(let e of s)await l.put(e);let d=await l.index("by-conversation").getAllKeys(e),u=Date.now(),p=s.reduce((e,t)=>e.created_at>t.created_at?e:t),h=await c.get(e),g=r??h?.hasMore??!0,f=h?.newestMessageId&&h.newestMessageId!==p.id?await (async()=>{let t=await l.get([e,h.newestMessageId]);return t&&t.created_at>p.created_at?t.id:p.id})():p.id,m={conversation_id:e,lastFetchedAt:u,lastAccessedAt:u,messageCount:d.length,newestMessageId:f,hasMore:g,serverMessageCount:a??h?.serverMessageCount??0};await c.put(m),await o.done,L().catch(()=>{})}catch{}}async function I(e,t,r){let n=_(r);if(n&&!t.id.startsWith("temp-"))try{let r=await n,a=await r.get("cache_meta",e);if(!a)return;let i=await r.get("messages",[e,t.id]);await r.put("messages",t),await r.put("cache_meta",{...a,lastAccessedAt:Date.now(),messageCount:i?a.messageCount:a.messageCount+1,newestMessageId:t.id})}catch{}}async function R(e,t){let r=_(t);if(!r)return null;try{let t=await r;return await t.get("cache_meta",e)??null}catch{return null}}function P(e,t){return`${e}::${null==t?"":t}`}async function j(e,t,r){let n=_(r);if(!n)return null;try{let r=await n;return await r.get("last_open",P(e,t))??null}catch{return null}}async function z(e,t,r,n){let a=_(n);if(a)try{let n=await a;await n.put("last_open",{key:P(e,t),conversation_id:r.conversation_id,newestMessageId:r.newestMessageId,serverMessageCount:r.serverMessageCount,updatedAt:Date.now()})}catch{}}async function D(e,t){let r=_(t);if(!r)return null;try{let t=await r;return await t.get("conv_extras",e)??null}catch{return null}}async function N(e,t,r){let n=_(r);if(n)try{let r=await n;await r.put("conv_extras",{conversation_id:e,...t,updatedAt:Date.now()})}catch{}}async function L(e=50){let t=_();if(t)try{let r=await t,n=await r.getAll("cache_meta");if(n.length<=e)return;n.sort((e,t)=>e.lastAccessedAt-t.lastAccessedAt);let a=n.slice(0,n.length-e),i=r.transaction(["messages","cache_meta","last_open","conv_extras"],"readwrite"),s=i.objectStore("messages"),o=i.objectStore("cache_meta"),l=i.objectStore("last_open"),c=i.objectStore("conv_extras");for(let e of a){for(let t of(await s.index("by-conversation").getAllKeys(e.conversation_id)))await s.delete(t);for(let t of(await o.delete(e.conversation_id),await l.index("by-conversation").getAllKeys(e.conversation_id)))await l.delete(t);await c.delete(e.conversation_id)}await i.done}catch{}}async function M(){if("u">typeof indexedDB)try{$&&((await $).close(),$=null),S&&(await O(`alook-chat-cache-${S}`),S=null)}catch{}}async function O(e){return new Promise((t,r)=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>r(n.error),n.onblocked=()=>t()})}e.s(["appendCachedMessage",0,I,"clearAllCache",0,M,"getCacheMeta",0,R,"getCachedMessages",0,E,"getCachedMessagesBefore",0,A,"getConvExtras",0,D,"getLastOpenConversation",0,j,"mergeCachedMessages",0,C,"openCacheDB",0,T,"setConvExtras",0,N,"setLastOpenConversation",0,z],275351)},481282,731316,657587,385745,e=>{"use strict";var t=e.i(127677),r=(0,e.i(995292).default)(Object.keys,Object),n=Object.prototype.hasOwnProperty;let a=function(e){if(!(0,t.default)(e))return r(e);var a=[];for(var i in Object(e))n.call(e,i)&&"constructor"!=i&&a.push(i);return a};e.s(["default",0,a],731316);var i=e.i(130636),s=e.i(659173),o=(0,i.default)(s.default,"DataView"),l=e.i(121200),c=(0,i.default)(s.default,"Promise"),d=(0,i.default)(s.default,"Set");e.s(["default",0,d],657587);var u=(0,i.default)(s.default,"WeakMap"),p=e.i(706462),h=e.i(882148),g="[object Map]",f="[object Promise]",m="[object Set]",k="[object WeakMap]",b="[object DataView]",x=(0,h.default)(o),y=(0,h.default)(l.default),w=(0,h.default)(c),v=(0,h.default)(d),$=(0,h.default)(u),S=p.default;(o&&S(new o(new ArrayBuffer(1)))!=b||l.default&&S(new l.default)!=g||c&&S(c.resolve())!=f||d&&S(new d)!=m||u&&S(new u)!=k)&&(S=function(e){var t=(0,p.default)(e),r="[object Object]"==t?e.constructor:void 0,n=r?(0,h.default)(r):"";if(n)switch(n){case x:return b;case y:return g;case w:return f;case v:return m;case $:return k}return t});let T=S;e.s(["default",0,T],385745);var _=e.i(530194),E=e.i(764843),A=e.i(750244),C=e.i(330772),I=e.i(400745),R=Object.prototype.hasOwnProperty;e.s(["default",0,function(e){if(null==e)return!0;if((0,A.default)(e)&&((0,E.default)(e)||"string"==typeof e||"function"==typeof e.splice||(0,C.default)(e)||(0,I.default)(e)||(0,_.default)(e)))return!e.length;var r=T(e);if("[object Map]"==r||"[object Set]"==r)return!e.size;if((0,t.default)(e))return!a(e).length;for(var n in e)if(R.call(e,n))return!1;return!0}],481282)},505494,e=>{"use strict";var t=e.i(752872),r=e.i(351359);e.i(991577);var n=e.i(692423),a=(0,r.__name)(e=>{let{securityLevel:r}=(0,t.getConfig2)(),a=(0,n.select)("body");if("sandbox"===r){let t=(0,n.select)(`#i${e}`),r=t.node()?.contentDocument??document;a=(0,n.select)(r.body)}return a.select(`#${e}`)},"selectSvgElement");e.s(["selectSvgElement",0,a])},489368,e=>{"use strict";var t=e.i(102198),r=e.i(103274),n=e.i(595995),a=e.i(752872),i=e.i(351359),s={common:a.common_default,getConfig:a.getConfig,insertCluster:r.insertCluster,insertEdge:t.insertEdge,insertEdgeLabel:t.insertEdgeLabel,insertMarkers:t.markers_default,insertNode:r.insertNode,interpolateToCurve:n.interpolateToCurve,labelHelper:r.labelHelper,log:i.log,positionEdgeLabel:t.positionEdgeLabel},o={},l=(0,i.__name)(e=>{for(let t of e)o[t.name]=t},"registerLayoutLoaders");(0,i.__name)(()=>{l([{name:"dagre",loader:(0,i.__name)(async()=>await e.A(274989),"loader")},{name:"cose-bilkent",loader:(0,i.__name)(async()=>await e.A(619639),"loader")}])},"registerDefaultLayoutLoaders")();var c=(0,i.__name)(async(e,t)=>{if(!(e.layoutAlgorithm in o))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let r=t.domId||t.id;t.domId=`${e.diagramId}-${r}`}let r=o[e.layoutAlgorithm],n=await r.loader(),{theme:a,themeVariables:i}=e.config,{useGradient:l,gradientStart:c,gradientStop:d}=i,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${a?.includes("dark")?"#FFFFFF":"#000000"}`),l){let e=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("svg:stop").attr("offset","0%").attr("stop-color",c).attr("stop-opacity",1),e.append("svg:stop").attr("offset","100%").attr("stop-color",d).attr("stop-opacity",1)}return n.render(e,t,s,{algorithm:r.algorithm})},"render"),d=(0,i.__name)((e="",{fallback:t="dagre"}={})=>{if(e in o)return e;if(t in o)return i.log.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm");e.s(["getRegisteredLayoutAlgorithm",0,d,"registerLayoutLoaders",0,l,"render",0,c])},288329,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(613349);e.s(["SheetResizeHandle",0,function({onPointerDown:e,onPointerMove:r,onPointerUp:a,className:i,withHandle:s=!0}){return(0,t.jsx)("div",{onPointerDown:e,onPointerMove:r,onPointerUp:a,onLostPointerCapture:a,className:(0,n.cn)("hidden sm:flex absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize z-10 items-center justify-center hover:bg-primary/10 active:bg-primary/20 transition-colors rounded-l-xl",i),children:s&&(0,t.jsx)("div",{className:"h-6 w-1 rounded-lg bg-border"})})},"useSheetResize",0,function({defaultWidth:e=480,minWidth:t=320,maxWidthRatio:n=.8}={}){let[a,i]=(0,r.useState)(e),s=(0,r.useRef)(!1),o=(0,r.useCallback)(e=>{e.preventDefault(),e.target.setPointerCapture(e.pointerId),s.current=!0},[]);return{width:a,onPointerDown:o,onPointerMove:(0,r.useCallback)(e=>{s.current&&i(Math.min(window.innerWidth*n,Math.max(t,window.innerWidth-e.clientX)))},[t,n]),onPointerUp:(0,r.useCallback)(e=>{s.current=!1,e.target.releasePointerCapture(e.pointerId)},[])}}])},998771,e=>{"use strict";let t=(0,e.i(419412).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],998771)},811156,e=>{"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=t(),n={exec:()=>null};function a(e,t=""){let r="string"==typeof e?e:e.source,n={replace:(e,t)=>{let a="string"==typeof t?t:t.source;return a=a.replace(s.caret,"$1"),r=r.replace(e,a),n},getRegex:()=>new RegExp(r,t)};return n}var i=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch{return!1}})(),s={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,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:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,l=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,c=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,d=a(c).replace(/bull/g,l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),u=a(c).replace(/bull/g,l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),p=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,h=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,g=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f=a(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,l).getRegex(),m="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",k=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",k).replace("tag",m).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=a(p).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),y={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",x).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:g,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:o,html:b,lheading:d,list:f,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:x,table:n,text:/^[^\n]+/},w=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),v={...y,lheading:u,table:w,paragraph:a(p).replace("hr",o).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",w).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex()},$={...y,html:a("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",k).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:n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(p).replace("hr",o).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",d).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,T=/[\p{P}\p{S}]/u,_=/[\s\p{P}\p{S}]/u,E=/[^\s\p{P}\p{S}]/u,A=a(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_).getRegex(),C=/(?!~)[\p{P}\p{S}]/u,I=a(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",i?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),R=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,P=a(R,"u").replace(/punct/g,T).getRegex(),j=a(R,"u").replace(/punct/g,C).getRegex(),z="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",D=a(z,"gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),N=a(z,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,C).getRegex(),L=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),M=a(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),O=a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,E).replace(/punctSpace/g,_).replace(/punct/g,T).getRegex(),B=a(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),q=a(/^<(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(),H=a(k).replace("(?:-->|$)","-->").getRegex(),F=a("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",H).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),U=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,W=a(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",U).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),J=a(/^!?\[(label)\]\[(ref)\]/).replace("label",U).replace("ref",h).getRegex(),Z=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",h).getRegex(),V=a("reflink|nolink(?!\\()","g").replace("reflink",J).replace("nolink",Z).getRegex(),K=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Q={_backpedal:n,anyPunctuation:B,autolink:q,blockSkip:I,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:n,delLDelim:n,delRDelim:n,emStrongLDelim:P,emStrongRDelimAst:D,emStrongRDelimUnd:L,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:W,nolink:Z,punctuation:A,reflink:J,reflinkSearch:V,tag:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:n},X={...Q,link:a(/^!?\[(label)\]\((.*?)\)/).replace("label",U).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U).getRegex()},G={...Q,emStrongRDelimAst:N,emStrongLDelim:j,delLDelim:M,delRDelim:O,url:a(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",K).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",K).getRegex()},Y={...G,br:a(S).replace("{2,}","*").getRegex(),text:a(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ee={normal:y,gfm:v,pedantic:$},et={normal:Q,gfm:G,breaks:Y,pedantic:X},er={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},en=e=>er[e];function ea(e,t){if(t){if(s.escapeTest.test(e))return e.replace(s.escapeReplace,en)}else if(s.escapeTestNoEncode.test(e))return e.replace(s.escapeReplaceNoEncode,en);return e}function ei(e){try{e=encodeURI(e).replace(s.percentDecode,"%")}catch{return null}return e}function es(e,t){let r=e.replace(s.findPipe,(e,t,r)=>{let n=!1,a=t;for(;--a>=0&&"\\"===r[a];)n=!n;return n?"|":" |"}).split(s.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(s.slashPipe,"|");return r}function eo(e,t,r){let n=e.length;if(0===n)return"";let a=0;for(;a<n;){let i=e.charAt(n-a-1);if(i!==t||r)if(i!==t&&r)a++;else break;else a++}return e.slice(0,n-a)}function el(e,t,r,n,a){let i=t.href,s=t.title||null,o=e[1].replace(a.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:i,title:s,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}var ec=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:eo(e,`
3
3
  `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(null===n)return t;let a=n[1];return t.split(`
4
4
  `).map(e=>{let t=e.match(r.other.beginningSpace);if(null===t)return e;let[n]=t;return n.length>=a.length?e.slice(a.length):e}).join(`
5
- `)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=el(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:el(t[0],`
6
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=el(t[0],`
5
+ `)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=eo(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:eo(t[0],`
6
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=eo(t[0],`
7
7
  `).split(`
8
- `),r="",n="",a=[];for(;e.length>0;){let t=!1,i=[],s;for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))i.push(e[s]),t=!0;else if(t)break;else i.push(e[s]);e=e.slice(s);let l=i.join(`
9
- `),o=l.replace(this.rules.other.blockquoteSetextReplace,`
8
+ `),r="",n="",a=[];for(;e.length>0;){let t=!1,i=[],s;for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))i.push(e[s]),t=!0;else if(t)break;else i.push(e[s]);e=e.slice(s);let o=i.join(`
9
+ `),l=o.replace(this.rules.other.blockquoteSetextReplace,`
10
10
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
- ${l}`:l,n=n?`${n}
12
- ${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,a,!0),this.lexer.state.top=c,0===e.length)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let t=u.raw+`
11
+ ${o}`:o,n=n?`${n}
12
+ ${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,a,!0),this.lexer.state.top=c,0===e.length)break;let d=a.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let t=d.raw+`
13
13
  `+e.join(`
14
- `),i=this.blockquote(t);a[a.length-1]=i,r=r.substring(0,r.length-u.raw.length)+i.raw,n=n.substring(0,n.length-u.text.length)+i.text;break}if(u?.type==="list"){let t=u.raw+`
14
+ `),i=this.blockquote(t);a[a.length-1]=i,r=r.substring(0,r.length-d.raw.length)+i.raw,n=n.substring(0,n.length-d.text.length)+i.text;break}if(d?.type==="list"){let t=d.raw+`
15
15
  `+e.join(`
16
- `),i=this.list(t);a[a.length-1]=i,r=r.substring(0,r.length-u.raw.length)+i.raw,n=n.substring(0,n.length-u.raw.length)+i.raw,e=t.substring(a.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:r,tokens:a,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,a={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),s=!1;for(;e;){let r=!1,n="",l="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let o=function(e,t=0){let r=t,n="";for(let t of e)if(" "===t){let e=4-r%4;n+=" ".repeat(e),r+=e}else n+=t,r++;return n}(t[2].split(`
16
+ `),i=this.list(t);a[a.length-1]=i,r=r.substring(0,r.length-d.raw.length)+i.raw,n=n.substring(0,n.length-d.raw.length)+i.raw,e=t.substring(a.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:r,tokens:a,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,a={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let i=this.rules.other.listItemRegex(r),s=!1;for(;e;){let r=!1,n="",o="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=function(e,t=0){let r=t,n="";for(let t of e)if(" "===t){let e=4-r%4;n+=" ".repeat(e),r+=e}else n+=t,r++;return n}(t[2].split(`
18
18
  `,1)[0],t[1].length),c=e.split(`
19
- `,1)[0],u=!o.trim(),d=0;if(this.options.pedantic?(d=2,l=o.trimStart()):u?d=t[1].length+1:(d=(d=o.search(this.rules.other.nonSpaceChar))>4?1:d,l=o.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(n+=c+`
20
- `,e=e.substring(c.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),a=this.rules.other.fencesBeginRegex(d),i=this.rules.other.headingBeginRegex(d),s=this.rules.other.htmlBeginRegex(d),p=this.rules.other.blockquoteBeginRegex(d);for(;e;){let h=e.split(`
21
- `,1)[0],g;if(c=h,g=this.options.pedantic?c=c.replace(this.rules.other.listReplaceNesting," "):c.replace(this.rules.other.tabCharGlobal," "),a.test(c)||i.test(c)||s.test(c)||p.test(c)||t.test(c)||r.test(c))break;if(g.search(this.rules.other.nonSpaceChar)>=d||!c.trim())l+=`
22
- `+g.slice(d);else{if(u||o.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||a.test(o)||i.test(o)||r.test(o))break;l+=`
23
- `+c}u=!c.trim(),n+=h+`
24
- `,e=e.substring(h.length+1),o=g.slice(d)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(s=!0)),a.items.push({type:"list_item",raw:n,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),a.raw+=n}let l=a.items.at(-1);if(!l)return;for(let e of(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),a.raw=a.raw.trimEnd(),a.items)){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),e.tokens[0]?.type==="text"||e.tokens[0]?.type==="paragraph"){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let r={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=r.checked,a.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=r.raw+e.tokens[0].raw,e.tokens[0].text=r.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(r)):e.tokens.unshift({type:"paragraph",raw:r.raw,text:r.raw,tokens:[r]}):e.tokens.unshift(r)}}if(!a.loose){let t=e.tokens.filter(e=>"space"===e.type);a.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(a.loose)for(let e of a.items)for(let t of(e.loose=!0,e.tokens))"text"===t.type&&(t.type="paragraph");return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=es(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
19
+ `,1)[0],d=!l.trim(),u=0;if(this.options.pedantic?(u=2,o=l.trimStart()):d?u=t[1].length+1:(u=(u=l.search(this.rules.other.nonSpaceChar))>4?1:u,o=l.slice(u),u+=t[1].length),d&&this.rules.other.blankLine.test(c)&&(n+=c+`
20
+ `,e=e.substring(c.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(u),r=this.rules.other.hrRegex(u),a=this.rules.other.fencesBeginRegex(u),i=this.rules.other.headingBeginRegex(u),s=this.rules.other.htmlBeginRegex(u),p=this.rules.other.blockquoteBeginRegex(u);for(;e;){let h=e.split(`
21
+ `,1)[0],g;if(c=h,g=this.options.pedantic?c=c.replace(this.rules.other.listReplaceNesting," "):c.replace(this.rules.other.tabCharGlobal," "),a.test(c)||i.test(c)||s.test(c)||p.test(c)||t.test(c)||r.test(c))break;if(g.search(this.rules.other.nonSpaceChar)>=u||!c.trim())o+=`
22
+ `+g.slice(u);else{if(d||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||a.test(l)||i.test(l)||r.test(l))break;o+=`
23
+ `+c}d=!c.trim(),n+=h+`
24
+ `,e=e.substring(h.length+1),l=g.slice(u)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(s=!0)),a.items.push({type:"list_item",raw:n,task:!!this.options.gfm&&this.rules.other.listIsTask.test(o),loose:!1,text:o,tokens:[]}),a.raw+=n}let o=a.items.at(-1);if(!o)return;for(let e of(o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),a.raw=a.raw.trimEnd(),a.items)){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),e.tokens[0]?.type==="text"||e.tokens[0]?.type==="paragraph"){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let r={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=r.checked,a.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=r.raw+e.tokens[0].raw,e.tokens[0].text=r.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(r)):e.tokens.unshift({type:"paragraph",raw:r.raw,text:r.raw,tokens:[r]}):e.tokens.unshift(r)}}if(!a.loose){let t=e.tokens.filter(e=>"space"===e.type);a.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(a.loose)for(let e of a.items)for(let t of(e.loose=!0,e.tokens))"text"===t.type&&(t.type="paragraph");return a}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=es(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
25
  `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<r.length;e++)i.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:i.align[e]});for(let e of a)i.rows.push(es(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
26
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=el(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if("("===e[r])t++;else if(")"===e[r]&&--t<0)return r;return t>0?-2:-1}(t[2]);if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),eo(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return eo(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,a,i,s=r,l=0,o="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!==(n=o.exec(t));){if(!(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(i=[...a].length,n[3]||n[4]){s+=i;continue}if((n[5]||n[6])&&r%3&&!((r+i)%3)){l+=i;continue}if((s-=i)>0)continue;i=Math.min(i,i+s+l);let t=[...n[0]][0].length,o=e.slice(0,r+n.index+t+i);if(Math.min(r,i)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,a,i,s=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!==(n=l.exec(t));){if(!(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])||(i=[...a].length)!==r)continue;if(n[3]||n[4]){s+=i;continue}if((s-=i)>0)continue;i=Math.min(i,i+s);let t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+i),o=l.slice(r,-r);return{type:"del",raw:l,text:o,tokens:this.lexer.inlineTokens(o)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0])e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},eu=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ec,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:s,block:ee.normal,inline:et.normal};this.options.pedantic?(t.block=ee.pedantic,t.inline=et.pedantic):this.options.gfm&&(t.block=ee.gfm,this.options.breaks?t.inline=et.breaks:t.inline=et.gfm),this.tokenizer.rules=t}static get rules(){return{block:ee,inline:et}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(s.carriageReturn,`
26
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=eo(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if("("===e[r])t++;else if(")"===e[r]&&--t<0)return r;return t>0?-2:-1}(t[2]);if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),el(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return el(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,a,i,s=r,o=0,l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!==(n=l.exec(t));){if(!(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(i=[...a].length,n[3]||n[4]){s+=i;continue}if((n[5]||n[6])&&r%3&&!((r+i)%3)){o+=i;continue}if((s-=i)>0)continue;i=Math.min(i,i+s+o);let t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+i);if(Math.min(r,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,a,i,s=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!==(n=o.exec(t));){if(!(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])||(i=[...a].length)!==r)continue;if(n[3]||n[4]){s+=i;continue}if((s-=i)>0)continue;i=Math.min(i,i+s);let t=[...n[0]][0].length,o=e.slice(0,r+n.index+t+i),l=o.slice(r,-r);return{type:"del",raw:o,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0])e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ed=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ec,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:s,block:ee.normal,inline:et.normal};this.options.pedantic?(t.block=ee.pedantic,t.inline=et.pedantic):this.options.gfm&&(t.block=ee.gfm,this.options.breaks?t.inline=et.breaks:t.inline=et.gfm),this.tokenizer.rules=t}static get rules(){return{block:ee,inline:et}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(s.carriageReturn,`
27
27
  `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(s.tabCharGlobal," ").replace(s.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let r=t.at(-1);1===n.raw.length&&void 0!==r?r.raw+=`
28
28
  `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
29
29
  `)?"":`
@@ -37,7 +37,7 @@ ${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
37
37
  `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),r=a.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
38
38
  `)?"":`
39
39
  `)+n.raw,r.text+=`
40
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r;this.tokenizer.lexer=this;let n=e,a=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(a=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(a=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,a.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(a=this.tokenizer.rules.inline.blockSkip.exec(n));)r=a[2]?a[2].length:0,n=n.slice(0,a.index+r)+"["+"a".repeat(a[0].length-r-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,s))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,s))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),n;this.options.extensions.startInline.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(a)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},ed=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(s.notSpaceStart)?.[0],a=e.replace(s.endingNewline,"")+`
40
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r;this.tokenizer.lexer=this;let n=e,a=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(a=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(a=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,a.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(a=this.tokenizer.rules.inline.blockSkip.exec(n));)r=a[2]?a[2].length:0,n=n.slice(0,a.index+r)+"["+"a".repeat(a[0].length-r-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,s))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,s))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),n;this.options.extensions.startInline.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(a)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},eu=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(s.notSpaceStart)?.[0],a=e.replace(s.endingNewline,"")+`
41
41
  `;return n?'<pre><code class="language-'+ea(n)+'">'+(r?a:ea(a,!0))+`</code></pre>
42
42
  `:"<pre><code>"+(r?a:ea(a,!0))+`</code></pre>
43
43
  `}blockquote({tokens:e}){return`<blockquote>
@@ -55,8 +55,8 @@ ${this.parser.parse(e)}</blockquote>
55
55
  `}tablerow({text:e}){return`<tr>
56
56
  ${e}</tr>
57
57
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
58
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ea(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),a=ei(e);if(null===a)return n;let i='<a href="'+(e=a)+'"';return t&&(i+=' title="'+ea(t)+'"'),i+=">"+n+"</a>"}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let a=ei(e);if(null===a)return ea(r);e=a;let i=`<img src="${e}" alt="${ea(r)}"`;return t&&(i+=` title="${ea(t)}"`),i+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ea(e.text)}},ep=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},eh=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new ed,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ep}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){t+=e||"";continue}}switch(n.type){case"space":t+=this.renderer.space(n);break;case"hr":t+=this.renderer.hr(n);break;case"heading":t+=this.renderer.heading(n);break;case"code":t+=this.renderer.code(n);break;case"table":t+=this.renderer.table(n);break;case"blockquote":t+=this.renderer.blockquote(n);break;case"list":t+=this.renderer.list(n);break;case"checkbox":t+=this.renderer.checkbox(n);break;case"html":t+=this.renderer.html(n);break;case"def":t+=this.renderer.def(n);break;case"paragraph":t+=this.renderer.paragraph(n);break;case"text":t+=this.renderer.text(n);break;default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=e||"";continue}}switch(a.type){case"escape":case"text":r+=t.text(a);break;case"html":r+=t.html(a);break;case"link":r+=t.link(a);break;case"image":r+=t.image(a);break;case"checkbox":r+=t.checkbox(a);break;case"strong":r+=t.strong(a);break;case"em":r+=t.em(a);break;case"codespan":r+=t.codespan(a);break;case"br":r+=t.br(a);break;case"del":r+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},eg=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?eu.lex:eu.lexInline}provideParser(e=this.block){return e?eh.parse:eh.parseInline}},ef=new class{defaults=t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eh;Renderer=ed;TextRenderer=ep;Lexer=eu;Tokenizer=ec;Hooks=eg;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)r=r.concat(this.walkTokens(n.tokens,t));break;case"list":r=r.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let a=e[n].flat(1/0);r=r.concat(this.walkTokens(a,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new ed(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=e.renderer[r],a=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ec(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eg;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let n=e.hooks[r],a=t[r];eg.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&eg.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(t,e);return a.call(t,r)})();let i=n.call(t,e);return a.call(t,i)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(t,e);return!1===r&&(r=await a.apply(t,e)),r})();let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return eu.lex(e,t??this.defaults)}parser(e,t){return eh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},a={...this.defaults,...n},i=this.onError(!!a.silent,!!a.async);if(!0===this.defaults.async&&!1===n.async)return i(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let r=a.hooks?await a.hooks.preprocess(t):t,n=await (a.hooks?await a.hooks.provideLexer(e):e?eu.lex:eu.lexInline)(r,a),i=a.hooks?await a.hooks.processAllTokens(n):n;a.walkTokens&&await Promise.all(this.walkTokens(i,a.walkTokens));let s=await (a.hooks?await a.hooks.provideParser(e):e?eh.parse:eh.parseInline)(i,a);return a.hooks?await a.hooks.postprocess(s):s})().catch(i);try{a.hooks&&(t=a.hooks.preprocess(t));let r=(a.hooks?a.hooks.provideLexer(e):e?eu.lex:eu.lexInline)(t,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let n=(a.hooks?a.hooks.provideParser(e):e?eh.parse:eh.parseInline)(r,a);return a.hooks&&(n=a.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return r=>{if(r.message+=`
59
- Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+ea(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function em(e,t){return ef.parse(e,t)}em.options=em.setOptions=function(e){return ef.setOptions(e),em.defaults=ef.defaults,r=em.defaults,em},em.getDefaults=t,em.defaults=r,em.use=function(...e){return ef.use(...e),em.defaults=ef.defaults,r=em.defaults,em},em.walkTokens=function(e,t){return ef.walkTokens(e,t)},em.parseInline=ef.parseInline,em.Parser=eh,em.parser=eh.parse,em.Renderer=ed,em.TextRenderer=ep,em.Lexer=eu,em.lexer=eu.lex,em.Tokenizer=ec,em.Hooks=eg,em.parse=em,em.options,em.setOptions,em.use,em.walkTokens,em.parseInline,eh.parse,eu.lex,e.s(["Lexer",0,eu,"marked",0,em])},967723,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],967723)},492451,e=>{"use strict";let t=(0,e.i(419412).default)("file",[["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"}]]);e.s(["File",0,t],492451)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["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"}]]);e.s(["FileText",0,t],80137)},68322,522281,e=>{"use strict";var t=e.i(566710);e.s([],68322),e.s(["Streamdown",()=>t.C],522281)},500324,e=>{"use strict";var t=e.i(653772),r=e.i(511043);let n=(0,r.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:a,children:i}){return(0,r.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",a)}catch{}},[a]),(0,t.jsx)(n.Provider,{value:{workspaceId:e,slug:a},children:i})},"useWorkspace",0,function(){let e=(0,r.useContext)(n);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},126942,(e,t,r)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class r extends Error{status;details;constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.details=r}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function n(e,t){return"validation error"===e&&t?.length?function(e){let[t,...r]=e.split(":"),n=r.join(":").trim();if(!n)return e;let a=t.trim(),i=a.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=n.replace(/^required$/i,"is required"),l=s.toLowerCase().replace(/[_-]+/g," "),o=a.toLowerCase().replace(/[_-]+/g," ");return o&&l.startsWith(`${o} `)&&(s=s.slice(a.length).trimStart()),i?`${i} ${s}`:s}(t[0]):e}async function a(e,t){let a;try{a=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===a.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!a.ok){let e,t;try{let r=await a.json();e=r.error,t=r.details}catch{}if(429===a.status)throw new r("Please wait a moment before trying again",429);if(a.status>=500)throw new r(n(e,t)||"Something went wrong — please try again",a.status,t);throw new r(n(e,t)||"Something went wrong",a.status,t)}if(204!==a.status)return a.json()}function i(e,t){let r=new URLSearchParams({workspace_id:e,...t});return`?${r.toString()}`}e.s(["ApiError",0,r],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,n,s,l)=>{let o;if(!s||0===s.length)return a(`/api/conversations/${e}/messages${i(n)}`,{method:"POST",body:JSON.stringify({content:t,...l?{metadata:l}:{}})});let c=new FormData;for(let e of(c.append("content",t),l&&c.append("metadata",JSON.stringify(l)),s))c.append("file",e);try{o=await fetch(`/api/conversations/${e}/messages${i(n)}`,{method:"POST",credentials:"include",body:c})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===o.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!o.ok){let e,t;try{let r=await o.json();e=r.error,t=r.details}catch{}if(429===o.status)throw new r("Please wait a moment before trying again",429);if(o.status>=500)throw new r(e||"Something went wrong — please try again",o.status,t);throw new r(e||"Something went wrong",o.status,t)}return o.json()},l=async(e,t)=>{let r=new URLSearchParams({workspace_id:t}),n=await fetch(`/api/email/${e}/body?${r}`,{credentials:"include"});if(!n.ok)return{content:"(body not available)",isHtml:!1};let a=n.headers.get("Content-Type")??"";return{content:await n.text(),isHtml:a.includes("text/html")}},o=async(e,t)=>{let n=new FormData;n.append("file",e);let a=await fetch(`/api/email/upload${i(t)}`,{method:"POST",credentials:"include",body:n});if(!a.ok)throw new r(await a.text().catch(()=>"Upload failed"),a.status);return a.json()},c=async(e,t)=>{let n;if(!t.files||0===t.files.length)return a(`/api/issues${i(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{n=await fetch(`/api/issues${i(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!n.ok){let e,t;try{let r=await n.json();e=r.error,t=r.details}catch{}if(429===n.status)throw new r("Please wait a moment before trying again",429);if(n.status>=500)throw new r(e||"Something went wrong — please try again",n.status,t);throw new r(e||"Something went wrong",n.status,t)}return n.json()},u=async(e,t)=>{let r=new URLSearchParams({workspace_id:t}),n=await fetch(`/api/artifacts/${e}/content?${r}`,{credentials:"include"});return n.ok?n.text():"(content not available)"};e.s(["acceptInvite",0,e=>a(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,r)=>a(`/api/agents/${e}/whitelist${i(r)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}/approve${i(r)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>a(`/api/conversations/${e}/active-task${i(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,r)=>a(`/api/agents/${e}/chat-init${i(t)}`,{method:"POST",body:JSON.stringify({...r?{channel:r}:{}})}),"checkFreshness",0,(e,t)=>{let r={};return e.conversationId&&(r.conversation_id=e.conversationId),e.agentId&&(r.agent_id=e.agentId),e.channel&&(r.channel=e.channel),a(`/api/conversations/check-fresh${i(t,r)}`)},"conversationInit",0,(e,t,r)=>{let n={};return r?.newestMessageId&&(n.newest_message_id=r.newestMessageId),r?.messageCount&&(n.message_count=String(r.messageCount)),a(`/api/conversations/${e}/init${i(t,n)}`)},"createAgent",0,(e,t)=>a(`/api/agents${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>a(`/api/agent-links${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>a(`/api/calendar${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>a(`/api/channels${i(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,r)=>a(`/api/conversations${i(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...r?{channel:r}:{}})}),"createEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts${i(r)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>a(`/api/workspaces/${e}/invites${i(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>a(`/api/machine-tokens${t?i(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings${i(t)}`,{method:"POST",body:JSON.stringify(r)}),"deleteAgent",0,(e,t)=>a(`/api/agents/${e}${i(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>a(`/api/agent-links/${e}${i(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,r)=>a(`/api/calendar/${e}${i(t)}`,{method:"DELETE",...r&&r.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}:{}}),"deleteChannelApi",0,(e,t)=>a(`/api/channels/${e}${i(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>a(`/api/email/${e}${i(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts/${t}${i(r)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>a(`/api/issues/${t}${i(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>a(`/api/runtimes/machine${i(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}${i(r)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>a(`/api/workspaces/${e}${i(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>a("/api/cli/latest-version"),"fetchModelOptions",0,()=>a("/api/config/model-options"),"flagMessage",0,(e,t)=>a(`/api/flags${i(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>a(`/api/conversations/${e}/active-task${i(t)}`),"getAgentSkills",0,(e,t)=>a(`/api/agents/${e}/skills${i(t)}`),"getArtifactContent",0,u,"getCalendarEvent",0,(e,t)=>a(`/api/calendar/${e}${i(t)}`),"getEmail",0,(e,t)=>a(`/api/email/${e}${i(t)}`),"getEmailBody",0,l,"getEmailThread",0,(e,t)=>a(`/api/email/${e}/thread${i(t)}`),"getFlaggedCount",0,e=>a(`/api/flags/count${i(e)}`),"getInboxCount",0,(e,t)=>{let r={};return t?.types?.length&&(r.types=t.types.join(",")),a(`/api/inbox/count${i(e,r)}`)},"getInviteInfo",0,e=>a(`/api/invite/${e}`),"getIssue",0,(e,t)=>a(`/api/issues/${t}${i(e)}`),"getMachineTokenStatus",0,()=>a("/api/machine-tokens/status"),"getMemberMe",0,e=>a(`/api/members/me${i(e)}`),"getMinCliVersion",0,()=>a("/api/config/min-version"),"getTask",0,(e,t)=>a(`/api/tasks/${e}${i(t)}`),"getTaskMessages",0,(e,t,r)=>a(`/api/tasks/${e}/messages${i(t,r?{since:String(r)}:void 0)}`),"getTrace",0,(e,t)=>a(`/api/traces/${e}${i(t)}`),"getWorkspaceOverview",0,e=>a(`/api/workspaces/${e}/overview${i(e)}`),"grantAgentAccess",0,(e,t,r)=>a(`/api/agents/${t}/access${i(e)}`,{method:"POST",body:JSON.stringify({user_id:r})}),"listAgentAccess",0,(e,t)=>a(`/api/agents/${t}/access${i(e)}`),"listAgentActiveTaskCounts",0,e=>a(`/api/agents/active-task-counts${i(e)}`),"listAgentActivity",0,(e,t,r)=>{let n={};return r?.limit&&(n.limit=String(r.limit)),r?.before&&(n.before=r.before),r?.beforeId&&(n.before_id=r.beforeId),r?.status&&(n.status=r.status),r?.type&&(n.type=r.type),a(`/api/agents/${e}/activity${i(t,n)}`)},"listAgentLinks",0,e=>a(`/api/agent-links${i(e)}`),"listAgentPins",0,e=>a(`/api/agents/pins${i(e)}`),"listAgents",0,e=>a(`/api/agents${i(e)}`),"listArtifacts",0,(e,t)=>a(`/api/artifacts${i(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let r={};return t?.agentId&&(r.agentId=t.agentId),t?.from&&(r.from=t.from),t?.to&&(r.to=t.to),a(`/api/calendar${i(e,r)}`)},"listChannels",0,e=>a(`/api/channels${i(e)}`),"listEmailAccounts",0,(e,t)=>a(`/api/agents/${e}/email-accounts${i(t)}`),"listEmails",0,(e,t,r,n)=>a(`/api/email${i(t,{agentId:e,...r?{folder:r}:{},...n?{address:n}:{}})}`),"listFlaggedItems",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),a(`/api/flags${i(e,r)}`)},"listFlaggedMessageIds",0,(e,t)=>a(`/api/flags${i(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),t?.types?.length&&(r.types=t.types.join(",")),a(`/api/inbox${i(e,r)}`)},"listInvites",0,e=>a(`/api/workspaces/${e}/invites${i(e)}`),"listIssues",0,(e,t)=>{let r={};return t?.agentId&&(r.agentId=t.agentId),t?.status&&(r.status=t.status),t?.terminal!==void 0&&(r.terminal=String(t.terminal)),a(`/api/issues${i(e,r)}`)},"listMeetings",0,(e,t)=>a(`/api/agents/${e}/meetings${i(t)}`),"listMembers",0,e=>a(`/api/workspaces/${e}/members${i(e)}`),"listMessages",0,(e,t,r)=>{let n={};return r?.limit&&(n.limit=String(r.limit)),r?.before&&(n.before=r.before),r?.beforeId&&(n.before_id=r.beforeId),a(`/api/conversations/${e}/messages${i(t,n)}`)},"listMessagesAroundTask",0,(e,t,r)=>a(`/api/conversations/${e}/messages${i(t,{around_task:r})}`),"listPreviousConversations",0,(e,t,r)=>{let n={exclude:r.exclude,before:r.before};return r.channel&&(n.channel=r.channel),r.limit&&(n.limit=String(r.limit)),a(`/api/agents/${e}/conversations${i(t,n)}`)},"listRuntimes",0,e=>a(`/api/runtimes${i(e)}`),"listTraces",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),t?.status&&(r.status=t.status),t?.multiAgent&&(r.multiAgent="true"),t?.agentId&&(r.agentId=t.agentId),t?.channel&&(r.channel=t.channel),a(`/api/traces${i(e,r)}`)},"listWhitelist",0,(e,t)=>a(`/api/agents/${e}/whitelist${i(t)}`),"listWorkspaceActiveTasks",0,e=>a(`/api/agents/active-tasks${i(e)}`),"listWorkspaces",0,()=>a("/api/workspaces"),"markAllInboxRead",0,e=>a(`/api/inbox/read-all${i(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>a(`/api/inbox/read${i(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>a(`/api/agents/${t}/pin${i(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>a(`/api/workspaces/${e}/members/${t}${i(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,r)=>a(`/api/agents/${e}/whitelist/${t}${i(r)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,r)=>a(`/api/channels/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({name:r})}),"reorderAgentPins",0,(e,t)=>a(`/api/agents/pins/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>a(`/api/channels/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>a(`/api/agents/sidebar/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,r,n)=>a(`/api/agents/${e}/workspace/browse${i(t)}`,{method:"POST",body:JSON.stringify({request_type:r,path:n})}),"retryTask",0,(e,t)=>a(`/api/tasks/${e}/retry${i(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,r,n=!1)=>a(`/api/agents/${t}/access/${r}${i(e)}${n?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>a(`/api/workspaces/${e}/invites/${t}${i(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,r,n,s,l,o,c)=>a(`/api/email/send${i(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:r,htmlBody:n,attachments:l,...o,customAccountId:c})}),"sendMessage",0,s,"stopMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}/stop${i(r)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts/${t}/sync${i(r)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>a(`/api/runtimes/${e}/rescan${i(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>a(`/api/runtimes/${e}/update${i(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>a(`/api/flags/${t}${i(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>a(`/api/agents/${t}/pin${i(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,r)=>a(`/api/agents/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,r)=>a(`/api/agent-links/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,r)=>a(`/api/calendar/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,r)=>a(`/api/email/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({status:r})}),"updateIssue",0,(e,t,r)=>a(`/api/issues/${t}${i(e)}`,{method:"PATCH",body:JSON.stringify(r)}),"updateMemberMe",0,(e,t)=>a(`/api/members/me${i(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>a(`/api/workspaces/${e}${i(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,o],222862)},728886,e=>{"use strict";var t=e.i(653772),r=e.i(613349);e.s(["Skeleton",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("animate-pulse rounded-md bg-muted",e),...n})}])},896210,e=>{"use strict";let t=(0,e.i(419412).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,t],896210)},330746,e=>{"use strict";let t=(0,e.i(419412).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],330746)},966662,940931,e=>{"use strict";let t=(0,e.i(419412).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],966662);var r=e.i(653772),n=e.i(511043),a=e.i(111114);let i=`
58
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ea(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),a=ei(e);if(null===a)return n;let i='<a href="'+(e=a)+'"';return t&&(i+=' title="'+ea(t)+'"'),i+=">"+n+"</a>"}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let a=ei(e);if(null===a)return ea(r);e=a;let i=`<img src="${e}" alt="${ea(r)}"`;return t&&(i+=` title="${ea(t)}"`),i+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ea(e.text)}},ep=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},eh=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new eu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ep}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){t+=e||"";continue}}switch(n.type){case"space":t+=this.renderer.space(n);break;case"hr":t+=this.renderer.hr(n);break;case"heading":t+=this.renderer.heading(n);break;case"code":t+=this.renderer.code(n);break;case"table":t+=this.renderer.table(n);break;case"blockquote":t+=this.renderer.blockquote(n);break;case"list":t+=this.renderer.list(n);break;case"checkbox":t+=this.renderer.checkbox(n);break;case"html":t+=this.renderer.html(n);break;case"def":t+=this.renderer.def(n);break;case"paragraph":t+=this.renderer.paragraph(n);break;case"text":t+=this.renderer.text(n);break;default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=e||"";continue}}switch(a.type){case"escape":case"text":r+=t.text(a);break;case"html":r+=t.html(a);break;case"link":r+=t.link(a);break;case"image":r+=t.image(a);break;case"checkbox":r+=t.checkbox(a);break;case"strong":r+=t.strong(a);break;case"em":r+=t.em(a);break;case"codespan":r+=t.codespan(a);break;case"br":r+=t.br(a);break;case"del":r+=t.del(a);break;default:{let e='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},eg=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ed.lex:ed.lexInline}provideParser(e=this.block){return e?eh.parse:eh.parseInline}},ef=new class{defaults=t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eh;Renderer=eu;TextRenderer=ep;Lexer=ed;Tokenizer=ec;Hooks=eg;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)r=r.concat(this.walkTokens(n.tokens,t));break;case"list":r=r.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let a=e[n].flat(1/0);r=r.concat(this.walkTokens(a,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new eu(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=e.renderer[r],a=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ec(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eg;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let n=e.hooks[r],a=t[r];eg.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&eg.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(t,e);return a.call(t,r)})();let i=n.call(t,e);return a.call(t,i)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(t,e);return!1===r&&(r=await a.apply(t,e)),r})();let r=n.apply(t,e);return!1===r&&(r=a.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ed.lex(e,t??this.defaults)}parser(e,t){return eh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},a={...this.defaults,...n},i=this.onError(!!a.silent,!!a.async);if(!0===this.defaults.async&&!1===n.async)return i(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return i(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return(async()=>{let r=a.hooks?await a.hooks.preprocess(t):t,n=await (a.hooks?await a.hooks.provideLexer(e):e?ed.lex:ed.lexInline)(r,a),i=a.hooks?await a.hooks.processAllTokens(n):n;a.walkTokens&&await Promise.all(this.walkTokens(i,a.walkTokens));let s=await (a.hooks?await a.hooks.provideParser(e):e?eh.parse:eh.parseInline)(i,a);return a.hooks?await a.hooks.postprocess(s):s})().catch(i);try{a.hooks&&(t=a.hooks.preprocess(t));let r=(a.hooks?a.hooks.provideLexer(e):e?ed.lex:ed.lexInline)(t,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let n=(a.hooks?a.hooks.provideParser(e):e?eh.parse:eh.parseInline)(r,a);return a.hooks&&(n=a.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return r=>{if(r.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+ea(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function em(e,t){return ef.parse(e,t)}em.options=em.setOptions=function(e){return ef.setOptions(e),em.defaults=ef.defaults,r=em.defaults,em},em.getDefaults=t,em.defaults=r,em.use=function(...e){return ef.use(...e),em.defaults=ef.defaults,r=em.defaults,em},em.walkTokens=function(e,t){return ef.walkTokens(e,t)},em.parseInline=ef.parseInline,em.Parser=eh,em.parser=eh.parse,em.Renderer=eu,em.TextRenderer=ep,em.Lexer=ed,em.lexer=ed.lex,em.Tokenizer=ec,em.Hooks=eg,em.parse=em,em.options,em.setOptions,em.use,em.walkTokens,em.parseInline,eh.parse,ed.lex,e.s(["Lexer",0,ed,"marked",0,em])},967723,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],967723)},492451,e=>{"use strict";let t=(0,e.i(419412).default)("file",[["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"}]]);e.s(["File",0,t],492451)},80137,e=>{"use strict";let t=(0,e.i(419412).default)("file-text",[["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"}]]);e.s(["FileText",0,t],80137)},68322,522281,e=>{"use strict";var t=e.i(566710);e.s([],68322),e.s(["Streamdown",()=>t.C],522281)},500324,e=>{"use strict";var t=e.i(653772),r=e.i(511043);let n=(0,r.createContext)(null);e.s(["WorkspaceProvider",0,function({workspaceId:e,slug:a,children:i}){return(0,r.useEffect)(()=>{try{localStorage.setItem("lastWorkspace",a)}catch{}},[a]),(0,t.jsx)(n.Provider,{value:{workspaceId:e,slug:a},children:i})},"useWorkspace",0,function(){let e=(0,r.useContext)(n);if(!e)throw Error("useWorkspace must be used within WorkspaceProvider");return e}])},126942,(e,t,r)=>{t.exports=e.r(871628)},222862,636557,e=>{"use strict";var t=e.i(811374);class r extends Error{status;details;constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.details=r}get isNetworkError(){return 0===this.status}get isRateLimit(){return 429===this.status}get isUnauthorized(){return 401===this.status}}function n(e,t){return"validation error"===e&&t?.length?function(e){let[t,...r]=e.split(":"),n=r.join(":").trim();if(!n)return e;let a=t.trim(),i=a.trim().replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),s=n.replace(/^required$/i,"is required"),o=s.toLowerCase().replace(/[_-]+/g," "),l=a.toLowerCase().replace(/[_-]+/g," ");return l&&o.startsWith(`${l} `)&&(s=s.slice(a.length).trimStart()),i?`${i} ${s}`:s}(t[0]):e}async function a(e,t){let a;try{a=await fetch(""+e,{...t,credentials:"include",headers:{"Content-Type":"application/json",...t?.headers}})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===a.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!a.ok){let e,t;try{let r=await a.json();e=r.error,t=r.details}catch{}if(429===a.status)throw new r("Please wait a moment before trying again",429);if(a.status>=500)throw new r(n(e,t)||"Something went wrong — please try again",a.status,t);throw new r(n(e,t)||"Something went wrong",a.status,t)}if(204!==a.status)return a.json()}function i(e,t){let r=new URLSearchParams({workspace_id:e,...t});return`?${r.toString()}`}e.s(["ApiError",0,r],636557),parseInt(t.default.env.NEXT_PUBLIC_MOCK_NETWORK_DELAY_MS||"300",10);let s=async(e,t,n,s,o)=>{let l;if(!s||0===s.length)return a(`/api/conversations/${e}/messages${i(n)}`,{method:"POST",body:JSON.stringify({content:t,...o?{metadata:o}:{}})});let c=new FormData;for(let e of(c.append("content",t),o&&c.append("metadata",JSON.stringify(o)),s))c.append("file",e);try{l=await fetch(`/api/conversations/${e}/messages${i(n)}`,{method:"POST",credentials:"include",body:c})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===l.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!l.ok){let e,t;try{let r=await l.json();e=r.error,t=r.details}catch{}if(429===l.status)throw new r("Please wait a moment before trying again",429);if(l.status>=500)throw new r(e||"Something went wrong — please try again",l.status,t);throw new r(e||"Something went wrong",l.status,t)}return l.json()},o=async(e,t)=>{let r=new URLSearchParams({workspace_id:t}),n=await fetch(`/api/email/${e}/body?${r}`,{credentials:"include"});if(!n.ok)return{content:"(body not available)",isHtml:!1};let a=n.headers.get("Content-Type")??"";return{content:await n.text(),isHtml:a.includes("text/html")}},l=async(e,t)=>{let n=new FormData;n.append("file",e);let a=await fetch(`/api/email/upload${i(t)}`,{method:"POST",credentials:"include",body:n});if(!a.ok)throw new r(await a.text().catch(()=>"Upload failed"),a.status);return a.json()},c=async(e,t)=>{let n;if(!t.files||0===t.files.length)return a(`/api/issues${i(e)}`,{method:"POST",body:JSON.stringify({agent_id:t.agent_id,title:t.title,description:t.description})});let s=new FormData;for(let e of(t.agent_id&&s.append("agent_id",t.agent_id),s.append("title",t.title),s.append("description",t.description??""),t.files))s.append("file",e);try{n=await fetch(`/api/issues${i(e)}`,{method:"POST",credentials:"include",body:s})}catch(e){if(e instanceof TypeError)throw new r("Unable to connect — check your network",0);throw e}if(401===n.status)throw window.location.href="/sign-in",new r("Unauthorized",401);if(!n.ok){let e,t;try{let r=await n.json();e=r.error,t=r.details}catch{}if(429===n.status)throw new r("Please wait a moment before trying again",429);if(n.status>=500)throw new r(e||"Something went wrong — please try again",n.status,t);throw new r(e||"Something went wrong",n.status,t)}return n.json()},d=async(e,t)=>{let r=new URLSearchParams({workspace_id:t}),n=await fetch(`/api/artifacts/${e}/content?${r}`,{credentials:"include"});return n.ok?n.text():"(content not available)"};e.s(["acceptInvite",0,e=>a(`/api/invite/${e}`,{method:"POST"}),"addWhitelistEmail",0,(e,t,r)=>a(`/api/agents/${e}/whitelist${i(r)}`,{method:"POST",body:JSON.stringify({email:t})}),"approveMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}/approve${i(r)}`,{method:"POST"}),"cancelActiveTask",0,(e,t)=>a(`/api/conversations/${e}/active-task${i(t)}`,{method:"DELETE"}),"chatInit",0,(e,t,r)=>a(`/api/agents/${e}/chat-init${i(t)}`,{method:"POST",body:JSON.stringify({...r?{channel:r}:{}})}),"checkFreshness",0,(e,t)=>{let r={};return e.conversationId&&(r.conversation_id=e.conversationId),e.agentId&&(r.agent_id=e.agentId),e.channel&&(r.channel=e.channel),a(`/api/conversations/check-fresh${i(t,r)}`)},"conversationInit",0,(e,t,r)=>{let n={};return r?.newestMessageId&&(n.newest_message_id=r.newestMessageId),r?.messageCount&&(n.message_count=String(r.messageCount)),a(`/api/conversations/${e}/init${i(t,n)}`)},"createAgent",0,(e,t)=>a(`/api/agents${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createAgentLink",0,(e,t)=>a(`/api/agent-links${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createCalendarEvent",0,(e,t)=>a(`/api/calendar${i(t)}`,{method:"POST",body:JSON.stringify(e)}),"createChannelApi",0,(e,t)=>a(`/api/channels${i(e)}`,{method:"POST",body:JSON.stringify({name:t})}),"createConversation",0,(e,t,r)=>a(`/api/conversations${i(t)}`,{method:"POST",body:JSON.stringify({agent_id:e,...r?{channel:r}:{}})}),"createEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts${i(r)}`,{method:"POST",body:JSON.stringify(t)}),"createInvite",0,e=>a(`/api/workspaces/${e}/invites${i(e)}`,{method:"POST"}),"createIssue",0,c,"createMachineToken",0,(e,t)=>a(`/api/machine-tokens${t?i(t):""}`,{method:"POST",body:JSON.stringify({name:e||"default"})}),"createMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings${i(t)}`,{method:"POST",body:JSON.stringify(r)}),"deleteAgent",0,(e,t)=>a(`/api/agents/${e}${i(t)}`,{method:"DELETE"}),"deleteAgentLink",0,(e,t)=>a(`/api/agent-links/${e}${i(t)}`,{method:"DELETE"}),"deleteCalendarEvent",0,(e,t,r)=>a(`/api/calendar/${e}${i(t)}`,{method:"DELETE",...r&&r.scope?{headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}:{}}),"deleteChannelApi",0,(e,t)=>a(`/api/channels/${e}${i(t)}`,{method:"DELETE"}),"deleteEmail",0,(e,t)=>a(`/api/email/${e}${i(t)}`,{method:"DELETE"}),"deleteEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts/${t}${i(r)}`,{method:"DELETE"}),"deleteIssue",0,(e,t)=>a(`/api/issues/${t}${i(e)}`,{method:"DELETE"}),"deleteMachine",0,(e,t)=>a(`/api/runtimes/machine${i(t,{daemon_id:e})}`,{method:"DELETE"}),"deleteMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}${i(r)}`,{method:"DELETE"}),"deleteWorkspace",0,(e,t)=>a(`/api/workspaces/${e}${i(e)}`,{method:"DELETE",body:JSON.stringify({confirm_name:t})}),"fetchLatestCliVersion",0,()=>a("/api/cli/latest-version"),"fetchModelOptions",0,()=>a("/api/config/model-options"),"flagMessage",0,(e,t)=>a(`/api/flags${i(e)}`,{method:"POST",body:JSON.stringify({messageId:t})}),"getActiveTask",0,(e,t)=>a(`/api/conversations/${e}/active-task${i(t)}`),"getAgentSkills",0,(e,t)=>a(`/api/agents/${e}/skills${i(t)}`),"getArtifactContent",0,d,"getCalendarEvent",0,(e,t)=>a(`/api/calendar/${e}${i(t)}`),"getEmail",0,(e,t)=>a(`/api/email/${e}${i(t)}`),"getEmailBody",0,o,"getEmailThread",0,(e,t)=>a(`/api/email/${e}/thread${i(t)}`),"getFlaggedCount",0,e=>a(`/api/flags/count${i(e)}`),"getInboxCount",0,(e,t)=>{let r={};return t?.types?.length&&(r.types=t.types.join(",")),a(`/api/inbox/count${i(e,r)}`)},"getInviteInfo",0,e=>a(`/api/invite/${e}`),"getIssue",0,(e,t)=>a(`/api/issues/${t}${i(e)}`),"getMachineTokenStatus",0,()=>a("/api/machine-tokens/status"),"getMemberMe",0,e=>a(`/api/members/me${i(e)}`),"getMinCliVersion",0,()=>a("/api/config/min-version"),"getTask",0,(e,t)=>a(`/api/tasks/${e}${i(t)}`),"getTaskMessages",0,(e,t,r)=>a(`/api/tasks/${e}/messages${i(t,r?{since:String(r)}:void 0)}`),"getTrace",0,(e,t)=>a(`/api/traces/${e}${i(t)}`),"getWorkspaceOverview",0,e=>a(`/api/workspaces/${e}/overview${i(e)}`),"grantAgentAccess",0,(e,t,r)=>a(`/api/agents/${t}/access${i(e)}`,{method:"POST",body:JSON.stringify({user_id:r})}),"listAgentAccess",0,(e,t)=>a(`/api/agents/${t}/access${i(e)}`),"listAgentActiveTaskCounts",0,e=>a(`/api/agents/active-task-counts${i(e)}`),"listAgentActivity",0,(e,t,r)=>{let n={};return r?.limit&&(n.limit=String(r.limit)),r?.before&&(n.before=r.before),r?.beforeId&&(n.before_id=r.beforeId),r?.status&&(n.status=r.status),r?.type&&(n.type=r.type),a(`/api/agents/${e}/activity${i(t,n)}`)},"listAgentLinks",0,e=>a(`/api/agent-links${i(e)}`),"listAgentPins",0,e=>a(`/api/agents/pins${i(e)}`),"listAgents",0,e=>a(`/api/agents${i(e)}`),"listArtifacts",0,(e,t)=>a(`/api/artifacts${i(t,{conversation_id:e})}`),"listCalendarEvents",0,(e,t)=>{let r={};return t?.agentId&&(r.agentId=t.agentId),t?.from&&(r.from=t.from),t?.to&&(r.to=t.to),a(`/api/calendar${i(e,r)}`)},"listChannels",0,e=>a(`/api/channels${i(e)}`),"listEmailAccounts",0,(e,t)=>a(`/api/agents/${e}/email-accounts${i(t)}`),"listEmails",0,(e,t,r,n)=>a(`/api/email${i(t,{agentId:e,...r?{folder:r}:{},...n?{address:n}:{}})}`),"listFlaggedItems",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),a(`/api/flags${i(e,r)}`)},"listFlaggedMessageIds",0,(e,t)=>a(`/api/flags${i(e,{conversation_id:t,ids_only:"true"})}`),"listInboxItems",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),t?.types?.length&&(r.types=t.types.join(",")),a(`/api/inbox${i(e,r)}`)},"listInvites",0,e=>a(`/api/workspaces/${e}/invites${i(e)}`),"listIssues",0,(e,t)=>{let r={};return t?.agentId&&(r.agentId=t.agentId),t?.status&&(r.status=t.status),t?.terminal!==void 0&&(r.terminal=String(t.terminal)),a(`/api/issues${i(e,r)}`)},"listMeetings",0,(e,t)=>a(`/api/agents/${e}/meetings${i(t)}`),"listMembers",0,e=>a(`/api/workspaces/${e}/members${i(e)}`),"listMessages",0,(e,t,r)=>{let n={};return r?.limit&&(n.limit=String(r.limit)),r?.before&&(n.before=r.before),r?.beforeId&&(n.before_id=r.beforeId),a(`/api/conversations/${e}/messages${i(t,n)}`)},"listMessagesAroundTask",0,(e,t,r)=>a(`/api/conversations/${e}/messages${i(t,{around_task:r})}`),"listPreviousConversations",0,(e,t,r)=>{let n={exclude:r.exclude,before:r.before};return r.channel&&(n.channel=r.channel),r.limit&&(n.limit=String(r.limit)),a(`/api/agents/${e}/conversations${i(t,n)}`)},"listRuntimes",0,e=>a(`/api/runtimes${i(e)}`),"listTraces",0,(e,t)=>{let r={};return t?.limit&&(r.limit=String(t.limit)),t?.before&&(r.before=t.before),t?.status&&(r.status=t.status),t?.multiAgent&&(r.multiAgent="true"),t?.agentId&&(r.agentId=t.agentId),t?.channel&&(r.channel=t.channel),a(`/api/traces${i(e,r)}`)},"listWhitelist",0,(e,t)=>a(`/api/agents/${e}/whitelist${i(t)}`),"listWorkspaceActiveTasks",0,e=>a(`/api/agents/active-tasks${i(e)}`),"listWorkspaces",0,()=>a("/api/workspaces"),"markAllInboxRead",0,e=>a(`/api/inbox/read-all${i(e)}`,{method:"POST"}),"markInboxRead",0,(e,t)=>a(`/api/inbox/read${i(t)}`,{method:"POST",body:JSON.stringify({conversationId:e})}),"pinAgent",0,(e,t)=>a(`/api/agents/${t}/pin${i(e)}`,{method:"POST"}),"removeMember",0,(e,t)=>a(`/api/workspaces/${e}/members/${t}${i(e)}`,{method:"DELETE"}),"removeWhitelistEmail",0,(e,t,r)=>a(`/api/agents/${e}/whitelist/${t}${i(r)}`,{method:"DELETE"}),"renameChannelApi",0,(e,t,r)=>a(`/api/channels/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({name:r})}),"reorderAgentPins",0,(e,t)=>a(`/api/agents/pins/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"reorderChannelsApi",0,(e,t)=>a(`/api/channels/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_channel_ids:t})}),"reorderUnpinnedAgents",0,(e,t)=>a(`/api/agents/sidebar/reorder${i(e)}`,{method:"PUT",body:JSON.stringify({ordered_agent_ids:t})}),"requestWorkspaceBrowse",0,(e,t,r,n)=>a(`/api/agents/${e}/workspace/browse${i(t)}`,{method:"POST",body:JSON.stringify({request_type:r,path:n})}),"retryTask",0,(e,t)=>a(`/api/tasks/${e}/retry${i(t)}`,{method:"POST"}),"revokeAgentAccess",0,(e,t,r,n=!1)=>a(`/api/agents/${t}/access/${r}${i(e)}${n?"&remove_whitelist=true":""}`,{method:"DELETE"}),"revokeInvite",0,(e,t)=>a(`/api/workspaces/${e}/invites/${t}${i(e)}`,{method:"DELETE"}),"sendEmail",0,(e,t,r,n,s,o,l,c)=>a(`/api/email/send${i(s)}`,{method:"POST",body:JSON.stringify({agentId:e,to:t,subject:r,htmlBody:n,attachments:o,...l,customAccountId:c})}),"sendMessage",0,s,"stopMeeting",0,(e,t,r)=>a(`/api/agents/${e}/meetings/${t}/stop${i(r)}`,{method:"POST"}),"syncEmailAccount",0,(e,t,r)=>a(`/api/agents/${e}/email-accounts/${t}/sync${i(r)}`,{method:"POST"}),"triggerRuntimeRescan",0,(e,t)=>a(`/api/runtimes/${e}/rescan${i(t)}`,{method:"POST"}),"triggerRuntimeUpdate",0,(e,t)=>a(`/api/runtimes/${e}/update${i(t)}`,{method:"POST"}),"unflagMessage",0,(e,t)=>a(`/api/flags/${t}${i(e)}`,{method:"DELETE"}),"unpinAgent",0,(e,t)=>a(`/api/agents/${t}/pin${i(e)}`,{method:"DELETE"}),"updateAgent",0,(e,t,r)=>a(`/api/agents/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateAgentLink",0,(e,t,r)=>a(`/api/agent-links/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateCalendarEvent",0,(e,t,r)=>a(`/api/calendar/${e}${i(r)}`,{method:"PATCH",body:JSON.stringify(t)}),"updateEmailStatus",0,(e,t,r)=>a(`/api/email/${e}${i(t)}`,{method:"PATCH",body:JSON.stringify({status:r})}),"updateIssue",0,(e,t,r)=>a(`/api/issues/${t}${i(e)}`,{method:"PATCH",body:JSON.stringify(r)}),"updateMemberMe",0,(e,t)=>a(`/api/members/me${i(e)}`,{method:"PATCH",body:JSON.stringify({global_instruction:t})}),"updateWorkspace",0,(e,t)=>a(`/api/workspaces/${e}${i(e)}`,{method:"PATCH",body:JSON.stringify(t)}),"uploadEmailAttachment",0,l],222862)},728886,e=>{"use strict";var t=e.i(653772),r=e.i(613349);e.s(["Skeleton",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("animate-pulse rounded-md bg-muted",e),...n})}])},896210,e=>{"use strict";let t=(0,e.i(419412).default)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);e.s(["Mail",0,t],896210)},330746,e=>{"use strict";let t=(0,e.i(419412).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],330746)},966662,940931,e=>{"use strict";let t=(0,e.i(419412).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],966662);var r=e.i(653772),n=e.i(511043),a=e.i(111114);let i=`
60
60
  html, body {
61
61
  overflow: hidden;
62
62
  }
@@ -77,7 +77,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error
77
77
  }
78
78
  a { color: inherit; }
79
79
  img { max-width: 100%; height: auto; }
80
- `,l=`
80
+ `,o=`
81
81
  html, body {
82
82
  --sb-thumb: rgba(255,255,255,0.1);
83
83
  --sb-hover: rgba(255,255,255,0.25);
@@ -109,13 +109,13 @@ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error
109
109
  color: #f0ede8 !important;
110
110
  }
111
111
  a { color: #93b5ff !important; }
112
- `;e.s(["EmailBodyFrame",0,function({html:e,className:t}){let o=(0,n.useRef)(null),{resolvedTheme:c}=(0,a.useTheme)(),[u,d]=(0,n.useState)(200),p="dark"===c;return(0,n.useEffect)(()=>{let t=o.current;if(!t)return;let r=null;t.srcdoc=`<!DOCTYPE html>
112
+ `;e.s(["EmailBodyFrame",0,function({html:e,className:t}){let l=(0,n.useRef)(null),{resolvedTheme:c}=(0,a.useTheme)(),[d,u]=(0,n.useState)(200),p="dark"===c;return(0,n.useEffect)(()=>{let t=l.current;if(!t)return;let r=null;t.srcdoc=`<!DOCTYPE html>
113
113
  <html>
114
114
  <head>
115
115
  <meta charset="utf-8">
116
116
  <meta name="viewport" content="width=device-width, initial-scale=1">
117
117
  <meta name="color-scheme" content="${p?"dark":"light"}">
118
- <style>${i}${p?l:s}</style>
118
+ <style>${i}${p?o:s}</style>
119
119
  </head>
120
120
  <body>${e}</body>
121
- </html>`;let n=()=>{let e=t.contentDocument;if(!e)return;let n=()=>{let t=e.documentElement.scrollHeight;t>0&&d(t)};n(),(r=new ResizeObserver(n)).observe(e.documentElement)};return t.addEventListener("load",n),()=>{t.removeEventListener("load",n),r?.disconnect()}},[e,p]),(0,r.jsx)("iframe",{ref:o,sandbox:"allow-same-origin",className:t,style:{width:"100%",height:`${u}px`,border:"none",display:"block"},title:"Email content"})}],940931)},353155,e=>{"use strict";var t=e.i(452691);e.s(["Check",()=>t.default])},419412,e=>{"use strict";var t=e.i(511043);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.createContext)({}),s=(0,t.forwardRef)(({color:e,size:n,strokeWidth:s,absoluteStrokeWidth:l,className:o="",children:c,iconNode:u,...d},p)=>{let{size:h=24,strokeWidth:g=2,absoluteStrokeWidth:f=!1,color:m="currentColor",className:k=""}=(0,t.useContext)(i)??{},b=l??f?24*Number(s??g)/Number(n??h):s??g;return(0,t.createElement)("svg",{ref:p,...a,width:n??h??a.width,height:n??h??a.height,stroke:e??m,strokeWidth:b,className:r("lucide",k,o),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...u.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(c)?c:[c]])});e.s(["default",0,(e,a)=>{let i=(0,t.forwardRef)(({className:i,...l},o)=>(0,t.createElement)(s,{ref:o,iconNode:a,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,i),...l}));return i.displayName=n(e),i}],419412)},879486,384265,e=>{"use strict";e.i(811374);var t=e.i(511043),r=e.i(92615),n=e.i(298604),a=e.i(990966),i=e.i(372252),s=e.i(154680);let l=t.createContext(void 0);function o(e=!1){let r=t.useContext(l);if(void 0===r&&!e)throw Error((0,s.default)(16));return r}function c(e){return(0,r.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,l,"useCompositeRootContext",0,o],384265),e.s(["useButton",0,function(e={}){let{disabled:r=!1,focusableWhenDisabled:s,tabIndex:l=0,native:u=!0,composite:d}=e,p=t.useRef(null),h=o(!0),g=d??void 0!==h,{props:f}=function(e){let{focusableWhenDisabled:r,disabled:n,composite:a=!1,tabIndex:i=0,isNativeButton:s}=e,l=a&&!1!==r,o=a&&!1===r;return{props:t.useMemo(()=>{let e={onKeyDown(e){n&&r&&"Tab"!==e.key&&e.preventDefault()}};return a||(e.tabIndex=i,!s&&n&&(e.tabIndex=r?i:-1)),(s&&(r||l)||!s&&n)&&(e["aria-disabled"]=n),s&&(!r||o)&&(e.disabled=n),e},[a,n,r,l,o,s,i])}}({focusableWhenDisabled:s,disabled:r,composite:g,tabIndex:l,isNativeButton:u}),m=t.useCallback(()=>{let e=p.current;c(e)&&g&&r&&void 0===f.disabled&&e.disabled&&(e.disabled=!1)},[r,f.disabled,g]);return(0,a.useIsoLayoutEffect)(m,[m]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:n,onKeyUp:a,onKeyDown:s,onPointerDown:l,...o}=e;return(0,i.mergeProps)({onClick(e){r?e.preventDefault():t?.(e)},onMouseDown(e){r||n?.(e)},onKeyDown(e){var n;if(r||((0,i.makeEventPreventable)(e),s?.(e),e.baseUIHandlerPrevented))return;let a=e.target===e.currentTarget,l=e.currentTarget,o=c(l),d=!u&&(n=l,!!(n?.tagName==="A"&&n?.href)),p=a&&(u?o:!d),h="Enter"===e.key,f=" "===e.key,m=l.getAttribute("role"),k=m?.startsWith("menuitem")||"option"===m||"gridcell"===m;if(a&&g&&f){if(e.defaultPrevented&&k)return;e.preventDefault(),d||u&&o?(l.click(),e.preventBaseUIHandler()):p&&(t?.(e),e.preventBaseUIHandler());return}p&&(!u&&(f||h)&&e.preventDefault(),!u&&h&&t?.(e))},onKeyUp(e){r||(((0,i.makeEventPreventable)(e),a?.(e),e.target===e.currentTarget&&u&&g&&c(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||u||g||" "!==e.key||t?.(e)))},onPointerDown(e){r?e.preventDefault():l?.(e)}},u?{type:"button"}:{role:"button"},f,o)},[r,f,g,u]),buttonRef:(0,n.useStableCallback)(e=>{p.current=e,m()})}}],879486)},294237,e=>{"use strict";var t=e.i(7284);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var i;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:s,defaultVariants:l}=t,o=Object.keys(s).map(e=>{let t=null==a?void 0:a[e],n=null==l?void 0:l[e];if(null===t)return null;let i=r(t)||r(n);return s[e][i]}),c=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,o,null==t||null==(i=t.compoundVariants)?void 0:i.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...c}[t]):({...l,...c})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},186339,e=>{"use strict";var t=e.i(653772);e.i(811374);var r=e.i(511043),n=e.i(879486),a=e.i(695681);let i=r.forwardRef(function(e,t){let{render:r,className:i,disabled:s=!1,focusableWhenDisabled:l=!1,nativeButton:o=!0,style:c,...u}=e,{getButtonProps:d,buttonRef:p}=(0,n.useButton)({disabled:s,focusableWhenDisabled:l,native:o});return(0,a.useRenderElement)("button",e,{state:{disabled:s},ref:[t,p],props:[u,d]})});var s=e.i(294237),l=e.i(613349);let o=(0,s.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:r="default",size:n="default",...a}){return(0,t.jsx)(i,{"data-slot":"button",className:(0,l.cn)(o({variant:r,size:n,className:e})),...a})},"buttonVariants",0,o],186339)},452691,e=>{"use strict";let t=(0,e.i(419412).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},945074,e=>{"use strict";let t=(0,e.i(419412).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],945074)},332680,e=>{"use strict";var t=e.i(653772),r=e.i(12529),n=e.i(613349),a=e.i(186339),i=e.i(887972);function s({...e}){return(0,t.jsx)(r.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function l({className:e,...a}){return(0,t.jsx)(r.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,n.cn)("fixed inset-0 z-50 bg-black/20 backdrop-blur-[2px] transition-[opacity,backdrop-filter] duration-200 ease-out data-ending-style:opacity-0 data-ending-style:backdrop-blur-none data-starting-style:opacity-0 data-starting-style:backdrop-blur-none",e),...a})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(r.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,n.cn)("flex-1 overflow-y-auto thin-scrollbar px-4 sm:px-6 py-5",e),...r})},"SheetClose",0,function({...e}){return(0,t.jsx)(r.Dialog.Close,{"data-slot":"sheet-close",...e})},"SheetContent",0,function({className:e,children:o,side:c="right",showCloseButton:u=!0,...d}){return(0,t.jsxs)(s,{children:[(0,t.jsx)(l,{forceRender:!0}),(0,t.jsxs)(r.Dialog.Popup,{"data-slot":"sheet-content","data-side":c,className:(0,n.cn)("fixed z-50 flex flex-col bg-background shadow-xl outline-none transition duration-300 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0","data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-full data-[side=right]:max-w-md data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10","data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-full data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10","data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10","data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10",e),...d,children:[o,u&&(0,t.jsxs)(r.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(a.Button,{variant:"ghost",className:"absolute top-3 right-3 z-10",size:"icon-sm"}),children:[(0,t.jsx)(i.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...a}){return(0,t.jsx)(r.Dialog.Description,{"data-slot":"sheet-description",className:(0,n.cn)("text-sm text-muted-foreground",e),...a})},"SheetFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 border-t bg-muted/50 px-4 sm:px-6 py-4 sm:flex-row sm:justify-end",e),...r})},"SheetHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,n.cn)("flex flex-col gap-1 border-b px-4 sm:px-6 py-5",e),...r})},"SheetTitle",0,function({className:e,...a}){return(0,t.jsx)(r.Dialog.Title,{"data-slot":"sheet-title",className:(0,n.cn)("font-heading text-lg leading-tight font-semibold",e),...a})},"SheetTrigger",0,function({...e}){return(0,t.jsx)(r.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}])},393153,e=>{"use strict";var t=e.i(653772),r=e.i(779646),n=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:a,title:i,description:s,confirmLabel:l="Remove",loadingLabel:o,confirmVariant:c="destructive",loading:u=!1,onConfirm:d}){return(0,t.jsx)(r.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(r.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(r.DialogHeader,{children:[(0,t.jsx)(r.DialogTitle,{children:i}),(0,t.jsx)(r.DialogDescription,{children:s})]}),(0,t.jsxs)(r.DialogFooter,{children:[(0,t.jsx)(n.Button,{variant:"outline",size:"sm",onClick:()=>a(!1),disabled:u,children:"Cancel"}),(0,t.jsx)(n.Button,{variant:c,size:"sm",onClick:d,disabled:u,children:u?o??`${l}...`:l})]})]})})}])},875061,e=>{"use strict";var t=e.i(372252),r=e.i(695681),n=e.i(294237),a=e.i(613349);let i=(0,n.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:n="default",render:s,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:n}),e)},l),render:s,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(o.defaultTagName??"div",o,o)},"badgeVariants",0,i],875061)},82970,e=>{"use strict";let t=(0,e.i(419412).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],82970)},294518,e=>{"use strict";let t=(0,e.i(419412).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,t],294518)},267007,e=>{"use strict";let t=(0,e.i(419412).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],267007)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},896315,219658,e=>{"use strict";var t=e.i(419412);let r=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,r],896315);var n=e.i(653772),a=e.i(511043),i=e.i(186339),s=e.i(329686);let l=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var o=e.i(613349);e.s(["ScrollToBottomButton",0,function({scrollRef:e,threshold:t=100}){let[r,c]=(0,a.useState)(!1),u=(0,a.useCallback)(()=>{let r=e.current;if(!r)return;let n=r.scrollHeight-r.scrollTop-r.clientHeight<t;c(r.scrollHeight>r.clientHeight&&!n)},[e,t]);return(0,a.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",u,{passive:!0}),u();let r=new ResizeObserver(u);return r.observe(t),()=>{t.removeEventListener("scroll",u),r.disconnect()}},[e,u]),(0,n.jsx)("div",{className:(0,o.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",r?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,n.jsxs)(s.Tooltip,{children:[(0,n.jsx)(s.TooltipTrigger,{render:(0,n.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t=e.current;t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,n.jsx)(l,{})}),(0,n.jsx)(s.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],219658)},899746,e=>{"use strict";let t="browser-notification-enabled",r="browser-notification-events",n=["completed","failed"],a={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function s(){return"true"===localStorage.getItem(t)}function l(){try{let e=localStorage.getItem(r);if(e)return JSON.parse(e)}catch{}return[...n]}async function o(){return!!i()&&("granted"===Notification.permission||"denied"!==Notification.permission&&"granted"===await Notification.requestPermission())}e.s(["NOTIFICATION_EVENTS",0,n,"NOTIFICATION_EVENT_LABELS",0,a,"getNotificationEnabled",0,s,"getNotificationEvents",0,l,"isNotificationSupported",0,i,"requestNotificationPermission",0,o,"sendTaskNotification",0,function(e,t,r){if(!i()||"granted"!==Notification.permission||!s()||!l().includes(e))return;let n=a[e]??`Task ${e}`;new Notification(t?`${t} — ${n}`:n,{body:r??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(r,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(222862),a=e.i(355578),i=e.i(500324),s=e.i(899746);let l="inbox-filter-types",o=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],u=["user_dm_message"];function d(){try{let e=localStorage.getItem(l);if(!e)return c;let t=JSON.parse(e).filter(e=>o.includes(e));if(0===t.length)return c;for(let e of u)t.includes(e)||t.unshift(e);return t}catch{return c}}e.s(["INBOX_FILTER_LABELS",0,{user_dm_message:"DM",calendar_event:"Calendar",email_notification:"Email"},"INBOX_FILTER_TYPES",0,o,"MANDATORY_INBOX_TYPES",0,u,"getInboxFilterTypes",0,d,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of u)t.includes(e)||t.unshift(e);localStorage.setItem(l,JSON.stringify(t))}],685835);let p=(0,r.createContext)(null),h={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:l}=(0,i.useWorkspace)(),{subscribeWs:o,agents:c}=(0,a.useAgentContext)(),[u,h]=(0,r.useState)(0),[g,f]=(0,r.useState)(0),m=(0,r.useRef)(null),k=(0,r.useRef)(null),b=(0,r.useRef)(c);(0,r.useEffect)(()=>{b.current=c});let x=(0,r.useCallback)(()=>{let e=d();(0,n.getInboxCount)(l,{types:e}).then(e=>{let t=m.current;if(m.current=e.count,h(e.count),null!==t&&e.count>t){f(e=>e+1);let e=k.current?b.current.find(e=>e.id===k.current):void 0;(0,s.sendTaskNotification)("completed",e?.name)}k.current=null}).catch(()=>{})},[l]),y=(0,r.useCallback)(()=>{h(e=>Math.max(0,e-1))},[]);return(0,r.useEffect)(()=>{x()},[x]),(0,r.useEffect)(()=>o(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(k.current=e.agentId,x())}),[o,x]),(0,r.useEffect)(()=>{let e=setInterval(x,6e4);return()=>clearInterval(e)},[x]),(0,t.jsx)(p.Provider,{value:{count:u,notificationToken:g,refresh:x,decrement:y},children:e})},"useInboxCount",0,function(){return(0,r.useContext)(p)??h}],875494)}]);
121
+ </html>`;let n=()=>{let e=t.contentDocument;if(!e)return;let n=()=>{let t=e.documentElement.scrollHeight;t>0&&u(t)};n(),(r=new ResizeObserver(n)).observe(e.documentElement)};return t.addEventListener("load",n),()=>{t.removeEventListener("load",n),r?.disconnect()}},[e,p]),(0,r.jsx)("iframe",{ref:l,sandbox:"allow-same-origin",className:t,style:{width:"100%",height:`${d}px`,border:"none",display:"block"},title:"Email content"})}],940931)},353155,e=>{"use strict";var t=e.i(452691);e.s(["Check",()=>t.default])},419412,e=>{"use strict";var t=e.i(511043);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.createContext)({}),s=(0,t.forwardRef)(({color:e,size:n,strokeWidth:s,absoluteStrokeWidth:o,className:l="",children:c,iconNode:d,...u},p)=>{let{size:h=24,strokeWidth:g=2,absoluteStrokeWidth:f=!1,color:m="currentColor",className:k=""}=(0,t.useContext)(i)??{},b=o??f?24*Number(s??g)/Number(n??h):s??g;return(0,t.createElement)("svg",{ref:p,...a,width:n??h??a.width,height:n??h??a.height,stroke:e??m,strokeWidth:b,className:r("lucide",k,l),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(c)?c:[c]])});e.s(["default",0,(e,a)=>{let i=(0,t.forwardRef)(({className:i,...o},l)=>(0,t.createElement)(s,{ref:l,iconNode:a,className:r(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,i),...o}));return i.displayName=n(e),i}],419412)},879486,384265,e=>{"use strict";e.i(811374);var t=e.i(511043),r=e.i(92615),n=e.i(298604),a=e.i(990966),i=e.i(372252),s=e.i(154680);let o=t.createContext(void 0);function l(e=!1){let r=t.useContext(o);if(void 0===r&&!e)throw Error((0,s.default)(16));return r}function c(e){return(0,r.isHTMLElement)(e)&&"BUTTON"===e.tagName}e.s(["CompositeRootContext",0,o,"useCompositeRootContext",0,l],384265),e.s(["useButton",0,function(e={}){let{disabled:r=!1,focusableWhenDisabled:s,tabIndex:o=0,native:d=!0,composite:u}=e,p=t.useRef(null),h=l(!0),g=u??void 0!==h,{props:f}=function(e){let{focusableWhenDisabled:r,disabled:n,composite:a=!1,tabIndex:i=0,isNativeButton:s}=e,o=a&&!1!==r,l=a&&!1===r;return{props:t.useMemo(()=>{let e={onKeyDown(e){n&&r&&"Tab"!==e.key&&e.preventDefault()}};return a||(e.tabIndex=i,!s&&n&&(e.tabIndex=r?i:-1)),(s&&(r||o)||!s&&n)&&(e["aria-disabled"]=n),s&&(!r||l)&&(e.disabled=n),e},[a,n,r,o,l,s,i])}}({focusableWhenDisabled:s,disabled:r,composite:g,tabIndex:o,isNativeButton:d}),m=t.useCallback(()=>{let e=p.current;c(e)&&g&&r&&void 0===f.disabled&&e.disabled&&(e.disabled=!1)},[r,f.disabled,g]);return(0,a.useIsoLayoutEffect)(m,[m]),{getButtonProps:t.useCallback((e={})=>{let{onClick:t,onMouseDown:n,onKeyUp:a,onKeyDown:s,onPointerDown:o,...l}=e;return(0,i.mergeProps)({onClick(e){r?e.preventDefault():t?.(e)},onMouseDown(e){r||n?.(e)},onKeyDown(e){var n;if(r||((0,i.makeEventPreventable)(e),s?.(e),e.baseUIHandlerPrevented))return;let a=e.target===e.currentTarget,o=e.currentTarget,l=c(o),u=!d&&(n=o,!!(n?.tagName==="A"&&n?.href)),p=a&&(d?l:!u),h="Enter"===e.key,f=" "===e.key,m=o.getAttribute("role"),k=m?.startsWith("menuitem")||"option"===m||"gridcell"===m;if(a&&g&&f){if(e.defaultPrevented&&k)return;e.preventDefault(),u||d&&l?(o.click(),e.preventBaseUIHandler()):p&&(t?.(e),e.preventBaseUIHandler());return}p&&(!d&&(f||h)&&e.preventDefault(),!d&&h&&t?.(e))},onKeyUp(e){r||(((0,i.makeEventPreventable)(e),a?.(e),e.target===e.currentTarget&&d&&g&&c(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||d||g||" "!==e.key||t?.(e)))},onPointerDown(e){r?e.preventDefault():o?.(e)}},d?{type:"button"}:{role:"button"},f,l)},[r,f,g,d]),buttonRef:(0,n.useStableCallback)(e=>{p.current=e,m()})}}],879486)},294237,e=>{"use strict";var t=e.i(7284);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var i;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(e=>{let t=null==a?void 0:a[e],n=null==o?void 0:o[e];if(null===t)return null;let i=r(t)||r(n);return s[e][i]}),c=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,l,null==t||null==(i=t.compoundVariants)?void 0:i.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...c}[t]):({...o,...c})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},186339,e=>{"use strict";var t=e.i(653772);e.i(811374);var r=e.i(511043),n=e.i(879486),a=e.i(695681);let i=r.forwardRef(function(e,t){let{render:r,className:i,disabled:s=!1,focusableWhenDisabled:o=!1,nativeButton:l=!0,style:c,...d}=e,{getButtonProps:u,buttonRef:p}=(0,n.useButton)({disabled:s,focusableWhenDisabled:o,native:l});return(0,a.useRenderElement)("button",e,{state:{disabled:s},ref:[t,p],props:[d,u]})});var s=e.i(294237),o=e.i(613349);let l=(0,s.cva)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:r="default",size:n="default",...a}){return(0,t.jsx)(i,{"data-slot":"button",className:(0,o.cn)(l({variant:r,size:n,className:e})),...a})},"buttonVariants",0,l],186339)},452691,e=>{"use strict";let t=(0,e.i(419412).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t])},945074,e=>{"use strict";let t=(0,e.i(419412).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],945074)},332680,e=>{"use strict";var t=e.i(653772),r=e.i(12529),n=e.i(613349),a=e.i(186339),i=e.i(887972);function s({...e}){return(0,t.jsx)(r.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function o({className:e,...a}){return(0,t.jsx)(r.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,n.cn)("fixed inset-0 z-50 bg-black/20 backdrop-blur-[2px] transition-[opacity,backdrop-filter] duration-200 ease-out data-ending-style:opacity-0 data-ending-style:backdrop-blur-none data-starting-style:opacity-0 data-starting-style:backdrop-blur-none",e),...a})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(r.Dialog.Root,{"data-slot":"sheet",...e})},"SheetBody",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-body",className:(0,n.cn)("flex-1 overflow-y-auto thin-scrollbar px-4 sm:px-6 py-5",e),...r})},"SheetClose",0,function({...e}){return(0,t.jsx)(r.Dialog.Close,{"data-slot":"sheet-close",...e})},"SheetContent",0,function({className:e,children:l,side:c="right",showCloseButton:d=!0,...u}){return(0,t.jsxs)(s,{children:[(0,t.jsx)(o,{forceRender:!0}),(0,t.jsxs)(r.Dialog.Popup,{"data-slot":"sheet-content","data-side":c,className:(0,n.cn)("fixed z-50 flex flex-col bg-background shadow-xl outline-none transition duration-300 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0","data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-full data-[side=right]:max-w-md data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10","data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-full data-[side=left]:max-w-md data-[side=left]:border-r data-[side=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10","data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10","data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10",e),...u,children:[l,d&&(0,t.jsxs)(r.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(a.Button,{variant:"ghost",className:"absolute top-3 right-3 z-10",size:"icon-sm"}),children:[(0,t.jsx)(i.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...a}){return(0,t.jsx)(r.Dialog.Description,{"data-slot":"sheet-description",className:(0,n.cn)("text-sm text-muted-foreground",e),...a})},"SheetFooter",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 border-t bg-muted/50 px-4 sm:px-6 py-4 sm:flex-row sm:justify-end",e),...r})},"SheetHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,n.cn)("flex flex-col gap-1 border-b px-4 sm:px-6 py-5",e),...r})},"SheetTitle",0,function({className:e,...a}){return(0,t.jsx)(r.Dialog.Title,{"data-slot":"sheet-title",className:(0,n.cn)("font-heading text-lg leading-tight font-semibold",e),...a})},"SheetTrigger",0,function({...e}){return(0,t.jsx)(r.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}])},393153,e=>{"use strict";var t=e.i(653772),r=e.i(779646),n=e.i(186339);e.s(["ConfirmDialog",0,function({open:e,onOpenChange:a,title:i,description:s,confirmLabel:o="Remove",loadingLabel:l,confirmVariant:c="destructive",loading:d=!1,onConfirm:u}){return(0,t.jsx)(r.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(r.DialogContent,{showCloseButton:!1,children:[(0,t.jsxs)(r.DialogHeader,{children:[(0,t.jsx)(r.DialogTitle,{children:i}),(0,t.jsx)(r.DialogDescription,{children:s})]}),(0,t.jsxs)(r.DialogFooter,{children:[(0,t.jsx)(n.Button,{variant:"outline",size:"sm",onClick:()=>a(!1),disabled:d,children:"Cancel"}),(0,t.jsx)(n.Button,{variant:c,size:"sm",onClick:u,disabled:d,children:d?l??`${o}...`:o})]})]})})}])},875061,e=>{"use strict";var t=e.i(372252),r=e.i(695681),n=e.i(294237),a=e.i(613349);let i=(0,n.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:n="default",render:s,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:n}),e)},o),render:s,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(l.defaultTagName??"div",l,l)},"badgeVariants",0,i],875061)},82970,e=>{"use strict";let t=(0,e.i(419412).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],82970)},294518,e=>{"use strict";let t=(0,e.i(419412).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,t],294518)},267007,e=>{"use strict";let t=(0,e.i(419412).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],267007)},758956,e=>{"use strict";let t=(0,e.i(419412).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],758956)},51724,e=>{"use strict";let t=(0,e.i(419412).default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);e.s(["CircleDot",0,t],51724)},131890,e=>{"use strict";let t=(0,e.i(419412).default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,t],131890)},465368,e=>{"use strict";var t=e.i(653772);e.s(["EmailCard",0,function({subject:e,address:r,direction:n,onClick:a}){return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:!a,className:"card-grain w-104 max-w-full overflow-hidden rounded-(--radius) border border-(--border) bg-(--paper) text-left flex flex-col cursor-pointer transition-[transform,box-shadow] duration-300 ease-out hover:-translate-y-0.5 [box-shadow:var(--e1)] hover:[box-shadow:var(--e2)]",children:[(0,t.jsx)("span",{className:"h-2.5 relative block",children:(0,t.jsx)("svg",{viewBox:"0 0 100 10",preserveAspectRatio:"none",className:"absolute inset-0 w-full h-full",children:(0,t.jsx)("path",{d:"M8,-1 L50,9 L92,-1",stroke:"var(--te)",strokeWidth:"2.5",opacity:"0.4",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"})})}),(0,t.jsxs)("span",{className:"p-3 flex flex-col",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 mb-1",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] text-(--muted-foreground) flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",children:["inbound"===n?"from ":"to ",r]}),(0,t.jsx)("span",{className:"shrink-0 text-[0.5rem] font-bold uppercase tracking-wider text-(--te) px-1 py-0.5 rounded-[3px] border-[1.5px] border-(--te) opacity-45 -rotate-3",children:"inbound"===n?"Inbound":"Sent"})]}),(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold tracking-[-0.01em] leading-[1.35] line-clamp-2",children:e})]})]})}])},754902,855351,157349,e=>{"use strict";var t=e.i(653772),r=e.i(613349);let n={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-br-[0.35rem]",middle:"rounded-[1.05rem] rounded-tr-[0.35rem] rounded-br-[0.35rem]",last:"rounded-[1.05rem] rounded-tr-[0.35rem]"},a={single:"rounded-[1.05rem]",first:"rounded-[1.05rem] rounded-bl-[0.35rem]",middle:"rounded-[1.05rem] rounded-tl-[0.35rem] rounded-bl-[0.35rem]",last:"rounded-[1.05rem] rounded-tl-[0.35rem]"};function i(){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-0.5","aria-hidden":!0,children:[(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.2s_infinite]"}),(0,t.jsx)("span",{className:"size-1 rounded-full bg-muted-foreground/60 motion-safe:animate-[typing-dot_1.2s_ease-in-out_0.4s_infinite]"})]})}e.s(["MessageBubble",0,function({variant:e,position:i,children:s,className:o,...l}){let c="user"===e?n[i]:a[i];return(0,t.jsx)("div",{className:(0,r.cn)("px-3 py-1.5 text-base",c,"user"===e?"bg-primary text-primary-foreground":"bg-muted text-foreground",o),...l,children:s})}],754902),e.s(["AVATAR_SIZE",0,30,"MessageCluster",0,function({avatar:e,name:n,children:a,position:i,className:s}){let o="first"===i||"solo"===i;return(0,t.jsxs)("div",{className:(0,r.cn)("flex justify-start items-start gap-2 min-w-0",s),children:[(0,t.jsx)("div",{className:(0,r.cn)("w-[30px]","shrink-0"),"aria-hidden":!o,children:o&&e}),(0,t.jsxs)("div",{className:"min-w-0 max-w-[86%] flex flex-col items-start gap-0.5",children:[o&&(0,t.jsx)("span",{className:"text-[0.85rem] font-semibold text-foreground leading-[1.15] pt-0.5 mb-1",children:n}),a]})]})}],855351),e.s(["PresenceLine",0,function({agentFirstName:e,taskStatus:n}){let a="running"===n?"typing":"queued"===n||"dispatched"===n?"reading":"idle";return(0,t.jsx)("div",{className:"h-5 px-1 mb-2 flex items-center","aria-live":"polite",children:(0,t.jsx)("span",{className:(0,r.cn)("inline-flex items-center gap-1.5 text-sm text-muted-foreground","idle"!==a&&"motion-safe:animate-[fade-up_200ms_ease-out_both]"),children:"idle"!==a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"reading"===a?`${e} is reading`:`${e} is typing`}),(0,t.jsx)(i,{})]})},a)})}],157349)},41793,e=>{"use strict";let t=(0,e.i(419412).default)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);e.s(["CalendarDays",0,t],41793)},896315,219658,e=>{"use strict";var t=e.i(419412);let r=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,r],896315);var n=e.i(653772),a=e.i(511043),i=e.i(186339),s=e.i(329686);let o=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var l=e.i(613349);e.s(["ScrollToBottomButton",0,function({scrollRef:e,threshold:t=100}){let[r,c]=(0,a.useState)(!1),d=(0,a.useCallback)(()=>{let r=e.current;if(!r)return;let n=r.scrollHeight-r.scrollTop-r.clientHeight<t;c(r.scrollHeight>r.clientHeight&&!n)},[e,t]);return(0,a.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",d,{passive:!0}),d();let r=new ResizeObserver(d);return r.observe(t),()=>{t.removeEventListener("scroll",d),r.disconnect()}},[e,d]),(0,n.jsx)("div",{className:(0,l.cn)("absolute bottom-1 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 ease-out",r?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:(0,n.jsxs)(s.Tooltip,{children:[(0,n.jsx)(s.TooltipTrigger,{render:(0,n.jsx)(i.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t=e.current;t&&t.scrollTo({top:t.scrollHeight,behavior:"smooth"})},className:"rounded-full bg-background/80 backdrop-blur-sm border shadow-sm hover:bg-background"}),children:(0,n.jsx)(o,{})}),(0,n.jsx)(s.TooltipContent,{side:"top",children:"Scroll to bottom"})]})})}],219658)},899746,e=>{"use strict";let t="browser-notification-enabled",r="browser-notification-events",n=["completed","failed"],a={completed:"Task Completed",failed:"Task Failed"};function i(){return"Notification"in window}function s(){return"true"===localStorage.getItem(t)}function o(){try{let e=localStorage.getItem(r);if(e)return JSON.parse(e)}catch{}return[...n]}async function l(){return!!i()&&("granted"===Notification.permission||"denied"!==Notification.permission&&"granted"===await Notification.requestPermission())}e.s(["NOTIFICATION_EVENTS",0,n,"NOTIFICATION_EVENT_LABELS",0,a,"getNotificationEnabled",0,s,"getNotificationEvents",0,o,"isNotificationSupported",0,i,"requestNotificationPermission",0,l,"sendTaskNotification",0,function(e,t,r){if(!i()||"granted"!==Notification.permission||!s()||!o().includes(e))return;let n=a[e]??`Task ${e}`;new Notification(t?`${t} — ${n}`:n,{body:r??"",icon:"/alook.svg"})},"setNotificationEnabled",0,function(e){localStorage.setItem(t,String(e))},"setNotificationEvents",0,function(e){localStorage.setItem(r,JSON.stringify(e))}])},875494,685835,e=>{"use strict";var t=e.i(653772),r=e.i(511043),n=e.i(222862),a=e.i(355578),i=e.i(500324),s=e.i(899746);let o="inbox-filter-types",l=["user_dm_message","calendar_event","email_notification"],c=["user_dm_message"],d=["user_dm_message"];function u(){try{let e=localStorage.getItem(o);if(!e)return c;let t=JSON.parse(e).filter(e=>l.includes(e));if(0===t.length)return c;for(let e of d)t.includes(e)||t.unshift(e);return t}catch{return c}}e.s(["INBOX_FILTER_LABELS",0,{user_dm_message:"DM",calendar_event:"Calendar",email_notification:"Email"},"INBOX_FILTER_TYPES",0,l,"MANDATORY_INBOX_TYPES",0,d,"getInboxFilterTypes",0,u,"setInboxFilterTypes",0,function(e){let t=[...e];for(let e of d)t.includes(e)||t.unshift(e);localStorage.setItem(o,JSON.stringify(t))}],685835);let p=(0,r.createContext)(null),h={count:0,notificationToken:0,refresh:()=>{},decrement:()=>{}};e.s(["InboxCountProvider",0,function({children:e}){let{workspaceId:o}=(0,i.useWorkspace)(),{subscribeWs:l,agents:c}=(0,a.useAgentContext)(),[d,h]=(0,r.useState)(0),[g,f]=(0,r.useState)(0),m=(0,r.useRef)(null),k=(0,r.useRef)(null),b=(0,r.useRef)(c);(0,r.useEffect)(()=>{b.current=c});let x=(0,r.useCallback)(()=>{let e=u();(0,n.getInboxCount)(o,{types:e}).then(e=>{let t=m.current;if(m.current=e.count,h(e.count),null!==t&&e.count>t){f(e=>e+1);let e=k.current?b.current.find(e=>e.id===k.current):void 0;(0,s.sendTaskNotification)("completed",e?.name)}k.current=null}).catch(()=>{})},[o]),y=(0,r.useCallback)(()=>{h(e=>Math.max(0,e-1))},[]);return(0,r.useEffect)(()=>{x()},[x]),(0,r.useEffect)(()=>l(e=>{"task.updated"===e.type&&("completed"===e.status||"failed"===e.status)&&(k.current=e.agentId,x())}),[l,x]),(0,r.useEffect)(()=>{let e=setInterval(x,6e4);return()=>clearInterval(e)},[x]),(0,t.jsx)(p.Provider,{value:{count:d,notificationToken:g,refresh:x,decrement:y},children:e})},"useInboxCount",0,function(){return(0,r.useContext)(p)??h}],875494)}]);